Skip to main content

MockVideoFrame

Struct MockVideoFrame 

Source
pub struct MockVideoFrame {
    pub width: u32,
    pub height: u32,
    pub rotation: u32,
    pub flip: bool,
}
Expand description

A picture of a size, with no pixels on any GPU: its buffer is imported as no texture, as a frame a device cannot take, which a drawing skips, and its pixels read back opaque black, in BGRA as Apple’s frames are.

Fields§

§width: u32§height: u32§rotation: u32

What it reports as its rotation and flip.

§flip: bool

Trait Implementations§

Source§

impl Clone for MockVideoFrame

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for MockVideoFrame

Source§

impl Debug for MockVideoFrame

Source§

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

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

impl Eq for MockVideoFrame

Source§

impl PartialEq for MockVideoFrame

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MockVideoFrame

Source§

impl VideoFrame for MockVideoFrame

Source§

fn hardware_buffer(&self) -> Arc<dyn HardwareBuffer> ⓘ

A MockHardwareBuffer of its size, for what a frame’s is ([SYSTEM_GIVEN]).

Source§

fn width(&self) -> u32

The picture’s width, in its own pixels.
Source§

fn height(&self) -> u32

The picture’s height, in its own pixels.
Source§

fn read_pixels(&self) -> ImageFuture<PixelBuffer>

The frame’s pixels copied into the app’s memory, in the layout the frame holds them: BGRA on Apple’s systems. The one way back from GPU memory to the app’s; ImageErrorKind::Unsupported for a frame whose pixels are in no PixelFormat, as a decoder’s planes (HardwareBufferFormat::Nv12 and P010) are.
Source§

fn rotation(&self) -> u32

The rotation applied to the frame when it is shown, in degrees clockwise: 0, 90, 180 or 270, as WebCodecs’ VideoFrame.rotation. It applies before flip. The pixels are not turned: width and height are the frame’s own, so a frame turned a quarter shows height wide. A camera’s frame on a phone is turned so, unless its session asked for upright frames.
Source§

fn flip(&self) -> bool

Whether the frame is flipped horizontally when it is shown, after rotation, as WebCodecs’ VideoFrame.flip: a camera that looks at its user, shown as a mirror.
Source§

fn timestamp(&self) -> Option<i64>

When the picture is shown, in nanoseconds on its stream’s own timeline: for a decoder’s frame, the timestamp of the chunk it came from. None for a frame whose source gives none, as a reader’s, which comes for a display time.
Source§

fn duration(&self) -> Option<Duration>

How long the picture is shown, where its source says.
Source§

fn visible_rect(&self) -> PixelRect

The part of the frame’s memory that is picture, in its own pixels and before rotation. A decoder pads a picture to its blocks’ size, so the memory may be larger than the picture: 1920 by 1088 for a picture of 1920 by 1080. All of it, for a frame whose source pads nothing.
Source§

fn pixel_aspect(&self) -> PixelAspect

The shape of one pixel, width to height: 1 to 1 unless the video is anamorphic.
Source§

fn color(&self) -> VideoColor

What the samples mean as colour. A frame that says nothing more is red, green and blue over its whole range, as a reader’s is.
Source§

fn hdr_metadata(&self) -> Option<HdrMetadata>

The brightness the picture was mastered for, where its stream says: what a display needs to show an HDR picture.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,