cbs: Add function to read extradata from an AVCodecContext

This is useful in decoders and parsers, matching the way that bitstream
filters read extradata from AVCodecParameters.
This commit is contained in:
Mark Thompson
2020-11-23 17:53:57 +00:00
committed by Jan Ekström
parent 01eb05207c
commit 7bacf60ae5
2 changed files with 52 additions and 40 deletions

View File

@@ -262,6 +262,17 @@ int ff_cbs_read_extradata(CodedBitstreamContext *ctx,
CodedBitstreamFragment *frag,
const AVCodecParameters *par);
/**
* Read the extradata bitstream found in a codec context into a
* fragment, then split into units and decompose.
*
* This acts identical to ff_cbs_read_extradata() for the case where
* you already have a codec context.
*/
int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx,
CodedBitstreamFragment *frag,
const AVCodecContext *avctx);
/**
* Read the data bitstream from a packet into a fragment, then
* split into units and decompose.