AssetPtr

Struct AssetPtr 

Source
pub struct AssetPtr<T> { /* private fields */ }
Expand description

A managed iasset pointer.

Implementations§

Source§

impl<T> AssetPtr<T>

Source

pub fn adopt(lp: *mut T) -> Self

Attach to an iasset pointer and increment its reference count.

Source§

impl<T: NamedInterface> AssetPtr<T>

Attempt to construct Self via a conversion.

Source

pub fn try_from<U>(other: &mut AssetPtr<U>) -> Result<Self>

Retrieve a supported interface of the managed pointer.

Example:

let mut site = AssetPtr::adopt(external_ptr);
let source = AssetPtr::<video_source>::try_from(&mut site);
assert!(source.is_ok());

Methods from Deref<Target = video_destination>§

Source

pub fn is_alive(&self) -> bool

Whether this instance of video_renderer is attached to a DOM element and is capable of playing.

Source

pub fn start_streaming( &mut self, frame_size: (i32, i32), color_space: COLOR_SPACE, src: Option<&video_source>, ) -> Result<()>

Start streaming/rendering.

  • frame_size - the width and the height of the video frame.
  • color_space - the color space format of the video frame.
  • src - an optional custom video_source interface implementation, provided by the application.
Source

pub fn stop_streaming(&mut self) -> Result<()>

Stop streaming.

Source

pub fn render_frame(&mut self, data: &[u8]) -> Result<()>

Render the next frame.

Source

pub fn render_frame_with_stride( &mut self, data: &[u8], stride: u32, ) -> Result<()>

Render the next frame with the given stride.

Trait Implementations§

Source§

impl DerefMut for AssetPtr<fragmented_video_destination>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl DerefMut for AssetPtr<video_destination>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T> Drop for AssetPtr<T>

Decrements the reference count of a managed pointer.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> From<*mut T> for AssetPtr<T>

Attach to an iasset pointer.

Source§

fn from(lp: *mut T) -> Self

Attach to a pointer and increment its reference count.

Source§

impl Deref for AssetPtr<fragmented_video_destination>

Source§

type Target = fragmented_video_destination

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Deref for AssetPtr<video_destination>

Source§

type Target = video_destination

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T> Send for AssetPtr<T>

It’s okay to transfer video pointers between threads.

Auto Trait Implementations§

§

impl<T> Freeze for AssetPtr<T>

§

impl<T> RefUnwindSafe for AssetPtr<T>
where T: RefUnwindSafe,

§

impl<T> !Sync for AssetPtr<T>

§

impl<T> Unpin for AssetPtr<T>

§

impl<T> UnwindSafe for AssetPtr<T>
where T: RefUnwindSafe,

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.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.