diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-12-17 13:31:21 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-12-17 13:31:21 +0100 |
commit | f49264a1c5912ee2bc23e7a09ded1024a178cf04 (patch) | |
tree | 8175c3e1c1f8a41ef936b5c8512d0817be72985b /libavcodec/utils.c | |
parent | dd6ee019ea828a2700e38366983ef343612021c6 (diff) | |
parent | 11c9bd633f635f07a762be1ecd672de55daf4edc (diff) | |
download | ffmpeg-streaming-f49264a1c5912ee2bc23e7a09ded1024a178cf04.zip ffmpeg-streaming-f49264a1c5912ee2bc23e7a09ded1024a178cf04.tar.gz |
Merge commit '11c9bd633f635f07a762be1ecd672de55daf4edc'
* commit '11c9bd633f635f07a762be1ecd672de55daf4edc':
libopenh264enc: export CPB props side data
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 488b67c..19f3f0a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3502,3 +3502,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; +} |