Struct AVCodecParameters

#[repr(C)]
pub struct AVCodecParameters {
Show 31 fields pub codec_type: i32, pub codec_id: u32, pub codec_tag: u32, pub extradata: *mut u8, pub extradata_size: i32, pub coded_side_data: *mut AVPacketSideData, pub nb_coded_side_data: i32, pub format: i32, pub bit_rate: i64, pub bits_per_coded_sample: i32, pub bits_per_raw_sample: i32, pub profile: i32, pub level: i32, pub width: i32, pub height: i32, pub sample_aspect_ratio: AVRational, pub framerate: AVRational, pub field_order: u32, pub color_range: u32, pub color_primaries: u32, pub color_trc: u32, pub color_space: u32, pub chroma_location: u32, pub video_delay: i32, pub ch_layout: AVChannelLayout, pub sample_rate: i32, pub block_align: i32, pub frame_size: i32, pub initial_padding: i32, pub trailing_padding: i32, pub seek_preroll: i32,
}
Expand description

This struct describes the properties of an encoded stream.

sizeof(AVCodecParameters) is not a part of the public ABI, this struct must be allocated with avcodec_parameters_alloc() and freed with avcodec_parameters_free().

Fields§

§codec_type: i32

General type of the encoded data.

§codec_id: u32

Specific type of the encoded data (the codec used).

§codec_tag: u32

Additional information about the codec (corresponds to the AVI FOURCC).

§extradata: *mut u8

Extra binary data needed for initializing the decoder, codec-dependent.

Must be allocated with av_malloc() and will be freed by avcodec_parameters_free(). The allocated size of extradata must be at least extradata_size + AV_INPUT_BUFFER_PADDING_SIZE, with the padding bytes zeroed.

§extradata_size: i32

Size of the extradata content in bytes.

§coded_side_data: *mut AVPacketSideData

Additional data associated with the entire stream.

Should be allocated with av_packet_side_data_new() or av_packet_side_data_add(), and will be freed by avcodec_parameters_free().

§nb_coded_side_data: i32

Amount of entries in @ref coded_side_data.

§format: i32
  • video: the pixel format, the value corresponds to enum AVPixelFormat.
  • audio: the sample format, the value corresponds to enum AVSampleFormat.
§bit_rate: i64

The average bitrate of the encoded data (in bits per second).

§bits_per_coded_sample: i32

The number of bits per sample in the codedwords.

This is basically the bitrate per sample. It is mandatory for a bunch of formats to actually decode them. It’s the number of bits for one sample in the actual coded bitstream.

This could be for example 4 for ADPCM For PCM formats this matches bits_per_raw_sample Can be 0

§bits_per_raw_sample: i32

This is the number of valid bits in each output sample. If the sample format has more bits, the least significant bits are additional padding bits, which are always 0. Use right shifts to reduce the sample to its actual size. For example, audio formats with 24 bit samples will have bits_per_raw_sample set to 24, and format set to AV_SAMPLE_FMT_S32. To get the original sample use “(int32_t)sample >> 8”.“

For ADPCM this might be 12 or 16 or similar Can be 0

§profile: i32

Codec-specific bitstream restrictions that the stream conforms to.

§level: i32§width: i32

Video only. The dimensions of the video frame in pixels.

§height: i32§sample_aspect_ratio: AVRational

Video only. The aspect ratio (width / height) which a single pixel should have when displayed.

When the aspect ratio is unknown / undefined, the numerator should be set to 0 (the denominator may have any value).

§framerate: AVRational

Video only. Number of frames per second, for streams with constant frame durations. Should be set to { 0, 1 } when some frames have differing durations or if the value is not known.

@note This field correponds to values that are stored in codec-level headers and is typically overridden by container/transport-layer timestamps, when available. It should thus be used only as a last resort, when no higher-level timing information is available.

§field_order: u32

Video only. The order of the fields in interlaced video.

§color_range: u32

Video only. Additional colorspace characteristics.

§color_primaries: u32§color_trc: u32§color_space: u32§chroma_location: u32§video_delay: i32

Video only. Number of delayed frames.

§ch_layout: AVChannelLayout

Audio only. The channel layout and number of channels.

§sample_rate: i32

Audio only. The number of audio samples per second.

§block_align: i32

Audio only. The number of bytes per coded audio frame, required by some formats.

Corresponds to nBlockAlign in WAVEFORMATEX.

§frame_size: i32

Audio only. Audio frame size, if known. Required by some formats to be static.

§initial_padding: i32

Audio only. The amount of padding (in samples) inserted by the encoder at the beginning of the audio. I.e. this number of leading decoded samples must be discarded by the caller to get the original audio without leading padding.

§trailing_padding: i32

Audio only. The amount of padding (in samples) appended by the encoder to the end of the audio. I.e. this number of decoded samples must be discarded by the caller from the end of the stream to get the original audio without any trailing padding.

§seek_preroll: i32

Audio only. Number of samples to skip after a discontinuity.

Trait Implementations§

§

impl Clone for AVCodecParameters

§

fn clone(&self) -> AVCodecParameters

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
§

impl Debug for AVCodecParameters

§

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

Formats the value using the given formatter. Read more
§

impl Copy for AVCodecParameters

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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,

Source§

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>,

Source§

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>,

Source§

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more