mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-19 08:36:27 +00:00
Update for GLib signal accumulator API changes
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1954>
This commit is contained in:
parent
204c4101f2
commit
6ee745edee
7 changed files with 49 additions and 56 deletions
|
@ -211,10 +211,9 @@ impl ObjectImpl for HlsBaseSink {
|
||||||
|
|
||||||
Some(imp.new_file_stream(&playlist_location).ok().to_value())
|
Some(imp.new_file_stream(&playlist_location).ok().to_value())
|
||||||
})
|
})
|
||||||
.accumulator(|_hint, ret, value| {
|
.accumulator(|_hint, _acc, value| {
|
||||||
// First signal handler wins
|
// First signal handler wins
|
||||||
*ret = value.clone();
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
false
|
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
glib::subclass::Signal::builder(SIGNAL_GET_FRAGMENT_STREAM)
|
glib::subclass::Signal::builder(SIGNAL_GET_FRAGMENT_STREAM)
|
||||||
|
@ -227,10 +226,9 @@ impl ObjectImpl for HlsBaseSink {
|
||||||
|
|
||||||
Some(imp.new_file_stream(&fragment_location).ok().to_value())
|
Some(imp.new_file_stream(&fragment_location).ok().to_value())
|
||||||
})
|
})
|
||||||
.accumulator(|_hint, ret, value| {
|
.accumulator(|_hint, _acc, value| {
|
||||||
// First signal handler wins
|
// First signal handler wins
|
||||||
*ret = value.clone();
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
false
|
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
glib::subclass::Signal::builder(SIGNAL_DELETE_FRAGMENT)
|
glib::subclass::Signal::builder(SIGNAL_DELETE_FRAGMENT)
|
||||||
|
@ -244,10 +242,9 @@ impl ObjectImpl for HlsBaseSink {
|
||||||
imp.delete_fragment(&fragment_location);
|
imp.delete_fragment(&fragment_location);
|
||||||
Some(true.to_value())
|
Some(true.to_value())
|
||||||
})
|
})
|
||||||
.accumulator(|_hint, ret, value| {
|
.accumulator(|_hint, _acc, value| {
|
||||||
// First signal handler wins
|
// First signal handler wins
|
||||||
*ret = value.clone();
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
false
|
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
]
|
]
|
||||||
|
|
|
@ -232,10 +232,9 @@ impl ObjectImpl for HlsCmafSink {
|
||||||
|
|
||||||
Some(imp.new_file_stream(&init_location).ok().to_value())
|
Some(imp.new_file_stream(&init_location).ok().to_value())
|
||||||
})
|
})
|
||||||
.accumulator(|_hint, ret, value| {
|
.accumulator(|_hint, _acc, value| {
|
||||||
// First signal handler wins
|
// First signal handler wins
|
||||||
*ret = value.clone();
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
false
|
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
glib::subclass::Signal::builder(SIGNAL_NEW_PLAYLIST)
|
glib::subclass::Signal::builder(SIGNAL_NEW_PLAYLIST)
|
||||||
|
|
|
@ -1947,12 +1947,11 @@ impl ObjectImpl for RtpBaseDepay2 {
|
||||||
glib::subclass::Signal::builder("request-extension")
|
glib::subclass::Signal::builder("request-extension")
|
||||||
.param_types([u32::static_type(), String::static_type()])
|
.param_types([u32::static_type(), String::static_type()])
|
||||||
.return_type::<gst_rtp::RTPHeaderExtension>()
|
.return_type::<gst_rtp::RTPHeaderExtension>()
|
||||||
.accumulator(|_hint, acc, val| {
|
.accumulator(|_hint, _acc, value| {
|
||||||
if matches!(val.get::<Option<glib::Object>>(), Ok(Some(_))) {
|
if matches!(value.get::<Option<glib::Object>>(), Ok(Some(_))) {
|
||||||
*acc = val.clone();
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
false
|
|
||||||
} else {
|
} else {
|
||||||
true
|
std::ops::ControlFlow::Continue(value.clone())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.class_handler(|args| {
|
.class_handler(|args| {
|
||||||
|
|
|
@ -1985,12 +1985,11 @@ impl ObjectImpl for RtpBasePay2 {
|
||||||
glib::subclass::Signal::builder("request-extension")
|
glib::subclass::Signal::builder("request-extension")
|
||||||
.param_types([u32::static_type(), String::static_type()])
|
.param_types([u32::static_type(), String::static_type()])
|
||||||
.return_type::<gst_rtp::RTPHeaderExtension>()
|
.return_type::<gst_rtp::RTPHeaderExtension>()
|
||||||
.accumulator(|_hint, acc, val| {
|
.accumulator(|_hint, _acc, value| {
|
||||||
if matches!(val.get::<Option<glib::Object>>(), Ok(Some(_))) {
|
if matches!(value.get::<Option<glib::Object>>(), Ok(Some(_))) {
|
||||||
*acc = val.clone();
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
false
|
|
||||||
} else {
|
} else {
|
||||||
true
|
std::ops::ControlFlow::Continue(value.clone())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.class_handler(|args| {
|
.class_handler(|args| {
|
||||||
|
|
|
@ -167,9 +167,9 @@ impl prelude::ObjectInterface for Signallable {
|
||||||
});
|
});
|
||||||
Some(Signallable::request_meta(this).to_value())
|
Some(Signallable::request_meta(this).to_value())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
/**
|
/**
|
||||||
|
@ -227,9 +227,9 @@ impl prelude::ObjectInterface for Signallable {
|
||||||
|
|
||||||
Some(false.into())
|
Some(false.into())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
/**
|
/**
|
||||||
|
@ -253,9 +253,9 @@ impl prelude::ObjectInterface for Signallable {
|
||||||
|
|
||||||
Some(false.into())
|
Some(false.into())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
/**
|
/**
|
||||||
|
@ -291,9 +291,9 @@ impl prelude::ObjectInterface for Signallable {
|
||||||
|
|
||||||
Some(false.into())
|
Some(false.into())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
/**
|
/**
|
||||||
|
@ -358,9 +358,9 @@ impl prelude::ObjectInterface for Signallable {
|
||||||
|
|
||||||
Some(desc.clone().into())
|
Some(desc.clone().into())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
/**
|
/**
|
||||||
|
@ -398,9 +398,9 @@ impl prelude::ObjectInterface for Signallable {
|
||||||
|
|
||||||
Some(false.into())
|
Some(false.into())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
/**
|
/**
|
||||||
|
@ -445,9 +445,9 @@ impl prelude::ObjectInterface for Signallable {
|
||||||
|
|
||||||
Some(false.into())
|
Some(false.into())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -859,15 +859,15 @@ fn configure_payloader(pay: &gst::Element) {
|
||||||
|
|
||||||
fn setup_signal_accumulator(
|
fn setup_signal_accumulator(
|
||||||
_hint: &glib::subclass::SignalInvocationHint,
|
_hint: &glib::subclass::SignalInvocationHint,
|
||||||
ret: &mut glib::Value,
|
_acc: glib::Value,
|
||||||
value: &glib::Value,
|
value: &glib::Value,
|
||||||
) -> bool {
|
) -> std::ops::ControlFlow<glib::Value, glib::Value> {
|
||||||
let is_configured = value.get::<bool>().unwrap();
|
let is_configured = value.get::<bool>().unwrap();
|
||||||
let continue_emission = !is_configured;
|
if !is_configured {
|
||||||
|
std::ops::ControlFlow::Continue(value.clone())
|
||||||
*ret = value.clone();
|
} else {
|
||||||
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
continue_emission
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set of elements used in an EncodingChain
|
/// Set of elements used in an EncodingChain
|
||||||
|
@ -5047,9 +5047,9 @@ impl ObjectImpl for BaseWebRTCSink {
|
||||||
.class_handler(|args| {
|
.class_handler(|args| {
|
||||||
Some(args[3usize].get::<gst::Structure>().expect("wrong argument").to_value())
|
Some(args[3usize].get::<gst::Structure>().expect("wrong argument").to_value())
|
||||||
})
|
})
|
||||||
.accumulator(move |_hint, output, input| {
|
.accumulator(move |_hint, _acc, value| {
|
||||||
*output = input.clone();
|
// First signal handler wins
|
||||||
false
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
]
|
]
|
||||||
|
|
|
@ -666,10 +666,9 @@ impl ObjectImpl for FallbackSrc {
|
||||||
// Simply return the input by default
|
// Simply return the input by default
|
||||||
Some(args[1].clone())
|
Some(args[1].clone())
|
||||||
})
|
})
|
||||||
.accumulator(|_hint, ret, value| {
|
.accumulator(|_hint, _acc, value| {
|
||||||
// First signal handler wins
|
// First signal handler wins
|
||||||
*ret = value.clone();
|
std::ops::ControlFlow::Break(value.clone())
|
||||||
false
|
|
||||||
})
|
})
|
||||||
.build(),
|
.build(),
|
||||||
glib::subclass::Signal::builder("unblock")
|
glib::subclass::Signal::builder("unblock")
|
||||||
|
|
Loading…
Reference in a new issue