libopenh264enc: export CPB props side data
This commit is contained in:
parent
f0b769c16d
commit
11c9bd633f
3 changed files with 40 additions and 0 deletions
|
@ -2383,3 +2383,29 @@ AVCPBProperties *av_cpb_properties_alloc(size_t *size)
|
|||
|
||||
return props;
|
||||
}
|
||||
|
||||
AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx)
|
||||
{
|
||||
AVPacketSideData *tmp;
|
||||
AVCPBProperties *props;
|
||||
size_t size;
|
||||
|
||||
props = av_cpb_properties_alloc(&size);
|
||||
if (!props)
|
||||
return NULL;
|
||||
|
||||
tmp = av_realloc_array(avctx->coded_side_data, avctx->nb_coded_side_data + 1, sizeof(*tmp));
|
||||
if (!tmp) {
|
||||
av_freep(&props);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
avctx->coded_side_data = tmp;
|
||||
avctx->nb_coded_side_data++;
|
||||
|
||||
avctx->coded_side_data[avctx->nb_coded_side_data - 1].type = AV_PKT_DATA_CPB_PROPERTIES;
|
||||
avctx->coded_side_data[avctx->nb_coded_side_data - 1].data = (uint8_t*)props;
|
||||
avctx->coded_side_data[avctx->nb_coded_side_data - 1].size = size;
|
||||
|
||||
return props;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue