Struct Stream

Source
pub struct Stream<'a>(/* private fields */);
Expand description

A Stream is a wrapper around an AVStream.

Implementations§

Source§

impl<'a> Stream<'a>

Source

pub const fn as_ptr(&self) -> *const AVStream

Returns a constant pointer to the stream.

Source

pub const fn as_mut_ptr(&mut self) -> *mut AVStream

Returns a mutable pointer to the stream.

Source§

impl<'a> Stream<'a>

Source

pub const fn index(&self) -> i32

Returns the index of the stream.

Source

pub const fn id(&self) -> i32

Returns the ID of the stream.

Source

pub const fn codec_parameters(&self) -> Option<&'a AVCodecParameters>

Returns the codec parameters of the stream.

Source

pub fn time_base(&self) -> Rational

Returns the time base of the stream.

Source

pub fn set_time_base(&mut self, time_base: impl Into<Rational>)

Sets the time base of the stream.

Source

pub const fn start_time(&self) -> Option<i64>

Returns the start time of the stream.

Source

pub const fn set_start_time(&mut self, start_time: Option<i64>)

Sets the start time of the stream.

Source

pub const fn duration(&self) -> Option<i64>

Returns the duration of the stream.

Source

pub const fn set_duration(&mut self, duration: Option<i64>)

Sets the duration of the stream.

Source

pub const fn nb_frames(&self) -> Option<i64>

Returns the number of frames in the stream.

Source

pub const fn set_nb_frames(&mut self, nb_frames: i64)

Sets the number of frames in the stream.

Source

pub const fn disposition(&self) -> i32

Returns the disposition of the stream.

Source

pub const fn set_disposition(&mut self, disposition: i32)

Sets the disposition of the stream.

Source

pub const fn discard(&self) -> AVDiscard

Returns the discard flag of the stream.

Source

pub fn set_discard(&mut self, discard: AVDiscard)

Sets the discard flag of the stream.

Source

pub fn sample_aspect_ratio(&self) -> Rational

Returns the sample aspect ratio of the stream.

Source

pub fn set_sample_aspect_ratio( &mut self, sample_aspect_ratio: impl Into<Rational>, )

Sets the sample aspect ratio of the stream.

Source

pub const fn metadata(&self) -> Const<'_, Dictionary>

Returns the metadata of the stream.

Source

pub const fn metadata_mut(&mut self) -> Mut<'_, Dictionary>

Returns a mutable reference to the metadata of the stream.

Source

pub fn avg_frame_rate(&self) -> Rational

Returns the average frame rate of the stream.

Source

pub fn r_frame_rate(&self) -> Rational

Returns the real frame rate of the stream.

Source

pub const unsafe fn format_context(&self) -> *mut AVFormatContext

Returns the format context of the stream.

§Safety

This function is unsafe because it returns a mutable pointer to the format context. The caller must ensure that they have exclusive access to the format context.

Trait Implementations§

Source§

impl Debug for Stream<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Stream<'a>

§

impl<'a> RefUnwindSafe for Stream<'a>

§

impl<'a> !Send for Stream<'a>

§

impl<'a> !Sync for Stream<'a>

§

impl<'a> Unpin for Stream<'a>

§

impl<'a> !UnwindSafe for Stream<'a>

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.

§

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