Skip to main content

FrameProducer

Trait FrameProducer 

Source
pub trait FrameProducer {
    // Required methods
    fn capabilities(&self) -> ProducerCapabilities;
    fn acquire_frame(&mut self) -> Result<NativeFrame, InteropError>;
}
Expand description

Produces NativeFrames for a TextureImporter to consume.

Implement this for your GL/Vulkan/Metal renderer to feed frames into the interop pipeline. See raw_gl::producer::RawGlFrameProducer for a ready-made implementation that wraps any GL context.

Required Methods§

Source

fn capabilities(&self) -> ProducerCapabilities

Returns what frame kinds this producer can emit.

Source

fn acquire_frame(&mut self) -> Result<NativeFrame, InteropError>

Acquire the next frame from the producer. The returned NativeFrame should be passed immediately to TextureImporter::import_frame.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§