mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-09-20 19:10:06 +00:00
Allow None caps for appsrc/appsink
Thanks to Guillaume Desmottes for noticing
This commit is contained in:
parent
e6d72527c4
commit
c9636bca2e
3 changed files with 20 additions and 4 deletions
|
@ -55,6 +55,12 @@ trait = false
|
||||||
# Action signal
|
# Action signal
|
||||||
ignore = true
|
ignore = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_caps"
|
||||||
|
[[object.function.parameter]]
|
||||||
|
name = "caps"
|
||||||
|
nullable = true
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "GstApp.AppSrc"
|
name = "GstApp.AppSrc"
|
||||||
status = "generate"
|
status = "generate"
|
||||||
|
@ -80,6 +86,12 @@ trait = false
|
||||||
# Action signal
|
# Action signal
|
||||||
ignore = true
|
ignore = true
|
||||||
|
|
||||||
|
[[object.function]]
|
||||||
|
name = "set_caps"
|
||||||
|
[[object.function.parameter]]
|
||||||
|
name = "caps"
|
||||||
|
nullable = true
|
||||||
|
|
||||||
[[object]]
|
[[object]]
|
||||||
name = "Gst.Structure"
|
name = "Gst.Structure"
|
||||||
status = "manual"
|
status = "manual"
|
||||||
|
|
|
@ -97,9 +97,11 @@ impl AppSink {
|
||||||
// unsafe { TODO: call ffi::gst_app_sink_set_callbacks() }
|
// unsafe { TODO: call ffi::gst_app_sink_set_callbacks() }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
pub fn set_caps(&self, caps: &gst::Caps) {
|
pub fn set_caps<'a, P: Into<Option<&'a gst::Caps>>>(&self, caps: P) {
|
||||||
|
let caps = caps.into();
|
||||||
|
let caps = caps.to_glib_none();
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::gst_app_sink_set_caps(self.to_glib_none().0, caps.to_glib_none().0);
|
ffi::gst_app_sink_set_caps(self.to_glib_none().0, caps.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,11 @@ impl AppSrc {
|
||||||
// unsafe { TODO: call ffi::gst_app_src_set_callbacks() }
|
// unsafe { TODO: call ffi::gst_app_src_set_callbacks() }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
pub fn set_caps(&self, caps: &gst::Caps) {
|
pub fn set_caps<'a, P: Into<Option<&'a gst::Caps>>>(&self, caps: P) {
|
||||||
|
let caps = caps.into();
|
||||||
|
let caps = caps.to_glib_none();
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::gst_app_src_set_caps(self.to_glib_none().0, caps.to_glib_none().0);
|
ffi::gst_app_src_set_caps(self.to_glib_none().0, caps.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue