Go to the documentation of this file.
19 #ifndef AVCODEC_CODEC_INTERNAL_H
20 #define AVCODEC_CODEC_INTERNAL_H
35 #define FF_CODEC_CAP_NOT_INIT_THREADSAFE (1 << 0)
43 #define FF_CODEC_CAP_INIT_CLEANUP (1 << 1)
50 #define FF_CODEC_CAP_SETS_PKT_DTS (1 << 2)
55 #define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM (1 << 3)
61 #define FF_CODEC_CAP_EXPORTS_CROPPING (1 << 4)
65 #define FF_CODEC_CAP_SLICE_THREAD_HAS_MF (1 << 5)
69 #define FF_CODEC_CAP_USES_PROGRESSFRAMES (1 << 6)
73 #define FF_CODEC_CAP_AUTO_THREADS (1 << 7)
78 #define FF_CODEC_CAP_SETS_FRAME_PROPS (1 << 8)
82 #define FF_CODEC_CAP_ICC_PROFILES (1 << 9)
90 #define FF_CODEC_CAP_EOF_FLUSH (1 << 10)
95 #define FF_CODEC_TAGS_END -1
192 int *got_frame_ptr,
struct AVPacket *avpkt);
200 int *got_frame_ptr,
const struct AVPacket *avpkt);
275 const void **out_configs,
276 int *out_num_configs);
290 const void **out_configs,
291 int *out_num_configs);
294 #define CODEC_LONG_NAME(str) .p.long_name = NULL
296 #define CODEC_LONG_NAME(str) .p.long_name = str
300 #define UPDATE_THREAD_CONTEXT(func) \
301 .update_thread_context = (func)
302 #define UPDATE_THREAD_CONTEXT_FOR_USER(func) \
303 .update_thread_context_for_user = (func)
305 #define UPDATE_THREAD_CONTEXT(func) \
306 .update_thread_context = NULL
307 #define UPDATE_THREAD_CONTEXT_FOR_USER(func) \
308 .update_thread_context_for_user = NULL
311 #define FF_CODEC_DECODE_CB(func) \
312 .cb_type = FF_CODEC_CB_TYPE_DECODE, \
314 #define FF_CODEC_DECODE_SUB_CB(func) \
315 .cb_type = FF_CODEC_CB_TYPE_DECODE_SUB, \
316 .cb.decode_sub = (func)
317 #define FF_CODEC_RECEIVE_FRAME_CB(func) \
318 .cb_type = FF_CODEC_CB_TYPE_RECEIVE_FRAME, \
319 .cb.receive_frame = (func)
320 #define FF_CODEC_ENCODE_CB(func) \
321 .cb_type = FF_CODEC_CB_TYPE_ENCODE, \
323 #define FF_CODEC_ENCODE_SUB_CB(func) \
324 .cb_type = FF_CODEC_CB_TYPE_ENCODE_SUB, \
325 .cb.encode_sub = (func)
326 #define FF_CODEC_RECEIVE_PACKET_CB(func) \
327 .cb_type = FF_CODEC_CB_TYPE_RECEIVE_PACKET, \
328 .cb.receive_packet = (func)
int(* update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src)
Copy necessary context variables from a previous thread context to the current one.
int(* receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame)
Decode API with decoupled packet/frame dataflow.
const FFCodecDefault * defaults
Private codec-specific defaults.
@ FF_CODEC_CB_TYPE_RECEIVE_PACKET
This structure describes decoded (raw) audio or video data.
int(* encode)(struct AVCodecContext *avctx, struct AVPacket *avpkt, const struct AVFrame *frame, int *got_packet_ptr)
Encode data to an AVPacket.
@ FF_CODEC_CB_TYPE_ENCODE_SUB
AVCodec p
The public AVCodec.
@ FF_CODEC_CB_TYPE_DECODE
int(* update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src)
Copy variables back to the user-facing context.
@ FF_CODEC_CB_TYPE_ENCODE
void(* flush)(struct AVCodecContext *)
Flush buffers.
int(* encode_sub)(struct AVCodecContext *avctx, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
Encode subtitles to a raw buffer.
int(* decode)(struct AVCodecContext *avctx, struct AVFrame *frame, int *got_frame_ptr, struct AVPacket *avpkt)
Decode to an AVFrame.
int(* init)(struct AVCodecContext *)
unsigned color_ranges
This field determines the video color ranges supported by an encoder.
@ FF_CODEC_CB_TYPE_DECODE_SUB
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
int(* receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt)
Encode API with decoupled frame/packet dataflow.
static const av_always_inline FFCodec * ffcodec(const AVCodec *codec)
const struct AVCodecHWConfigInternal *const * hw_configs
Array of pointers to hardware configurations supported by the codec, or NULL if no hardware supported...
unsigned caps_internal
Internal codec capabilities FF_CODEC_CAP_*.
int ff_default_get_supported_config(const AVCodecContext *avctx, const AVCodec *codec, enum AVCodecConfig config, unsigned flags, const void **out_configs, int *out_num_configs)
Default implementation for avcodec_get_supported_config().
int(* decode_sub)(struct AVCodecContext *avctx, struct AVSubtitle *sub, int *got_frame_ptr, const struct AVPacket *avpkt)
Decode subtitle data to an AVSubtitle.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
main external API structure.
const uint32_t * codec_tags
List of supported codec_tags, terminated by FF_CODEC_TAGS_END.
@ FF_CODEC_CB_TYPE_RECEIVE_FRAME
unsigned cb_type
This field determines the type of the codec (decoder/encoder) and also the exact callback cb implemen...
int(* close)(struct AVCodecContext *)
const char * bsfs
Decoding only, a comma-separated list of bitstream filters to apply to packets before decoding.
int(* get_supported_config)(const AVCodecContext *avctx, const AVCodec *codec, enum AVCodecConfig config, unsigned flags, const void **out_configs, int *out_num_configs)
Custom callback for avcodec_get_supported_config().
This structure stores compressed data.
#define flags(name, subs,...)