mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 02:51:10 +00:00
validate: Mark Scenario as Send+Sync
Scenario are MT safe these days Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1265>
This commit is contained in:
parent
3c8eeb6482
commit
bd79fcf058
4 changed files with 25 additions and 9 deletions
|
@ -55,4 +55,3 @@ manual = [
|
|||
[[object]]
|
||||
name = "GstValidate.Scenario"
|
||||
status = "generate"
|
||||
concurrency = "none"
|
||||
|
|
|
@ -366,6 +366,7 @@ impl<'a> ActionTypeBuilder<'a> {
|
|||
}
|
||||
|
||||
pub trait ActionTypeExtManual: 'static {
|
||||
#[doc(alias = "gst_validate_get_action_type")]
|
||||
fn find(name: &str) -> Option<crate::ActionType>;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,9 @@ impl Scenario {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Scenario {}
|
||||
unsafe impl Sync for Scenario {}
|
||||
|
||||
mod sealed {
|
||||
pub trait Sealed {}
|
||||
impl<T: super::IsA<super::Scenario>> Sealed for T {}
|
||||
|
@ -105,10 +108,13 @@ pub trait ScenarioExt: IsA<Scenario> + sealed::Sealed + 'static {
|
|||
}
|
||||
|
||||
#[doc(alias = "action-done")]
|
||||
fn connect_action_done<F: Fn(&Self, &Action) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
fn connect_action_done<F: Fn(&Self, &Action) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn action_done_trampoline<
|
||||
P: IsA<Scenario>,
|
||||
F: Fn(&P, &Action) + 'static,
|
||||
F: Fn(&P, &Action) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstValidateScenario,
|
||||
action: *mut ffi::GstValidateAction,
|
||||
|
@ -134,8 +140,11 @@ pub trait ScenarioExt: IsA<Scenario> + sealed::Sealed + 'static {
|
|||
}
|
||||
|
||||
#[doc(alias = "done")]
|
||||
fn connect_done<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn done_trampoline<P: IsA<Scenario>, F: Fn(&P) + 'static>(
|
||||
fn connect_done<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn done_trampoline<
|
||||
P: IsA<Scenario>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstValidateScenario,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
|
@ -156,10 +165,13 @@ pub trait ScenarioExt: IsA<Scenario> + sealed::Sealed + 'static {
|
|||
}
|
||||
|
||||
#[doc(alias = "execute-on-idle")]
|
||||
fn connect_execute_on_idle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
fn connect_execute_on_idle_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_execute_on_idle_trampoline<
|
||||
P: IsA<Scenario>,
|
||||
F: Fn(&P) + 'static,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstValidateScenario,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
|
@ -182,10 +194,13 @@ pub trait ScenarioExt: IsA<Scenario> + sealed::Sealed + 'static {
|
|||
}
|
||||
|
||||
#[doc(alias = "handles-states")]
|
||||
fn connect_handles_states_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
fn connect_handles_states_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_handles_states_trampoline<
|
||||
P: IsA<Scenario>,
|
||||
F: Fn(&P) + 'static,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GstValidateScenario,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
|
|
|
@ -30,6 +30,7 @@ workspace = true
|
|||
all-features = true
|
||||
rustc-args = ["--cfg", "docsrs"]
|
||||
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
|
||||
features = []
|
||||
|
||||
[package.metadata.system-deps.gstreamer_validate_1_0]
|
||||
name = "gstreamer-validate-1.0"
|
||||
|
|
Loading…
Reference in a new issue