FFmpeg  4.0
Data Fields
AVCodec Struct Reference

AVCodec. More...

#include <libavcodec/avcodec.h>

Data Fields

const char * name
 Name of the codec implementation. More...
 
const char * long_name
 Descriptive name for the codec, meant to be more human readable than name. More...
 
enum AVMediaType type
 
enum AVCodecID id
 
int capabilities
 Codec capabilities. More...
 
const AVRationalsupported_framerates
 array of supported framerates, or NULL if any, array is terminated by {0,0} More...
 
enum AVPixelFormatpix_fmts
 array of supported pixel formats, or NULL if unknown, array is terminated by -1 More...
 
const intsupported_samplerates
 array of supported audio samplerates, or NULL if unknown, array is terminated by 0 More...
 
enum AVSampleFormatsample_fmts
 array of supported sample formats, or NULL if unknown, array is terminated by -1 More...
 
const uint64_t * channel_layouts
 array of support channel layouts, or NULL if unknown. array is terminated by 0 More...
 
uint8_t max_lowres
 maximum value for lowres supported by the decoder More...
 
const AVClasspriv_class
 AVClass for the private context. More...
 
const AVProfileprofiles
 array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} More...
 
const char * wrapper_name
 Group name of the codec implementation. More...
 
int priv_data_size
 
struct AVCodecnext
 
const AVCodecDefaultdefaults
 Private codec-specific defaults. More...
 
void(* init_static_data )(struct AVCodec *codec)
 Initialize codec static data, called from avcodec_register(). More...
 
int(* init )(AVCodecContext *)
 
int(* encode_sub )(AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)
 
int(* encode2 )(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 Encode data to an AVPacket. More...
 
int(* decode )(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt)
 
int(* close )(AVCodecContext *)
 
int(* send_frame )(AVCodecContext *avctx, const AVFrame *frame)
 Encode API with decoupled packet/frame dataflow. More...
 
int(* receive_packet )(AVCodecContext *avctx, AVPacket *avpkt)
 
int(* receive_frame )(AVCodecContext *avctx, AVFrame *frame)
 Decode API with decoupled packet/frame dataflow. More...
 
void(* flush )(AVCodecContext *)
 Flush buffers. More...
 
int caps_internal
 Internal codec capabilities. More...
 
const char * bsfs
 Decoding only, a comma-separated list of bitstream filters to apply to packets before decoding. More...
 
const struct AVCodecHWConfigInternal ** hw_configs
 Array of pointers to hardware configurations supported by the codec, or NULL if no hardware supported. More...
 
Frame-level threading support functions
int(* init_thread_copy )(AVCodecContext *)
 If defined, called on thread contexts when they are created. More...
 
int(* update_thread_context )(AVCodecContext *dst, const AVCodecContext *src)
 Copy necessary context variables from a previous thread context to the current one. More...
 

Detailed Description

AVCodec.

Examples:
decode_audio.c, decode_video.c, demuxing_decoding.c, encode_audio.c, encode_video.c, filtering_audio.c, filtering_video.c, hw_decode.c, muxing.c, qsvdec.c, transcode_aac.c, transcoding.c, vaapi_encode.c, and vaapi_transcode.c.

Definition at line 3408 of file avcodec.h.

Field Documentation

◆ name

const char* AVCodec::name

◆ long_name

const char* AVCodec::long_name

Descriptive name for the codec, meant to be more human readable than name.

You should use the NULL_IF_CONFIG_SMALL() macro to define it.

Definition at line 3420 of file avcodec.h.

Referenced by print_codec(), and print_codecs().

◆ type

enum AVMediaType AVCodec::type

◆ id

enum AVCodecID AVCodec::id

◆ capabilities

int AVCodec::capabilities

◆ supported_framerates

const AVRational* AVCodec::supported_framerates

array of supported framerates, or NULL if any, array is terminated by {0,0}

Definition at line 3428 of file avcodec.h.

Referenced by print_codec().

◆ pix_fmts

enum AVPixelFormat* AVCodec::pix_fmts

array of supported pixel formats, or NULL if unknown, array is terminated by -1

Examples:
transcoding.c.

Definition at line 3429 of file avcodec.h.

Referenced by av1_init_static(), avcodec_open2(), choose_pixel_fmt(), ff_vp9_init_static(), ffmmal_init_decoder(), get_pixel_format(), h263_get_format(), libx265_encode_init_csp(), open_output_file(), vc1_decode_init(), and X264_init_static().

◆ supported_samplerates

const int* AVCodec::supported_samplerates

array of supported audio samplerates, or NULL if unknown, array is terminated by 0

Examples:
encode_audio.c.

Definition at line 3430 of file avcodec.h.

Referenced by avcodec_open2(), sbc_encode_init(), and select_sample_rate().

◆ sample_fmts

enum AVSampleFormat* AVCodec::sample_fmts

array of supported sample formats, or NULL if unknown, array is terminated by -1

Examples:
encode_audio.c, transcode_aac.c, and transcoding.c.

Definition at line 3431 of file avcodec.h.

Referenced by avcodec_open2(), check_sample_fmt(), choose_sample_fmt(), main(), open_output_file(), and pcm_decode_init().

◆ channel_layouts

const uint64_t* AVCodec::channel_layouts

array of support channel layouts, or NULL if unknown. array is terminated by 0

Examples:
encode_audio.c.

Definition at line 3432 of file avcodec.h.

Referenced by avcodec_open2(), and select_channel_layout().

◆ max_lowres

uint8_t AVCodec::max_lowres

maximum value for lowres supported by the decoder

Definition at line 3433 of file avcodec.h.

Referenced by av_codec_get_max_lowres(), avcodec_open2(), and stream_component_open().

◆ priv_class

const AVClass* AVCodec::priv_class

◆ profiles

const AVProfile* AVCodec::profiles

array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}

Definition at line 3435 of file avcodec.h.

Referenced by av_get_profile_name().

◆ wrapper_name

const char* AVCodec::wrapper_name

Group name of the codec implementation.

This is a short symbolic name of the wrapper backing this codec. A wrapper uses some kind of external implementation for the codec, such as an external library, or a codec implementation provided by the OS or the hardware. If this field is NULL, this is a builtin, libavcodec native codec. If non-NULL, this will be the suffix in AVCodec.name in most cases (usually AVCodec.name will be of the form "<codec_name>_<wrapper_name>").

Definition at line 3447 of file avcodec.h.

◆ priv_data_size

int AVCodec::priv_data_size

◆ next

struct AVCodec* AVCodec::next

Definition at line 3457 of file avcodec.h.

Referenced by av_codec_init_next(), and av_codec_next().

◆ init_thread_copy

int(* AVCodec::init_thread_copy) (AVCodecContext *)

If defined, called on thread contexts when they are created.

If the codec allocates writable tables in init(), re-allocate them here. priv_data will be set to a copy of the original.

Definition at line 3467 of file avcodec.h.

Referenced by ff_frame_thread_init().

◆ update_thread_context

int(* AVCodec::update_thread_context) (AVCodecContext *dst, const AVCodecContext *src)

Copy necessary context variables from a previous thread context to the current one.

If not defined, the next thread will start automatically; otherwise, the codec must call ff_thread_finish_setup().

dst and src will (rarely) point to the same context, in which case memcpy should be skipped.

Definition at line 3475 of file avcodec.h.

Referenced by ff_thread_can_start_frame(), frame_worker_thread(), hap_decode(), thread_get_buffer_internal(), and update_context_from_thread().

◆ defaults

const AVCodecDefault* AVCodec::defaults

Private codec-specific defaults.

Definition at line 3481 of file avcodec.h.

Referenced by init_context_defaults(), and init_output_stream().

◆ init_static_data

void(* AVCodec::init_static_data) (struct AVCodec *codec)

Initialize codec static data, called from avcodec_register().

This is not intended for time consuming operations as it is run for every codec regardless of that codec being used.

Definition at line 3489 of file avcodec.h.

Referenced by av_codec_init_static().

◆ init

int(* AVCodec::init) (AVCodecContext *)

◆ encode_sub

int(* AVCodec::encode_sub) (AVCodecContext *, uint8_t *buf, int buf_size, const struct AVSubtitle *sub)

Definition at line 3492 of file avcodec.h.

Referenced by av_codec_is_encoder(), and avcodec_encode_subtitle().

◆ encode2

int(* AVCodec::encode2) (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)

Encode data to an AVPacket.

Parameters
avctxcodec context
avpktoutput AVPacket (may contain a user-provided buffer)
[in]frameAVFrame containing the raw data to be encoded
[out]got_packet_ptrencoder sets to 0 or 1 to indicate that a non-empty packet was returned in avpkt.
Returns
0 on success, negative error code on failure

Definition at line 3504 of file avcodec.h.

Referenced by av_codec_is_encoder(), avcodec_encode_audio2(), and avcodec_encode_video2().

◆ decode

int(* AVCodec::decode) (AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt)

◆ close

int(* AVCodec::close) (AVCodecContext *)

Definition at line 3507 of file avcodec.h.

Referenced by avcodec_close(), avcodec_open2(), and ff_frame_thread_free().

◆ send_frame

int(* AVCodec::send_frame) (AVCodecContext *avctx, const AVFrame *frame)

Encode API with decoupled packet/frame dataflow.

The API is the same as the avcodec_ prefixed APIs (avcodec_send_frame() etc.), except that:

  • never called if the codec is closed or the wrong type,
  • if AV_CODEC_CAP_DELAY is not set, drain frames are never sent,
  • only one drain frame is ever passed down,

Definition at line 3516 of file avcodec.h.

Referenced by av_codec_is_encoder(), and avcodec_send_frame().

◆ receive_packet

int(* AVCodec::receive_packet) (AVCodecContext *avctx, AVPacket *avpkt)

Definition at line 3517 of file avcodec.h.

Referenced by avcodec_receive_packet().

◆ receive_frame

int(* AVCodec::receive_frame) (AVCodecContext *avctx, AVFrame *frame)

Decode API with decoupled packet/frame dataflow.

This function is called to get one output frame. It should call ff_decode_get_packet() to obtain input data.

Definition at line 3524 of file avcodec.h.

Referenced by av_codec_is_decoder(), decode_receive_frame_internal(), and ff_decode_get_packet().

◆ flush

void(* AVCodec::flush) (AVCodecContext *)

Flush buffers.

Will be called when seeking

Definition at line 3529 of file avcodec.h.

Referenced by avcodec_flush_buffers(), and ff_thread_flush().

◆ caps_internal

int AVCodec::caps_internal

Internal codec capabilities.

See FF_CODEC_CAP_* in internal.h

Definition at line 3534 of file avcodec.h.

Referenced by avcodec_open2(), avpriv_codec_get_cap_skip_frame_fill_param(), decode_simple_internal(), ff_lock_avcodec(), ff_slice_thread_init(), ff_unlock_avcodec(), and get_buffer_internal().

◆ bsfs

const char* AVCodec::bsfs

Decoding only, a comma-separated list of bitstream filters to apply to packets before decoding.

Definition at line 3540 of file avcodec.h.

Referenced by bsfs_init(), and compat_decode().

◆ hw_configs

const struct AVCodecHWConfigInternal** AVCodec::hw_configs

Array of pointers to hardware configurations supported by the codec, or NULL if no hardware supported.

The array is terminated by a NULL pointer.

The user can only access this field via avcodec_get_hw_config().

Definition at line 3549 of file avcodec.h.

Referenced by avcodec_default_get_format(), avcodec_get_hw_config(), avcodec_get_hw_frames_parameters(), and ff_get_format().


The documentation for this struct was generated from the following file: