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: u32What it reports as its rotation and flip.
flip: boolTrait Implementations§
Source§impl Clone for MockVideoFrame
impl Clone for MockVideoFrame
impl Copy for MockVideoFrame
Source§impl Debug for MockVideoFrame
impl Debug for MockVideoFrame
impl Eq for MockVideoFrame
Source§impl PartialEq for MockVideoFrame
impl PartialEq for MockVideoFrame
impl StructuralPartialEq for MockVideoFrame
Source§impl VideoFrame for MockVideoFrame
impl VideoFrame for MockVideoFrame
Source§fn hardware_buffer(&self) -> Arc<dyn HardwareBuffer> ⓘ
fn hardware_buffer(&self) -> Arc<dyn HardwareBuffer> ⓘ
A MockHardwareBuffer of its size, for what a frame’s is ([SYSTEM_GIVEN]).
Source§fn read_pixels(&self) -> ImageFuture<PixelBuffer>
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
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
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>
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 visible_rect(&self) -> PixelRect
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
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
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>
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§
impl Forget for MockVideoFrame
impl Freeze for MockVideoFrame
impl Move for MockVideoFrame
impl RefUnwindSafe for MockVideoFrame
impl Send for MockVideoFrame
impl Sync for MockVideoFrame
impl Unpin for MockVideoFrame
impl UnsafeUnpin for MockVideoFrame
impl UnwindSafe for MockVideoFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.