Skip to main content

WlPayload

Trait WlPayload 

Source
pub(crate) trait WlPayload: Send + 'static {
    // Required methods
    fn encode(
        &self,
        source: Option<&Dmabuf>,
        encoder: &mut FrameEncoder,
        width: i32,
        rgba: bool,
        frame_number: u64,
        qp: u32,
        force_idr: bool,
    ) -> Result<Vec<u8>, String>;
    fn rows(&self) -> Option<&[u8]>;
}
Expand description

What a Wayland encode thread encodes a frame from: the packed rows a readback filled, or the GPU buffer a zero-copy session encodes in place.

Required Methods§

Source

fn encode( &self, source: Option<&Dmabuf>, encoder: &mut FrameEncoder, width: i32, rgba: bool, frame_number: u64, qp: u32, force_idr: bool, ) -> Result<Vec<u8>, String>

Encode the frame on a full-frame session. source stands in for the slot’s own buffer (WlFrame::source).

Source

fn rows(&self) -> Option<&[u8]>

The rows, for the CPU path; None for a GPU buffer, which only a hardware session reads.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl WlPayload for Dmabuf

Source§

fn encode( &self, source: Option<&Dmabuf>, encoder: &mut FrameEncoder, _width: i32, _rgba: bool, frame_number: u64, qp: u32, force_idr: bool, ) -> Result<Vec<u8>, String>

Source§

fn rows(&self) -> Option<&[u8]>

Source§

impl WlPayload for Vec<u8>

Source§

fn encode( &self, _source: Option<&Dmabuf>, encoder: &mut FrameEncoder, width: i32, rgba: bool, frame_number: u64, qp: u32, force_idr: bool, ) -> Result<Vec<u8>, String>

Source§

fn rows(&self) -> Option<&[u8]>

Implementors§