mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-22 16:16:37 +00:00
gstreamer-base: update signatures to Result<(), glib::BoolError>
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/175
This commit is contained in:
parent
c65214b207
commit
7cb1dc9cb4
3 changed files with 19 additions and 6 deletions
|
@ -92,6 +92,11 @@ name = "GstBase.BaseSrc"
|
|||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
name = "set_caps"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to set caps"
|
||||
|
||||
[[object.function]]
|
||||
name = "start_complete"
|
||||
# Use Result<FlowSuccess, FlowError>
|
||||
|
@ -117,6 +122,12 @@ name = "GstBase.BaseTransform"
|
|||
subclassing = true
|
||||
status = "generate"
|
||||
|
||||
[[object.function]]
|
||||
name = "update_src_caps"
|
||||
[object.function.return]
|
||||
bool_return_is_error = "Failed to update src caps"
|
||||
|
||||
|
||||
[[object]]
|
||||
name = "GstBase.Aggregator"
|
||||
status = "generate"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Cast;
|
||||
|
@ -53,7 +54,7 @@ pub trait BaseSrcExt: 'static {
|
|||
|
||||
fn set_blocksize(&self, blocksize: u32);
|
||||
|
||||
fn set_caps(&self, caps: &gst::Caps) -> bool;
|
||||
fn set_caps(&self, caps: &gst::Caps) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn set_do_timestamp(&self, timestamp: bool);
|
||||
|
||||
|
@ -149,9 +150,9 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn set_caps(&self, caps: &gst::Caps) -> bool {
|
||||
fn set_caps(&self, caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_base_src_set_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0))
|
||||
glib_result_from_gboolean!(ffi::gst_base_src_set_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0), "Failed to set caps")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Cast;
|
||||
|
@ -56,7 +57,7 @@ pub trait BaseTransformExt: 'static {
|
|||
|
||||
fn update_qos(&self, proportion: f64, diff: gst::ClockTimeDiff, timestamp: gst::ClockTime);
|
||||
|
||||
fn update_src_caps(&self, updated_caps: &gst::Caps) -> bool;
|
||||
fn update_src_caps(&self, updated_caps: &gst::Caps) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn get_property_qos(&self) -> bool;
|
||||
|
||||
|
@ -142,9 +143,9 @@ impl<O: IsA<BaseTransform>> BaseTransformExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn update_src_caps(&self, updated_caps: &gst::Caps) -> bool {
|
||||
fn update_src_caps(&self, updated_caps: &gst::Caps) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
from_glib(ffi::gst_base_transform_update_src_caps(self.as_ref().to_glib_none().0, updated_caps.to_glib_none().0))
|
||||
glib_result_from_gboolean!(ffi::gst_base_transform_update_src_caps(self.as_ref().to_glib_none().0, updated_caps.to_glib_none().0), "Failed to update src caps")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue