#[repr(C)]
pub struct AVCodec {
Show 31 fields pub name: *const c_char, pub long_name: *const c_char, pub type_: AVMediaType, pub id: AVCodecID, pub capabilities: c_int, pub supported_framerates: *const AVRational, pub pix_fmts: *const AVPixelFormat, pub supported_samplerates: *const c_int, pub sample_fmts: *const AVSampleFormat, pub channel_layouts: *const u64, pub max_lowres: u8, pub priv_class: *const AVClass, pub profiles: *const AVProfile, pub wrapper_name: *const c_char, pub priv_data_size: c_int, pub next: *mut AVCodec, pub update_thread_context: Option<unsafe extern "C" fn(dst: *mut AVCodecContext, src: *const AVCodecContext) -> c_int>, pub defaults: *const AVCodecDefault, pub init_static_data: Option<unsafe extern "C" fn(codec: *mut AVCodec)>, pub init: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext) -> c_int>, pub encode_sub: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext, buf: *mut u8, buf_size: c_int, sub: *const AVSubtitle) -> c_int>, pub encode2: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, avpkt: *mut AVPacket, frame: *const AVFrame, got_packet_ptr: *mut c_int) -> c_int>, pub decode: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, outdata: *mut c_void, got_frame_ptr: *mut c_int, avpkt: *mut AVPacket) -> c_int>, pub close: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext) -> c_int>, pub receive_packet: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, avpkt: *mut AVPacket) -> c_int>, pub receive_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, frame: *mut AVFrame) -> c_int>, pub flush: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext)>, pub caps_internal: c_int, pub bsfs: *const c_char, pub hw_configs: *const *mut AVCodecHWConfigInternal, pub codec_tags: *const u32,
}
Expand description

AVCodec.

Fields§

§name: *const c_char

Name of the codec implementation. The name is globally unique among encoders and among decoders (but an encoder and a decoder can share the same name). This is the primary way to find a codec from the user perspective.

§long_name: *const c_char

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.

§type_: AVMediaType§id: AVCodecID§capabilities: c_int

Codec capabilities. see AV_CODEC_CAP_*

§supported_framerates: *const AVRational

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

§pix_fmts: *const AVPixelFormat

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

§supported_samplerates: *const c_int

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

§sample_fmts: *const AVSampleFormat

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

§channel_layouts: *const u64

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

§max_lowres: u8

< maximum value for lowres supported by the decoder

§priv_class: *const AVClass

< AVClass for the private context

§profiles: *const AVProfile

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

§wrapper_name: *const c_char

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>”).

§priv_data_size: c_int

No fields below this line are part of the public API. They may not be used outside of libavcodec and can be changed and removed at will. New public fields should be added right above.

§next: *mut AVCodec§update_thread_context: Option<unsafe extern "C" fn(dst: *mut AVCodecContext, src: *const AVCodecContext) -> c_int>

@name Frame-level threading support functions @{ / /** 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.

§defaults: *const AVCodecDefault

Private codec-specific defaults.

§init_static_data: Option<unsafe extern "C" fn(codec: *mut AVCodec)>

Initialize codec static data, called from av_codec_iterate().

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

§init: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext) -> c_int>§encode_sub: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext, buf: *mut u8, buf_size: c_int, sub: *const AVSubtitle) -> c_int>§encode2: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, avpkt: *mut AVPacket, frame: *const AVFrame, got_packet_ptr: *mut c_int) -> c_int>

Encode data to an AVPacket.

@param avctx codec context @param avpkt output AVPacket @param[in] frame AVFrame containing the raw data to be encoded @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a non-empty packet was returned in avpkt. @return 0 on success, negative error code on failure

§decode: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, outdata: *mut c_void, got_frame_ptr: *mut c_int, avpkt: *mut AVPacket) -> c_int>

Decode picture or subtitle data.

@param avctx codec context @param outdata codec type dependent output struct @param[out] got_frame_ptr decoder sets to 0 or 1 to indicate that a non-empty frame or subtitle was returned in outdata. @param[in] avpkt AVPacket containing the data to be decoded @return amount of bytes read from the packet on success, negative error code on failure

§close: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext) -> c_int>§receive_packet: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, avpkt: *mut AVPacket) -> c_int>

Encode API with decoupled frame/packet dataflow. This function is called to get one output packet. It should call ff_encode_get_frame() to obtain input data.

§receive_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, frame: *mut AVFrame) -> c_int>

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.

§flush: Option<unsafe extern "C" fn(arg1: *mut AVCodecContext)>

Flush buffers. Will be called when seeking

§caps_internal: c_int

Internal codec capabilities. See FF_CODEC_CAP_* in internal.h

§bsfs: *const c_char

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

§hw_configs: *const *mut AVCodecHWConfigInternal

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().

§codec_tags: *const u32

List of supported codec_tags, terminated by FF_CODEC_TAGS_END.

Trait Implementations§

source§

impl Clone for AVCodec

source§

fn clone(&self) -> AVCodec

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AVCodec

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for AVCodec

source§

fn eq(&self, other: &AVCodec) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for AVCodec

source§

impl Eq for AVCodec

source§

impl StructuralPartialEq for AVCodec

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.