Go to the documentation of this file.
21 #ifndef AVCODEC_CODEC_H
22 #define AVCODEC_CODEC_H
44 #define AV_CODEC_CAP_DRAW_HORIZ_BAND (1 << 0)
52 #define AV_CODEC_CAP_DR1 (1 << 1)
53 #if FF_API_FLAG_TRUNCATED
57 #define AV_CODEC_CAP_TRUNCATED (1 << 3)
82 #define AV_CODEC_CAP_DELAY (1 << 5)
87 #define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
100 #define AV_CODEC_CAP_SUBFRAMES (1 << 8)
105 #define AV_CODEC_CAP_EXPERIMENTAL (1 << 9)
109 #define AV_CODEC_CAP_CHANNEL_CONF (1 << 10)
113 #define AV_CODEC_CAP_FRAME_THREADS (1 << 12)
117 #define AV_CODEC_CAP_SLICE_THREADS (1 << 13)
121 #define AV_CODEC_CAP_PARAM_CHANGE (1 << 14)
127 #define AV_CODEC_CAP_OTHER_THREADS (1 << 15)
128 #if FF_API_AUTO_THREADS
129 #define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS
134 #define AV_CODEC_CAP_VARIABLE_FRAME_SIZE (1 << 16)
144 #define AV_CODEC_CAP_AVOID_PROBING (1 << 17)
146 #if FF_API_UNUSED_CODEC_CAPS
150 #define AV_CODEC_CAP_INTRA_ONLY 0x40000000
154 #define AV_CODEC_CAP_LOSSLESS 0x80000000
162 #define AV_CODEC_CAP_HARDWARE (1 << 18)
169 #define AV_CODEC_CAP_HYBRID (1 << 19)
176 #define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20)
183 #define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21)
317 int *got_frame_ptr,
struct AVPacket *avpkt);
AVPixelFormat
Pixel format.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
const char * long_name
Descriptive name for the codec, meant to be more human readable than name.
int methods
Bit set of AV_CODEC_HW_CONFIG_METHOD_* flags, describing the possible setup methods which can be used...
const AVClass * priv_class
AVClass for the private context.
int(* update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src)
Copy necessary context variables from a previous thread context to the current one.
static float sub(float src0, float src1)
const char * name
short name for the profile
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
const char * wrapper_name
Group name of the codec implementation.
const AVCodec * avcodec_find_encoder(enum AVCodecID id)
Find a registered encoder with a matching codec ID.
This structure describes decoded (raw) audio or video data.
int capabilities
Codec capabilities.
void(* flush)(struct AVCodecContext *)
Flush buffers.
uint8_t max_lowres
maximum value for lowres supported by the decoder
enum AVSampleFormat * sample_fmts
array of supported sample formats, or NULL if unknown, array is terminated by -1
const char * bsfs
Decoding only, a comma-separated list of bitstream filters to apply to packets before decoding.
int(* encode_sub)(struct AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
const int * supported_samplerates
array of supported audio samplerates, or NULL if unknown, array is terminated by 0
@ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
The codec supports this format via the hw_frames_ctx interface.
const AVRational * supported_framerates
array of supported framerates, or NULL if any, array is terminated by {0,0}
enum AVPixelFormat pix_fmt
For decoders, a hardware pixel format which that decoder may be able to decode to if suitable hardwar...
Describe the class of an AVClass context structure.
const AVCodec * avcodec_find_decoder_by_name(const char *name)
Find a registered decoder with the specified name.
Rational number (pair of numerator and denominator).
@ AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX
The codec supports this format via the hw_device_ctx interface.
const AVProfile * profiles
array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
@ AV_CODEC_HW_CONFIG_METHOD_INTERNAL
The codec supports this format by some internal method.
AVCodecID
Identify the syntax and semantics of the bitstream.
const AVCodec * avcodec_find_decoder(enum AVCodecID id)
Find a registered decoder with a matching codec ID.
int av_codec_is_decoder(const AVCodec *codec)
int(* close)(struct AVCodecContext *)
int(* update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src)
Copy variables back to the user-facing context.
const AVCodecDefault * defaults
Private codec-specific defaults.
int(* encode2)(struct AVCodecContext *avctx, struct AVPacket *avpkt, const struct AVFrame *frame, int *got_packet_ptr)
Encode data to an AVPacket.
int(* receive_packet)(struct AVCodecContext *avctx, struct AVPacket *avpkt)
Encode API with decoupled frame/packet dataflow.
void(* init_static_data)(struct AVCodec *codec)
Initialize codec static data, called from av_codec_iterate().
int(* receive_frame)(struct AVCodecContext *avctx, struct AVFrame *frame)
Decode API with decoupled packet/frame dataflow.
int av_codec_is_encoder(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...
const char * av_get_profile_name(const AVCodec *codec, int profile)
Return a name for the specified profile, if available.
@ AV_CODEC_HW_CONFIG_METHOD_AD_HOC
The codec supports this format by some ad-hoc method.
AVSampleFormat
Audio sample formats.
const char * name
Name of the codec implementation.
const AVCodec * av_codec_iterate(void **opaque)
Iterate over all registered codecs.
int caps_internal
Internal codec capabilities.
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
const uint32_t * codec_tags
List of supported codec_tags, terminated by FF_CODEC_TAGS_END.
main external API structure.
const AVCodecHWConfig * avcodec_get_hw_config(const AVCodec *codec, int index)
Retrieve supported hardware configurations for a codec.
This structure stores compressed data.
int(* init)(struct AVCodecContext *)
int(* decode)(struct AVCodecContext *avctx, void *outdata, int *got_frame_ptr, struct AVPacket *avpkt)
Decode picture or subtitle data.
enum AVHWDeviceType device_type
The device type associated with the configuration.
const uint64_t * channel_layouts
array of support channel layouts, or NULL if unknown. array is terminated by 0
const AVCodec * avcodec_find_encoder_by_name(const char *name)
Find a registered encoder with the specified name.