element: Make caps in link_filtered() / link_pads_filtered() mandatory

Instead of passing `None`, the non-filtered variants of the functions
can be used.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/328
This commit is contained in:
Sebastian Dröge 2021-05-30 20:27:49 +03:00 committed by Sebastian Dröge
parent e453701b50
commit 849a524b09
2 changed files with 12 additions and 4 deletions

View file

@ -556,6 +556,10 @@ manual_traits = ["ElementExtManual"]
[[object.function]]
name = "link_filtered"
[[object.function.parameter]]
name = "filter"
# Can use `link` instead
nullable = false
[object.function.return]
bool_return_is_error = "Failed to link elements"
@ -566,6 +570,10 @@ manual_traits = ["ElementExtManual"]
[[object.function]]
name = "link_pads_filtered"
[[object.function.parameter]]
name = "filter"
# Can use `link` instead
nullable = false
[object.function.return]
bool_return_is_error = "Failed to link pads"

View file

@ -172,7 +172,7 @@ pub trait ElementExt: 'static {
fn link_filtered<P: IsA<Element>>(
&self,
dest: &P,
filter: Option<&Caps>,
filter: &Caps,
) -> Result<(), glib::error::BoolError>;
//#[doc(alias = "gst_element_link_many")]
@ -192,7 +192,7 @@ pub trait ElementExt: 'static {
srcpadname: Option<&str>,
dest: &P,
destpadname: Option<&str>,
filter: Option<&Caps>,
filter: &Caps,
) -> Result<(), glib::error::BoolError>;
#[doc(alias = "gst_element_link_pads_full")]
@ -547,7 +547,7 @@ impl<O: IsA<Element>> ElementExt for O {
fn link_filtered<P: IsA<Element>>(
&self,
dest: &P,
filter: Option<&Caps>,
filter: &Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
@ -589,7 +589,7 @@ impl<O: IsA<Element>> ElementExt for O {
srcpadname: Option<&str>,
dest: &P,
destpadname: Option<&str>,
filter: Option<&Caps>,
filter: &Caps,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(