gstreamer-video/video_encoder: Manually implement finish_subframe

This commit is contained in:
Vivia Nikolaidou 2020-05-03 15:26:36 +03:00 committed by Sebastian Dröge
parent 61c80ada48
commit 4718f72fed
2 changed files with 19 additions and 0 deletions

View file

@ -193,6 +193,10 @@ manual_traits = ["VideoEncoderExtManual"]
name = "finish_frame"
ignore = true
[[object.function]]
name = "finish_subframe"
ignore = true
[[object.function]]
name = "set_latency"
ignore = true

View file

@ -38,6 +38,10 @@ pub trait VideoEncoderExtManual: 'static {
frame: Option<VideoCodecFrame>,
) -> Result<gst::FlowSuccess, gst::FlowError>;
#[cfg(any(feature = "v1_18", feature = "dox"))]
fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime);
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime);
@ -97,6 +101,17 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
ret.into_result()
}
#[cfg(any(feature = "v1_18", feature = "dox"))]
fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
let ret: gst::FlowReturn = unsafe {
from_glib(gst_video_sys::gst_video_encoder_finish_subframe(
self.as_ref().to_glib_none().0,
frame.to_glib_none().0,
))
};
ret.into_result()
}
fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime) {
let mut min_latency = gst_sys::GST_CLOCK_TIME_NONE;
let mut max_latency = gst_sys::GST_CLOCK_TIME_NONE;