Struct rsmpeg::ffi::AVPacket[][src]

#[repr(C)]
pub struct AVPacket { pub buf: *mut AVBufferRef, pub pts: i64, pub dts: i64, pub data: *mut u8, pub size: i32, pub stream_index: i32, pub flags: i32, pub side_data: *mut AVPacketSideData, pub side_data_elems: i32, pub duration: i64, pub pos: i64, pub convergence_duration: i64, }
Expand description

This structure stores compressed data. It is typically exported by demuxers and then passed as input to decoders, or received as output from encoders and then passed to muxers.

For video, it should typically contain one compressed frame. For audio it may contain several compressed frames. Encoders are allowed to output empty packets, with no compressed data, containing only side data (e.g. to update some stream parameters at the end of encoding).

The semantics of data ownership depends on the buf field. If it is set, the packet data is dynamically allocated and is valid indefinitely until a call to av_packet_unref() reduces the reference count to 0.

If the buf field is not set av_packet_ref() would make a copy instead of increasing the reference count.

The side data is always allocated with av_malloc(), copied by av_packet_ref() and freed by av_packet_unref().

sizeof(AVPacket) being a part of the public ABI is deprecated. once av_init_packet() is removed, new packets will only be able to be allocated with av_packet_alloc(), and new fields may be added to the end of the struct with a minor bump.

@see av_packet_alloc @see av_packet_ref @see av_packet_unref

Fields

buf: *mut AVBufferRef
Expand description

A reference to the reference-counted buffer where the packet data is stored. May be NULL, then the packet data is not reference-counted.

pts: i64
Expand description

Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will be presented to the user. Can be AV_NOPTS_VALUE if it is not stored in the file. pts MUST be larger or equal to dts as presentation cannot happen before decompression, unless one wants to view hex dumps. Some formats misuse the terms dts and pts/cts to mean something different. Such timestamps must be converted to true pts/dts before they are stored in AVPacket.

dts: i64
Expand description

Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed. Can be AV_NOPTS_VALUE if it is not stored in the file.

data: *mut u8size: i32stream_index: i32flags: i32
Expand description

A combination of AV_PKT_FLAG values

side_data: *mut AVPacketSideData
Expand description

Additional packet data that can be provided by the container. Packet can contain several types of side information.

side_data_elems: i32duration: i64
Expand description

Duration of this packet in AVStream->time_base units, 0 if unknown. Equals next_pts - this_pts in presentation order.

pos: i64
Expand description

< byte position in stream, -1 if unknown

convergence_duration: i64
Expand description

@deprecated Same as the duration field, but as int64_t. This was required for Matroska subtitles, whose duration values could overflow when the duration field was still an int.

Trait Implementations

impl Clone for AVPacket[src]

pub fn clone(&self) -> AVPacket[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for AVPacket[src]

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

Formats the value using the given formatter. Read more

impl Copy for AVPacket[src]

Auto Trait Implementations

impl RefUnwindSafe for AVPacket

impl !Send for AVPacket

impl !Sync for AVPacket

impl Unpin for AVPacket

impl UnwindSafe for AVPacket

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.