跳到主要内容

AVStream

搜索

结构体 AVStream 

源代码
#[repr(C)]
pub struct AVStream {
Show 18 fields pub av_class: *const AVClass, pub index: c_int, pub id: c_int, pub codecpar: *mut AVCodecParameters, pub priv_data: *mut c_void, pub time_base: AVRational, pub start_time: i64, pub duration: i64, pub nb_frames: i64, pub disposition: c_int, pub discard: AVDiscard, pub sample_aspect_ratio: AVRational, pub metadata: *mut AVDictionary, pub avg_frame_rate: AVRational, pub attached_pic: AVPacket, pub event_flags: c_int, pub r_frame_rate: AVRational, pub pts_wrap_bits: c_int,
}
展开描述

Stream structure. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVStream) must not be used outside libav*.

Fields§

§av_class: *const AVClass

A class for @ref avoptions. Set on stream creation.

§index: c_int

< stream index in AVFormatContext

§id: c_int

Format-specific stream ID. decoding: set by libavformat encoding: set by the user, replaced by libavformat if left unset

§codecpar: *mut AVCodecParameters

Codec parameters associated with this stream. Allocated and freed by libavformat in avformat_new_stream() and avformat_free_context() respectively.

  • demuxing: filled by libavformat on stream creation or in avformat_find_stream_info()
  • muxing: filled by the caller before avformat_write_header()
§priv_data: *mut c_void§time_base: AVRational

This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.

decoding: set by libavformat encoding: May be set by the caller before avformat_write_header() to provide a hint to the muxer about the desired timebase. In avformat_write_header(), the muxer will overwrite this field with the timebase that will actually be used for the timestamps written into the file (which may or may not be related to the user-provided one, depending on the format).

§start_time: i64

Decoding: pts of the first frame of the stream in presentation order, in stream time base. Only set this if you are absolutely 100% sure that the value you set it to really is the pts of the first frame. This may be undefined (AV_NOPTS_VALUE). @note The ASF header does NOT contain a correct start_time the ASF demuxer must NOT set this.

§duration: i64

Decoding: duration of the stream, in stream time base. If a source file does not specify a duration, but does specify a bitrate, this value will be estimated from bitrate and file size.

Encoding: May be set by the caller before avformat_write_header() to provide a hint to the muxer about the estimated duration.

§nb_frames: i64

< number of frames in this stream if known or 0

§disposition: c_int

Stream disposition - a combination of AV_DISPOSITION_* flags.

  • demuxing: set by libavformat when creating the stream or in avformat_find_stream_info().
  • muxing: may be set by the caller before avformat_write_header().
§discard: AVDiscard

< Selects which packets can be discarded at will and do not need to be demuxed.

§sample_aspect_ratio: AVRational

sample aspect ratio (0 if unknown)

  • encoding: Set by user.
  • decoding: Set by libavformat.
§metadata: *mut AVDictionary§avg_frame_rate: AVRational

Average framerate

  • demuxing: May be set by libavformat when creating the stream or in avformat_find_stream_info().
  • muxing: May be set by the caller before avformat_write_header().
§attached_pic: AVPacket

For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet will contain the attached picture.

decoding: set by libavformat, must not be modified by the caller. encoding: unused

§event_flags: c_int

Flags indicating events happening on the stream, a combination of AVSTREAM_EVENT_FLAG_*.

  • demuxing: may be set by the demuxer in avformat_open_input(), avformat_find_stream_info() and av_read_frame(). Flags must be cleared by the user once the event has been handled.
  • muxing: may be set by the user after avformat_write_header(). to indicate a user-triggered event. The muxer will clear the flags for events it has handled in av_[interleaved]_write_frame().
§r_frame_rate: AVRational

Real base framerate of the stream. This is the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream). Note, this value is just a guess! For example, if the time base is 1/90000 and all frames have either approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1.

§pts_wrap_bits: c_int

Number of bits in timestamps. Used for wrapping control.

  • demuxing: set by libavformat
  • muxing: set by libavformat

trait 实现§

源代码§

impl Clone for AVStream

源代码§

fn clone(&self) -> AVStream

Returns a duplicate of the value. 阅读更多
1.0.0 · 源代码§

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

source 执行拷贝赋值。 阅读更多
源代码§

impl Debug for AVStream

源代码§

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

使用给定的格式化器格式化该值。 阅读更多
源代码§

impl PartialEq for AVStream

源代码§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 源代码§

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

测试 !=。默认实现几乎总是足够的,没有充分理由不应被重写。
源代码§

impl Copy for AVStream

源代码§

impl Eq for AVStream

源代码§

impl StructuralPartialEq for AVStream

自动 trait 实现§

blanket 实现§

源代码§

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

源代码§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
源代码§

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

源代码§

fn borrow(&self) -> &T

从拥有的值不可变地借用。 阅读更多
源代码§

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

源代码§

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

从拥有的值可变地借用。 阅读更多
源代码§

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

源代码§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
self 执行拷贝赋值到 dest阅读更多
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回参数。

源代码§

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

源代码§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U 实现选择执行的操作。

源代码§

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

源代码§

type Owned = T

获取所有权后得到的类型。
源代码§

fn to_owned(&self) -> T

通常通过克隆,从借用数据创建拥有的数据。 阅读更多
源代码§

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

通常通过克隆,使用借用数据替换拥有的数据。 阅读更多
源代码§

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

源代码§

type Error = Infallible

转换出错时返回的类型。
源代码§

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

执行该转换。
源代码§

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

源代码§

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

转换出错时返回的类型。
源代码§

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

执行该转换。