servo_media_gstreamer_render

Trait Render

source
pub trait Render {
    // Required methods
    fn is_gl(&self) -> bool;
    fn build_frame(&self, sample: Sample) -> Result<VideoFrame, ()>;
    fn build_video_sink(
        &self,
        appsink: &Element,
        pipeline: &Element,
    ) -> Result<(), PlayerError>;
}

Required Methods§

source

fn is_gl(&self) -> bool

Returns True if the render implementation uses any version or flavor of OpenGL

source

fn build_frame(&self, sample: Sample) -> Result<VideoFrame, ()>

Returns the Player’s Frame to be consumed by the API user.

The implementation of this method will map the sample’s buffer to the rendering appropriate structure. In the case of OpenGL-based renders, the Frame, instead of the raw data, will transfer the texture ID.

§Arguments
  • sample - the GStreamer sample with the buffer to map
source

fn build_video_sink( &self, appsink: &Element, pipeline: &Element, ) -> Result<(), PlayerError>

Sets the proper video-sink to GStreamer’s pipeline, this video sink is simply a decorator of the passed appsink.

§Arguments
  • appsink - the appsink GStreamer element to decorate
  • pipeline - the GStreamer pipeline to set the video sink

Implementors§