gstreamer-video: Autogenerate part of the VideoDecoder subframe API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1183>
This commit is contained in:
Sebastian Dröge 2023-01-04 17:45:33 +02:00
parent 315704fe67
commit 5e852fa0ff
3 changed files with 54 additions and 67 deletions

View file

@ -445,18 +445,6 @@ manual_traits = ["VideoDecoderExtManual"]
name = "allocate_output_frame_with_params" name = "allocate_output_frame_with_params"
ignore = true ignore = true
[[object.function]]
name = "finish_subframe"
manual = true
[[object.function]]
name = "drop_subframe"
manual = true
[[object.function]]
name = "have_last_subframe"
manual = true
[[object.function]] [[object.function]]
name = "get_processed_subframe_index" name = "get_processed_subframe_index"
manual = true manual = true

View file

@ -41,9 +41,19 @@ pub trait VideoDecoderExt: 'static {
#[doc(alias = "gst_video_decoder_drop_frame")] #[doc(alias = "gst_video_decoder_drop_frame")]
fn drop_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>; fn drop_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_drop_subframe")]
fn drop_subframe(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "gst_video_decoder_finish_frame")] #[doc(alias = "gst_video_decoder_finish_frame")]
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>; fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_finish_subframe")]
fn finish_subframe(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "gst_video_decoder_get_buffer_pool")] #[doc(alias = "gst_video_decoder_get_buffer_pool")]
#[doc(alias = "get_buffer_pool")] #[doc(alias = "get_buffer_pool")]
fn buffer_pool(&self) -> Option<gst::BufferPool>; fn buffer_pool(&self) -> Option<gst::BufferPool>;
@ -91,6 +101,14 @@ pub trait VideoDecoderExt: 'static {
#[doc(alias = "gst_video_decoder_have_frame")] #[doc(alias = "gst_video_decoder_have_frame")]
fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError>; fn have_frame(&self) -> Result<gst::FlowSuccess, gst::FlowError>;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_have_last_subframe")]
fn have_last_subframe(
&self,
frame: &VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "gst_video_decoder_merge_tags")] #[doc(alias = "gst_video_decoder_merge_tags")]
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode); fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode);
@ -252,6 +270,17 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExt for O {
} }
} }
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn drop_subframe(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_video_decoder_drop_subframe(
self.as_ref().to_glib_none().0,
frame.into_glib_ptr(),
))
}
}
fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> { fn finish_frame(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe { unsafe {
try_from_glib(ffi::gst_video_decoder_finish_frame( try_from_glib(ffi::gst_video_decoder_finish_frame(
@ -261,6 +290,17 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExt for O {
} }
} }
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn finish_subframe(&self, frame: VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_video_decoder_finish_subframe(
self.as_ref().to_glib_none().0,
frame.into_glib_ptr(),
))
}
}
fn buffer_pool(&self) -> Option<gst::BufferPool> { fn buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe { unsafe {
from_glib_full(ffi::gst_video_decoder_get_buffer_pool( from_glib_full(ffi::gst_video_decoder_get_buffer_pool(
@ -338,6 +378,20 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExt for O {
} }
} }
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
fn have_last_subframe(
&self,
frame: &VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_video_decoder_have_last_subframe(
self.as_ref().to_glib_none().0,
frame.to_glib_none().0,
))
}
}
fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) { fn merge_tags(&self, tags: Option<&gst::TagList>, mode: gst::TagMergeMode) {
unsafe { unsafe {
ffi::gst_video_decoder_merge_tags( ffi::gst_video_decoder_merge_tags(

View file

@ -45,22 +45,6 @@ pub trait VideoDecoderExtManual: 'static {
#[doc(alias = "get_allocator")] #[doc(alias = "get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_finish_subframe")]
fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_drop_subframe")]
fn drop_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError>;
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_have_last_subframe")]
fn have_last_subframe(
&self,
frame: &VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError>;
#[doc(alias = "get_latency")] #[doc(alias = "get_latency")]
fn latency(&self) -> (gst::ClockTime, Option<gst::ClockTime>); fn latency(&self) -> (gst::ClockTime, Option<gst::ClockTime>);
fn set_latency( fn set_latency(
@ -340,45 +324,6 @@ impl<O: IsA<VideoDecoder>> VideoDecoderExtManual for O {
} }
} }
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_finish_subframe")]
fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_video_decoder_finish_subframe(
self.as_ref().to_glib_none().0,
frame.to_glib_full(),
))
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_drop_subframe")]
fn drop_subframe(&self, frame: &VideoCodecFrame) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_video_decoder_drop_subframe(
self.as_ref().to_glib_none().0,
frame.to_glib_full(),
))
}
}
#[cfg(any(feature = "v1_20", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
#[doc(alias = "gst_video_decoder_have_last_subframe")]
fn have_last_subframe(
&self,
frame: &VideoCodecFrame,
) -> Result<gst::FlowSuccess, gst::FlowError> {
unsafe {
try_from_glib(ffi::gst_video_decoder_have_last_subframe(
self.as_ref().to_glib_none().0,
frame.to_glib_none().0,
))
}
}
fn sink_pad(&self) -> &gst::Pad { fn sink_pad(&self) -> &gst::Pad {
unsafe { unsafe {
let elt = &*(self.as_ptr() as *const ffi::GstVideoDecoder); let elt = &*(self.as_ptr() as *const ffi::GstVideoDecoder);