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§
sourcefn is_gl(&self) -> bool
fn is_gl(&self) -> bool
Returns True
if the render implementation uses any version
or flavor of OpenGL
sourcefn build_frame(&self, sample: Sample) -> Result<VideoFrame, ()>
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
sourcefn build_video_sink(
&self,
appsink: &Element,
pipeline: &Element,
) -> Result<(), PlayerError>
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 decoratepipeline
- the GStreamer pipeline to set the video sink