[FFmpeg-devel] [PATCH] avcodec/cuviddec: use AVCodec.bsfs to filter packets

Anton Khirnov anton at khirnov.net
Tue Mar 3 13:01:31 EET 2020


Quoting James Almer (2020-03-02 14:15:20)
> On 3/2/2020 7:35 AM, Anton Khirnov wrote:
> > Quoting James Almer (2020-03-01 04:00:25)
> > [...]
> >> +    if (avctx->codec->bsfs) {
> >> +        const AVBSFContext *bsf = avctx->internal->filter.bsfs[avctx->internal->filter.nb_bsfs - 1];
> > 
> > yuck
> > 
> > I guess it's acceptable for now, but we'll want to get rid of that in
> > the future. Might be tricky though...
> > 
> > Patch looks good otherwise.
> 
> I tried in f631c328e6. Long story short, it was a disaster, since
> AVCodecContext.extradata is supposedly owned by the caller in decoding
> scenarios, and some projects started crashing because of it. Had to be
> reverted in 87588caf8c. So any solution will have to be internal but
> less ugly, or an API change.

Ah right. Actually I think it would be good to separate the codec
context seen by the decoder from the one seen by the user for other
reasons as well.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list