FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    NativeGlFrameProducer

    struct · ferroui-media-opengl · v0.5.0

    struct NativeGlFrameProducer
    

    View source

    Members

    import_native

    unsafe fn import_native(self: &Self, metadata: FrameMetadata, import: impl FnOnce(&Rc<dyn IGlContext>) -> Result<NativeTextureView, MediaError> + Send + 'static) -> MediaFuture<Option<ReadyGlFrame>>
    

    Creates a lease-backed alias without allocating/copying image storage. Admission reserves retained native bytes before importing. Saturation drops the captured native frame without queuing a render job.

    Safety

    The callback must obey NativeTextureView::new's contract. Native producer storage must remain immutable until the callback releases it. Metadata must describe the sampled alias and count all retained native allocation.

    Source

    from_interop

    fn from_interop(interop: &dyn ICompositionGpuInterop, budget: FrameBudget) -> Result<Self, MediaError>
    

    Source

    budget

    fn budget(self: &Self) -> FrameBudget
    

    Source

    with_budget

    fn with_budget(self: &Self, budget: FrameBudget) -> Self
    

    Source

    device

    fn device(self: &Self) -> DeviceIdentity
    

    Source

    device_generation

    fn device_generation(self: &Self) -> u64
    

    Source

    retirement_wakeup

    fn retirement_wakeup(self: &Self) -> Arc<dyn Fn() -> () + Send + Sync>
    

    Source

    invoke

    fn invoke<T: Send + 'static>(self: &Self, job: impl FnOnce(&Rc<dyn IGlContext>) -> Result<T, MediaError> + Send + 'static) -> MediaFuture<T>
    

    Runs a narrow native operation on the render thread with the admitted GL context current. The closure must restore any GL state it changes. Captures and results must be Send; the context never leaves its thread.

    Source

    produce

    fn produce(self: &Self, metadata: FrameMetadata, draw: impl FnOnce(&Rc<dyn IGlContext>, u32) -> Result<(), MediaError> + Send + 'static) -> MediaFuture<Option<ReadyGlFrame>>
    

    Reserves before allocation. Saturation returns None without queuing a draw. draw must write the complete image and preserve GL state. A GPU fence retains storage even if this future is canceled after submission.

    Source

    produce_owned

    fn produce_owned<T: std::any::Any + Send + Sync>(self: &Self, metadata: FrameMetadata, producer_owner: T, draw: impl FnOnce(&Rc<dyn IGlContext>, u32) -> Result<(), MediaError> + Send + 'static) -> MediaFuture<Option<ReadyGlFrame>>
    

    producer_owner keeps borrowed native input alive through conversion completion, even when the session is replaced while the job is queued.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.