X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Finternal.h;h=9a8b4bc336e2ab15567fccd644f34335539b6b9c;hb=7fd9d49ba7fa57629592b1f7064cb12d96984a14;hp=ed38c61d3cc881228414ed47374f2e4307e378e7;hpb=eadba3e94daac2f48fd9ce7c9fdf5a562d3274ed;p=ffmpeg diff --git a/libavcodec/internal.h b/libavcodec/internal.h index ed38c61d3cc..9a8b4bc336e 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -178,4 +178,16 @@ int ff_get_logical_cpus(AVCodecContext *avctx); int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx); +/** + * Call avcodec_open2 recursively by decrementing counter, unlocking mutex, + * calling the function and then restoring again. Assumes the mutex is + * already locked + */ +int ff_codec_open2_recursive(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options); + +/** + * Call avcodec_close recursively, counterpart to avcodec_open2_recursive. + */ +int ff_codec_close_recursive(AVCodecContext *avctx); + #endif /* AVCODEC_INTERNAL_H */