Struct ffmpeg_sys_next::AVCodecParameters
source · [−]#[repr(C)]pub struct AVCodecParameters {Show 29 fields
pub codec_type: AVMediaType,
pub codec_id: AVCodecID,
pub codec_tag: u32,
pub extradata: *mut u8,
pub extradata_size: c_int,
pub format: c_int,
pub bit_rate: i64,
pub bits_per_coded_sample: c_int,
pub bits_per_raw_sample: c_int,
pub profile: c_int,
pub level: c_int,
pub width: c_int,
pub height: c_int,
pub sample_aspect_ratio: AVRational,
pub field_order: AVFieldOrder,
pub color_range: AVColorRange,
pub color_primaries: AVColorPrimaries,
pub color_trc: AVColorTransferCharacteristic,
pub color_space: AVColorSpace,
pub chroma_location: AVChromaLocation,
pub video_delay: c_int,
pub channel_layout: u64,
pub channels: c_int,
pub sample_rate: c_int,
pub block_align: c_int,
pub frame_size: c_int,
pub initial_padding: c_int,
pub trailing_padding: c_int,
pub seek_preroll: c_int,
}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: AVMediaTypeGeneral type of the encoded data.
codec_id: AVCodecIDSpecific type of the encoded data (the codec used).
codec_tag: u32Additional information about the codec (corresponds to the AVI FOURCC).
extradata: *mut u8Extra 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: c_intSize of the extradata content in bytes.
format: c_int- video: the pixel format, the value corresponds to enum AVPixelFormat.
- audio: the sample format, the value corresponds to enum AVSampleFormat.
bit_rate: i64The average bitrate of the encoded data (in bits per second).
bits_per_coded_sample: c_intThe 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: c_intThis 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: c_intCodec-specific bitstream restrictions that the stream conforms to.
level: c_intwidth: c_intVideo only. The dimensions of the video frame in pixels.
height: c_intsample_aspect_ratio: AVRationalVideo 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).
field_order: AVFieldOrderVideo only. The order of the fields in interlaced video.
color_range: AVColorRangeVideo only. Additional colorspace characteristics.
color_primaries: AVColorPrimariescolor_trc: AVColorTransferCharacteristiccolor_space: AVColorSpacechroma_location: AVChromaLocationvideo_delay: c_intVideo only. Number of delayed frames.
channel_layout: u64Audio only. The channel layout bitmask. May be 0 if the channel layout is unknown or unspecified, otherwise the number of bits set must be equal to the channels field.
channels: c_intAudio only. The number of audio channels.
sample_rate: c_intAudio only. The number of audio samples per second.
block_align: c_intAudio only. The number of bytes per coded audio frame, required by some formats.
Corresponds to nBlockAlign in WAVEFORMATEX.
frame_size: c_intAudio only. Audio frame size, if known. Required by some formats to be static.
initial_padding: c_intAudio 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: c_intAudio 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: c_intAudio only. Number of samples to skip after a discontinuity.
Trait Implementations
sourceimpl Clone for AVCodecParameters
impl Clone for AVCodecParameters
sourcefn clone(&self) -> AVCodecParameters
fn clone(&self) -> AVCodecParameters
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for AVCodecParameters
impl Debug for AVCodecParameters
sourceimpl PartialEq<AVCodecParameters> for AVCodecParameters
impl PartialEq<AVCodecParameters> for AVCodecParameters
sourcefn eq(&self, other: &AVCodecParameters) -> bool
fn eq(&self, other: &AVCodecParameters) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &AVCodecParameters) -> bool
fn ne(&self, other: &AVCodecParameters) -> bool
This method tests for !=.
impl Copy for AVCodecParameters
impl Eq for AVCodecParameters
impl StructuralEq for AVCodecParameters
impl StructuralPartialEq for AVCodecParameters
Auto Trait Implementations
impl RefUnwindSafe for AVCodecParameters
impl !Send for AVCodecParameters
impl !Sync for AVCodecParameters
impl Unpin for AVCodecParameters
impl UnwindSafe for AVCodecParameters
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more