/* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVCODEC_CODEC_INTERNAL_H #define AVCODEC_CODEC_INTERNAL_H #include <stdint.h> #include "libavutil/attributes.h" #include "codec.h" #include "config.h" /** * The codec is not known to be init-threadsafe (i.e. it might be unsafe * to initialize this codec and another codec concurrently, typically because * the codec calls external APIs that are not known to be thread-safe). * Therefore calling the codec's init function needs to be guarded with a lock. */ #define FF_CODEC_CAP_NOT_INIT_THREADSAFE … /** * The codec allows calling the close function for deallocation even if * the init function returned a failure. Without this capability flag, a * codec does such cleanup internally when returning failures from the * init function and does not expect the close function to be called at * all. */ #define FF_CODEC_CAP_INIT_CLEANUP … /** * Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set * AVFrame.pkt_dts manually. If the flag is set, decode.c won't overwrite * this field. If it's unset, decode.c tries to guess the pkt_dts field * from the input AVPacket. */ #define FF_CODEC_CAP_SETS_PKT_DTS … /** * The decoder extracts and fills its parameters even if the frame is * skipped due to the skip_frame setting. */ #define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM … /** * The decoder sets the cropping fields in the output frames manually. * If this cap is set, the generic code will initialize output frame * dimensions to coded rather than display values. */ #define FF_CODEC_CAP_EXPORTS_CROPPING … /** * Codec initializes slice-based threading with a main function */ #define FF_CODEC_CAP_SLICE_THREAD_HAS_MF … /** * The decoder might make use of the ProgressFrame API. */ #define FF_CODEC_CAP_USES_PROGRESSFRAMES … /** * Codec handles avctx->thread_count == 0 (auto) internally. */ #define FF_CODEC_CAP_AUTO_THREADS … /** * Codec handles output frame properties internally instead of letting the * internal logic derive them from AVCodecInternal.last_pkt_props. */ #define FF_CODEC_CAP_SETS_FRAME_PROPS … /** * Codec supports embedded ICC profiles (AV_FRAME_DATA_ICC_PROFILE). */ #define FF_CODEC_CAP_ICC_PROFILES … /** * The encoder has AV_CODEC_CAP_DELAY set, but does not actually have delay - it * only wants to be flushed at the end to update some context variables (e.g. * 2pass stats) or produce a trailing packet. Besides that it immediately * produces exactly one output packet per each input frame, just as no-delay * encoders do. */ #define FF_CODEC_CAP_EOF_FLUSH … /** * FFCodec.codec_tags termination value */ #define FF_CODEC_TAGS_END … FFCodecDefault; struct AVCodecContext; struct AVSubtitle; struct AVPacket; enum FFCodecType { … }; FFCodec; #if CONFIG_SMALL #define CODEC_LONG_NAME … #else #define CODEC_LONG_NAME(str) … #endif #if HAVE_THREADS #define UPDATE_THREAD_CONTEXT(func) … #define UPDATE_THREAD_CONTEXT_FOR_USER(func) … #else #define UPDATE_THREAD_CONTEXT … #define UPDATE_THREAD_CONTEXT_FOR_USER … #endif #define FF_CODEC_DECODE_CB(func) … #define FF_CODEC_DECODE_SUB_CB(func) … #define FF_CODEC_RECEIVE_FRAME_CB(func) … #define FF_CODEC_ENCODE_CB(func) … #define FF_CODEC_ENCODE_SUB_CB(func) … #define FF_CODEC_RECEIVE_PACKET_CB(func) … static av_always_inline const FFCodec *ffcodec(const AVCodec *codec) { … } #endif /* AVCODEC_CODEC_INTERNAL_H */