Skip to main content

ToRGBA

Trait ToRGBA 

Source
pub trait ToRGBA: Send + Sync {
    // Required methods
    fn get_num_bytes(&self) -> RVec<usize>;
    fn get_num_bytes_rgba(&self) -> usize;
    fn get_total_bytes(&self) -> usize;
    fn load_frame(
        &self,
        inputs: &RSlice<'_, RSlice<'_, u8>>,
    ) -> LoadedVideoFrame;
    fn process_frame(&self, sources: LoadedVideoFrame) -> VideoFrame;
}
Expand description

Provides functions for loading video frames onto the GPU.

Required Methods§

Source

fn get_num_bytes(&self) -> RVec<usize>

Used internally by Phaneron to get the size of a frame before loading.

Source

fn get_num_bytes_rgba(&self) -> usize

Used internally by Phaneron to get the size of a frame after it is loaded onto the GPU.

Source

fn get_total_bytes(&self) -> usize

Used internally by Phaneron during the loading process.

Source

fn load_frame(&self, inputs: &RSlice<'_, RSlice<'_, u8>>) -> LoadedVideoFrame

Loads a frame onto the GPU. For YUV formats, each of the Y,U, and V planes should be provided in its own slice, thus a slice of slices is taken as an argument. This does not perform the format conversion, only the copy. Both this function and process_frame may be called in a background task/thread outside of the process_frame function. A node should ensure that it only copies a “reasonable” amount of frames onto the GPU at any point in time.

Source

fn process_frame(&self, sources: LoadedVideoFrame) -> VideoFrame

After loading a frame it must be processed into the common video format by calling this function.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'lt, _ErasedPtr> ToRGBA for ToRGBA_TO<'lt, _ErasedPtr>
where Self: Send + Sync, _ErasedPtr: AsPtr<PtrTarget = ()>,