[FFmpeg-devel] [PATCH] avcodec: add new Videotoolbox hwaccel.

Zhang Rui bbcallen at gmail.com
Wed Jul 1 05:57:53 CEST 2015


> +static void videotoolbox_default_free(AVCodecContext *avctx)
> +{
> +    AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;
> +
> +    if (videotoolbox) {
> +        if (videotoolbox->cm_fmt_desc)
> +            CFRelease(videotoolbox->cm_fmt_desc);
> +
> +        if (videotoolbox->session)

Better add VTDecompressionSessionWaitForAsynchronousFrames() here,
in case it is removed from videotoolbox_session_decode_frame() in
future by chance.

Callback could be called even after VTDecompressionSessionInvalidate()
when I try to work with flag kVTDecodeFrame_EnableAsynchronousDecompression
and without VTDecompressionSessionWaitForAsynchronousFrames() per sample
in my own player.

> +            VTDecompressionSessionInvalidate(videotoolbox->session);
> +    }
> +}
> +


More information about the ffmpeg-devel mailing list