Fix compilation due to changes in autogenerated code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1182>
This commit is contained in:
Sebastian Dröge 2023-01-03 21:06:38 +02:00
parent 567ce0a3bf
commit 7490846309
7 changed files with 40 additions and 26 deletions

View file

@ -244,6 +244,10 @@ manual_traits = ["AudioEncoderExtManual"]
name = "tolerance" name = "tolerance"
mandatory = true mandatory = true
[[object.function]]
name = "set_headers"
manual = true
[[object]] [[object]]
name = "GstAudio.AudioFlags" name = "GstAudio.AudioFlags"
status = "generate" status = "generate"

View file

@ -24,6 +24,9 @@ pub trait AudioEncoderExtManual: 'static {
#[doc(alias = "gst_audio_encoder_get_allocator")] #[doc(alias = "gst_audio_encoder_get_allocator")]
fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams); fn allocator(&self) -> (Option<gst::Allocator>, gst::AllocationParams);
#[doc(alias = "gst_audio_encoder_set_headers")]
fn set_headers(&self, headers: impl IntoIterator<Item = gst::Buffer>);
fn sink_pad(&self) -> &gst::Pad; fn sink_pad(&self) -> &gst::Pad;
fn src_pad(&self) -> &gst::Pad; fn src_pad(&self) -> &gst::Pad;
@ -84,6 +87,18 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExtManual for O {
} }
} }
fn set_headers(&self, headers: impl IntoIterator<Item = gst::Buffer>) {
unsafe {
ffi::gst_audio_encoder_set_headers(
self.as_ref().to_glib_none().0,
headers
.into_iter()
.collect::<glib::List<_>>()
.into_glib_ptr(),
);
}
}
fn sink_pad(&self) -> &gst::Pad { fn sink_pad(&self) -> &gst::Pad {
unsafe { unsafe {
let elt = &*(self.as_ptr() as *const ffi::GstAudioEncoder); let elt = &*(self.as_ptr() as *const ffi::GstAudioEncoder);

View file

@ -106,9 +106,6 @@ pub trait AudioEncoderExt: 'static {
#[doc(alias = "gst_audio_encoder_set_hard_resync")] #[doc(alias = "gst_audio_encoder_set_hard_resync")]
fn set_hard_resync(&self, enabled: bool); fn set_hard_resync(&self, enabled: bool);
#[doc(alias = "gst_audio_encoder_set_headers")]
fn set_headers(&self, headers: Vec<gst::Buffer>);
#[doc(alias = "gst_audio_encoder_set_latency")] #[doc(alias = "gst_audio_encoder_set_latency")]
fn set_latency(&self, min: gst::ClockTime, max: impl Into<Option<gst::ClockTime>>); fn set_latency(&self, min: gst::ClockTime, max: impl Into<Option<gst::ClockTime>>);
@ -322,15 +319,6 @@ impl<O: IsA<AudioEncoder>> AudioEncoderExt for O {
} }
} }
fn set_headers(&self, headers: Vec<gst::Buffer>) {
unsafe {
ffi::gst_audio_encoder_set_headers(
self.as_ref().to_glib_none().0,
headers.into_glib_ptr(),
);
}
}
fn set_latency(&self, min: gst::ClockTime, max: impl Into<Option<gst::ClockTime>>) { fn set_latency(&self, min: gst::ClockTime, max: impl Into<Option<gst::ClockTime>>) {
unsafe { unsafe {
ffi::gst_audio_encoder_set_latency( ffi::gst_audio_encoder_set_latency(

View file

@ -573,6 +573,10 @@ manual_traits = ["VideoEncoderExtManual"]
name = "get_allocator" name = "get_allocator"
manual = true manual = true
[[object.function]]
name = "set_headers"
manual = true
[[object]] [[object]]
name = "GstVideo.VideoFieldOrder" name = "GstVideo.VideoFieldOrder"
status = "generate" status = "generate"

View file

@ -50,9 +50,6 @@ pub trait VideoEncoderExt: 'static {
#[doc(alias = "gst_video_encoder_proxy_getcaps")] #[doc(alias = "gst_video_encoder_proxy_getcaps")]
fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps; fn proxy_getcaps(&self, caps: Option<&gst::Caps>, filter: Option<&gst::Caps>) -> gst::Caps;
#[doc(alias = "gst_video_encoder_set_headers")]
fn set_headers(&self, headers: Vec<gst::Buffer>);
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
#[doc(alias = "gst_video_encoder_set_min_force_key_unit_interval")] #[doc(alias = "gst_video_encoder_set_min_force_key_unit_interval")]
@ -137,15 +134,6 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExt for O {
} }
} }
fn set_headers(&self, headers: Vec<gst::Buffer>) {
unsafe {
ffi::gst_video_encoder_set_headers(
self.as_ref().to_glib_none().0,
headers.into_glib_ptr(),
);
}
}
#[cfg(any(feature = "v1_18", feature = "dox"))] #[cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
fn set_min_force_key_unit_interval(&self, interval: impl Into<Option<gst::ClockTime>>) { fn set_min_force_key_unit_interval(&self, interval: impl Into<Option<gst::ClockTime>>) {

View file

@ -69,6 +69,9 @@ pub trait VideoEncoderExtManual: 'static {
output_state: VideoCodecState<'a, InNegotiation<'a>>, output_state: VideoCodecState<'a, InNegotiation<'a>>,
) -> Result<(), gst::FlowError>; ) -> Result<(), gst::FlowError>;
#[doc(alias = "gst_video_encoder_set_headers")]
fn set_headers(&self, headers: impl IntoIterator<Item = gst::Buffer>);
fn sink_pad(&self) -> &gst::Pad; fn sink_pad(&self) -> &gst::Pad;
fn src_pad(&self) -> &gst::Pad; fn src_pad(&self) -> &gst::Pad;
@ -254,6 +257,18 @@ impl<O: IsA<VideoEncoder>> VideoEncoderExtManual for O {
} }
} }
fn set_headers(&self, headers: impl IntoIterator<Item = gst::Buffer>) {
unsafe {
ffi::gst_video_encoder_set_headers(
self.as_ref().to_glib_none().0,
headers
.into_iter()
.collect::<glib::List<_>>()
.into_glib_ptr(),
);
}
}
fn sink_pad(&self) -> &gst::Pad { fn sink_pad(&self) -> &gst::Pad {
unsafe { unsafe {
let elt = &*(self.as_ptr() as *const ffi::GstVideoEncoder); let elt = &*(self.as_ptr() as *const ffi::GstVideoEncoder);

View file

@ -502,14 +502,14 @@ impl fmt::Display for DateTime {
impl<'a> From<&'a glib::DateTime> for DateTime { impl<'a> From<&'a glib::DateTime> for DateTime {
fn from(v: &'a glib::DateTime) -> DateTime { fn from(v: &'a glib::DateTime) -> DateTime {
skip_assert_initialized!(); skip_assert_initialized!();
DateTime::from_g_date_time(v) DateTime::from_g_date_time(v.clone())
} }
} }
impl From<glib::DateTime> for DateTime { impl From<glib::DateTime> for DateTime {
fn from(v: glib::DateTime) -> DateTime { fn from(v: glib::DateTime) -> DateTime {
skip_assert_initialized!(); skip_assert_initialized!();
DateTime::from_g_date_time(&v) DateTime::from_g_date_time(v)
} }
} }