mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 03:21:03 +00:00
gstreamer-video/video_encoder: Manually implement finish_subframe
This commit is contained in:
parent
61c80ada48
commit
4718f72fed
2 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue