diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-11-09 01:03:57 +0000 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-02-20 22:04:12 +0000 |
commit | 2651352988212531038326c44754ece1728c4a3b (patch) | |
tree | 0a881dcc977760e4181e7018028d790806b72c15 /libavcodec/vaapi_encode_h265.c | |
parent | cc1c94dacd0642ac1a6cad45deb65071f127d91a (diff) | |
download | ffmpeg-2651352988212531038326c44754ece1728c4a3b.tar.gz |
cbs: Allocate the context inside the init function
... instead of making callers allocate it themselves. This is more
consistent with other APIs in libav.
Diffstat (limited to 'libavcodec/vaapi_encode_h265.c')
-rw-r--r-- | libavcodec/vaapi_encode_h265.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c index a9853a3aa0..38c9e25212 100644 --- a/libavcodec/vaapi_encode_h265.c +++ b/libavcodec/vaapi_encode_h265.c @@ -55,7 +55,7 @@ typedef struct VAAPIEncodeH265Context { int slice_type; int pic_type; - CodedBitstreamContext cbc; + CodedBitstreamContext *cbc; CodedBitstreamFragment current_access_unit; int aud_needed; } VAAPIEncodeH265Context; @@ -76,7 +76,7 @@ static int vaapi_encode_h265_write_access_unit(AVCodecContext *avctx, VAAPIEncodeH265Context *priv = ctx->priv_data; int err; - err = ff_cbs_write_fragment_data(&priv->cbc, au); + err = ff_cbs_write_fragment_data(priv->cbc, au); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to write packed header.\n"); return err; @@ -104,7 +104,7 @@ static int vaapi_encode_h265_add_nal(AVCodecContext *avctx, H265RawNALUnitHeader *header = nal_unit; int err; - err = ff_cbs_insert_unit_content(&priv->cbc, au, -1, + err = ff_cbs_insert_unit_content(priv->cbc, au, -1, header->nal_unit_type, nal_unit); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to add NAL unit: " @@ -144,7 +144,7 @@ static int vaapi_encode_h265_write_sequence_header(AVCodecContext *avctx, err = vaapi_encode_h265_write_access_unit(avctx, data, data_len, au); fail: - ff_cbs_fragment_uninit(&priv->cbc, au); + ff_cbs_fragment_uninit(priv->cbc, au); return err; } @@ -171,7 +171,7 @@ static int vaapi_encode_h265_write_slice_header(AVCodecContext *avctx, err = vaapi_encode_h265_write_access_unit(avctx, data, data_len, au); fail: - ff_cbs_fragment_uninit(&priv->cbc, au); + ff_cbs_fragment_uninit(priv->cbc, au); return err; } |