Struct AVStream

Source
#[repr(C)]
pub struct AVStream {
Show 61 fields pub index: c_int, pub id: c_int, pub codec: *mut AVCodecContext, 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 side_data: *mut AVPacketSideData, pub nb_side_data: c_int, pub event_flags: c_int, pub r_frame_rate: AVRational, pub recommended_encoder_configuration: *mut c_char, pub codecpar: *mut AVCodecParameters, pub info: *mut AVStream__bindgen_ty_1, pub pts_wrap_bits: c_int, pub first_dts: i64, pub cur_dts: i64, pub last_IP_pts: i64, pub last_IP_duration: c_int, pub probe_packets: c_int, pub codec_info_nb_frames: c_int, pub need_parsing: AVStreamParseType, pub parser: *mut AVCodecParserContext, pub last_in_packet_buffer: *mut AVPacketList, pub probe_data: AVProbeData, pub pts_buffer: [i64; 17], pub index_entries: *mut AVIndexEntry, pub nb_index_entries: c_int, pub index_entries_allocated_size: c_uint, pub stream_identifier: c_int, pub program_num: c_int, pub pmt_version: c_int, pub pmt_stream_idx: c_int, pub interleaver_chunk_size: i64, pub interleaver_chunk_duration: i64, pub request_probe: c_int, pub skip_to_keyframe: c_int, pub skip_samples: c_int, pub start_skip_samples: i64, pub first_discard_sample: i64, pub last_discard_sample: i64, pub nb_decoded_frames: c_int, pub mux_ts_offset: i64, pub pts_wrap_reference: i64, pub pts_wrap_behavior: c_int, pub update_initial_durations_done: c_int, pub pts_reorder_error: [i64; 17], pub pts_reorder_error_count: [u8; 17], pub last_dts_for_order_check: i64, pub dts_ordered: u8, pub dts_misordered: u8, pub inject_global_side_data: c_int, pub display_aspect_ratio: AVRational, pub internal: *mut AVStreamInternal,
}
Expand description

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§

§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

§codec: *mut AVCodecContext

@deprecated use the codecpar struct instead

§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

< AV_DISPOSITION_* bit field

§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

§side_data: *mut AVPacketSideData

An array of side data that applies to the whole stream (i.e. the container does not allow it to change between packets).

There may be no overlap between the side data in this array and side data in the packets. I.e. a given side data is either exported by the muxer (demuxing) / set by the caller (muxing) in this array, then it never appears in the packets, or the side data is exported / sent through the packets (always in the first packet where the value becomes known or changes), then it does not appear in this array.

  • demuxing: Set by libavformat when the stream is created.
  • muxing: May be set by the caller before avformat_write_header().

Freed by libavformat in avformat_free_context().

@see av_format_inject_global_side_data()

§nb_side_data: c_int

The number of elements in the AVStream.side_data array.

§event_flags: c_int

Flags for the user to detect events happening on the stream. Flags must be cleared by the user once the event has been handled. A combination of AVSTREAM_EVENT_FLAG_*.

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

§recommended_encoder_configuration: *mut c_char

String containing pairs of key and values describing recommended encoder configuration. Pairs are separated by ‘,’. Keys are separated from values by ‘=’.

@deprecated unused

§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()
§info: *mut AVStream__bindgen_ty_1§pts_wrap_bits: c_int

< number of bits in pts (used for wrapping control)

§first_dts: i64

Timestamp corresponding to the last dts sync point.

Initialized when AVCodecParserContext.dts_sync_point >= 0 and a DTS is received from the underlying container. Otherwise set to AV_NOPTS_VALUE by default.

§cur_dts: i64§last_IP_pts: i64§last_IP_duration: c_int§probe_packets: c_int

Number of packets to buffer for codec probing

§codec_info_nb_frames: c_int

Number of frames that have been demuxed during avformat_find_stream_info()

§need_parsing: AVStreamParseType§parser: *mut AVCodecParserContext§last_in_packet_buffer: *mut AVPacketList

last packet in packet_buffer for this stream when muxing.

§probe_data: AVProbeData§pts_buffer: [i64; 17]§index_entries: *mut AVIndexEntry

< Only used if the format does not support seeking natively.

§nb_index_entries: c_int§index_entries_allocated_size: c_uint§stream_identifier: c_int

Stream Identifier This is the MPEG-TS stream identifier +1 0 means unknown

§program_num: c_int

Details of the MPEG-TS program which created this stream.

§pmt_version: c_int§pmt_stream_idx: c_int§interleaver_chunk_size: i64§interleaver_chunk_duration: i64§request_probe: c_int

stream probing state -1 -> probing finished 0 -> no probing requested rest -> perform probing with request_probe being the minimum score to accept. NOT PART OF PUBLIC API

§skip_to_keyframe: c_int

Indicates that everything up to the next keyframe should be discarded.

§skip_samples: c_int

Number of samples to skip at the start of the frame decoded from the next packet.

§start_skip_samples: i64

If not 0, the number of samples that should be skipped from the start of the stream (the samples are removed from packets with pts==0, which also assumes negative timestamps do not happen). Intended for use with formats such as mp3 with ad-hoc gapless audio support.

§first_discard_sample: i64

If not 0, the first audio sample that should be discarded from the stream. This is broken by design (needs global sample count), but can’t be avoided for broken by design formats such as mp3 with ad-hoc gapless audio support.

§last_discard_sample: i64

The sample after last sample that is intended to be discarded after first_discard_sample. Works on frame boundaries only. Used to prevent early EOF if the gapless info is broken (considered concatenated mp3s).

§nb_decoded_frames: c_int

Number of internally decoded frames, used internally in libavformat, do not access its lifetime differs from info which is why it is not in that structure.

§mux_ts_offset: i64

Timestamp offset added to timestamps before muxing NOT PART OF PUBLIC API

§pts_wrap_reference: i64

Internal data to check for wrapping of the time stamp

§pts_wrap_behavior: c_int

Options for behavior, when a wrap is detected.

Defined by AV_PTS_WRAP_ values.

If correction is enabled, there are two possibilities: If the first time stamp is near the wrap point, the wrap offset will be subtracted, which will create negative time stamps. Otherwise the offset will be added.

§update_initial_durations_done: c_int

Internal data to prevent doing update_initial_durations() twice

§pts_reorder_error: [i64; 17]

Internal data to generate dts from pts

§pts_reorder_error_count: [u8; 17]§last_dts_for_order_check: i64

Internal data to analyze DTS and detect faulty mpeg streams

§dts_ordered: u8§dts_misordered: u8§inject_global_side_data: c_int

Internal data to inject global side data

§display_aspect_ratio: AVRational

display aspect ratio (0 if unknown)

  • encoding: unused
  • decoding: Set by libavformat to calculate sample_aspect_ratio internally
§internal: *mut AVStreamInternal

An opaque field for libavformat internal usage. Must not be accessed in any way by callers.

Trait Implementations§

Source§

impl Clone for AVStream

Source§

fn clone(&self) -> AVStream

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 AVStream

Source§

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

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

impl Copy for AVStream

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

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.