mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-22 08:07:07 +00:00
ges: Mark asset APIs as Send+sync
Those objects are MT. safe Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1278>
This commit is contained in:
parent
7f7c7a4165
commit
a66fc95d2a
9 changed files with 107 additions and 25 deletions
|
@ -59,11 +59,9 @@ generate = [
|
|||
"GES.BaseTransitionClip",
|
||||
"GES.BaseXmlFormatter",
|
||||
"GES.ChildrenControlMode",
|
||||
"GES.ClipAsset",
|
||||
"GES.CommandLineFormatter",
|
||||
"GES.Edge",
|
||||
"GES.EditMode",
|
||||
"GES.EffectAsset",
|
||||
"GES.EffectClip",
|
||||
"GES.Error",
|
||||
"GES.ExtractableCheckId",
|
||||
|
@ -83,7 +81,6 @@ generate = [
|
|||
"GES.PipelineFlags",
|
||||
"GES.Source",
|
||||
"GES.SourceClip",
|
||||
"GES.SourceClipAsset",
|
||||
"GES.TestClip",
|
||||
"GES.TextHAlign",
|
||||
"GES.TextOverlay",
|
||||
|
@ -91,12 +88,9 @@ generate = [
|
|||
"GES.TextVAlign",
|
||||
"GES.TitleClip",
|
||||
"GES.TitleSource",
|
||||
"GES.TrackElementAsset",
|
||||
"GES.TrackType",
|
||||
"GES.Transition",
|
||||
"GES.TransitionClip",
|
||||
"GES.UriClipAsset",
|
||||
"GES.UriSourceAsset",
|
||||
"GES.VideoSource",
|
||||
"GES.VideoStandardTransitionType",
|
||||
"GES.VideoTestPattern",
|
||||
|
@ -110,6 +104,7 @@ generate = [
|
|||
[[object]]
|
||||
name = "GES.Asset"
|
||||
status = "generate"
|
||||
concurrency = "send+sync"
|
||||
[[object.function]]
|
||||
name = "set_proxy"
|
||||
[object.function.return]
|
||||
|
@ -161,6 +156,11 @@ status = "generate"
|
|||
[object.function.return]
|
||||
nullable_return_is_error = "Failed to split clip"
|
||||
|
||||
[[object]]
|
||||
name = "GES.ClipAsset"
|
||||
status = "generate"
|
||||
concurrency = "send+sync"
|
||||
|
||||
[[object]]
|
||||
name = "GES.Container"
|
||||
status = "generate"
|
||||
|
@ -192,6 +192,11 @@ status = "generate"
|
|||
[object.function.return]
|
||||
nullable_return_is_error = "Failed to create effect from description"
|
||||
|
||||
[[object]]
|
||||
name = "GES.EffectAsset"
|
||||
status = "generate"
|
||||
concurrency = "send+sync"
|
||||
|
||||
[[object]]
|
||||
name = "GES.Extractable"
|
||||
status = "generate"
|
||||
|
@ -260,6 +265,11 @@ status = "generate"
|
|||
[object.function.return]
|
||||
bool_return_is_error = "Failed to remove asset"
|
||||
|
||||
[[object]]
|
||||
name = "GES.SourceClipAsset"
|
||||
status = "generate"
|
||||
concurrency = "send+sync"
|
||||
|
||||
[[object]]
|
||||
name = "GES.Timeline"
|
||||
status = "generate"
|
||||
|
@ -466,6 +476,11 @@ status = "generate"
|
|||
name = "value"
|
||||
const = true
|
||||
|
||||
[[object]]
|
||||
name = "GES.TrackElementAsset"
|
||||
status = "generate"
|
||||
concurrency = "send+sync"
|
||||
|
||||
[[object]]
|
||||
name = "GES.UriClip"
|
||||
status = "generate"
|
||||
|
@ -474,6 +489,16 @@ status = "generate"
|
|||
[object.function.return]
|
||||
nullable_return_is_error = "Failed to create Uri clip from Uri"
|
||||
|
||||
[[object]]
|
||||
name = "GES.UriClipAsset"
|
||||
status = "generate"
|
||||
concurrency = "send+sync"
|
||||
|
||||
[[object]]
|
||||
name = "GES.UriSourceAsset"
|
||||
status = "generate"
|
||||
concurrency = "send+sync"
|
||||
|
||||
[[object]]
|
||||
name = "Gst.Buffer"
|
||||
status = "manual"
|
||||
|
|
|
@ -126,6 +126,9 @@ impl Asset {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for Asset {}
|
||||
unsafe impl Sync for Asset {}
|
||||
|
||||
pub trait AssetExt: 'static {
|
||||
#[doc(alias = "ges_asset_extract")]
|
||||
fn extract(&self) -> Result<Extractable, glib::Error>;
|
||||
|
@ -162,10 +165,13 @@ pub trait AssetExt: 'static {
|
|||
fn unproxy(&self, proxy: &impl IsA<Asset>) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
#[doc(alias = "proxy")]
|
||||
fn connect_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
fn connect_proxy_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
|
||||
#[doc(alias = "proxy-target")]
|
||||
fn connect_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
fn connect_proxy_target_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Asset>> AssetExt for O {
|
||||
|
@ -241,8 +247,11 @@ impl<O: IsA<Asset>> AssetExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn connect_proxy_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_proxy_trampoline<P: IsA<Asset>, F: Fn(&P) + 'static>(
|
||||
fn connect_proxy_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_proxy_trampoline<
|
||||
P: IsA<Asset>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GESAsset,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
|
@ -263,8 +272,14 @@ impl<O: IsA<Asset>> AssetExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn connect_proxy_target_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_proxy_target_trampoline<P: IsA<Asset>, F: Fn(&P) + 'static>(
|
||||
fn connect_proxy_target_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_proxy_target_trampoline<
|
||||
P: IsA<Asset>,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GESAsset,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
|
|
|
@ -30,6 +30,9 @@ impl ClipAsset {
|
|||
pub const NONE: Option<&'static ClipAsset> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for ClipAsset {}
|
||||
unsafe impl Sync for ClipAsset {}
|
||||
|
||||
pub trait ClipAssetExt: 'static {
|
||||
#[cfg(feature = "v1_18")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
||||
|
@ -51,7 +54,10 @@ pub trait ClipAssetExt: 'static {
|
|||
fn set_supported_formats(&self, supportedformats: TrackType);
|
||||
|
||||
#[doc(alias = "supported-formats")]
|
||||
fn connect_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
fn connect_supported_formats_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<ClipAsset>> ClipAssetExt for O {
|
||||
|
@ -102,10 +108,13 @@ impl<O: IsA<ClipAsset>> ClipAssetExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn connect_supported_formats_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
fn connect_supported_formats_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_supported_formats_trampoline<
|
||||
P: IsA<ClipAsset>,
|
||||
F: Fn(&P) + 'static,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GESClipAsset,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
|
|
|
@ -17,3 +17,6 @@ glib::wrapper! {
|
|||
impl EffectAsset {
|
||||
pub const NONE: Option<&'static EffectAsset> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for EffectAsset {}
|
||||
unsafe impl Sync for EffectAsset {}
|
||||
|
|
|
@ -17,3 +17,6 @@ glib::wrapper! {
|
|||
impl SourceClipAsset {
|
||||
pub const NONE: Option<&'static SourceClipAsset> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for SourceClipAsset {}
|
||||
unsafe impl Sync for SourceClipAsset {}
|
||||
|
|
|
@ -27,6 +27,9 @@ impl TrackElementAsset {
|
|||
pub const NONE: Option<&'static TrackElementAsset> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for TrackElementAsset {}
|
||||
unsafe impl Sync for TrackElementAsset {}
|
||||
|
||||
pub trait TrackElementAssetExt: 'static {
|
||||
#[cfg(feature = "v1_18")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
||||
|
@ -42,7 +45,10 @@ pub trait TrackElementAssetExt: 'static {
|
|||
fn set_track_type(&self, type_: TrackType);
|
||||
|
||||
#[doc(alias = "track-type")]
|
||||
fn connect_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
fn connect_track_type_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<TrackElementAsset>> TrackElementAssetExt for O {
|
||||
|
@ -82,10 +88,13 @@ impl<O: IsA<TrackElementAsset>> TrackElementAssetExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn connect_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
fn connect_track_type_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_track_type_trampoline<
|
||||
P: IsA<TrackElementAsset>,
|
||||
F: Fn(&P) + 'static,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GESTrackElementAsset,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
|
|
|
@ -65,6 +65,9 @@ impl UriClipAsset {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for UriClipAsset {}
|
||||
unsafe impl Sync for UriClipAsset {}
|
||||
|
||||
pub trait UriClipAssetExt: 'static {
|
||||
#[doc(alias = "ges_uri_clip_asset_get_duration")]
|
||||
#[doc(alias = "get_duration")]
|
||||
|
@ -97,12 +100,18 @@ pub trait UriClipAssetExt: 'static {
|
|||
fn is_nested_timeline(&self) -> bool;
|
||||
|
||||
#[doc(alias = "duration")]
|
||||
fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
|
||||
#[cfg(feature = "v1_18")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
||||
#[doc(alias = "is-nested-timeline")]
|
||||
fn connect_is_nested_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
fn connect_is_nested_timeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
|
||||
|
@ -160,10 +169,13 @@ impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
|
|||
glib::ObjectExt::property(self.as_ref(), "is-nested-timeline")
|
||||
}
|
||||
|
||||
fn connect_duration_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
fn connect_duration_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_duration_trampoline<
|
||||
P: IsA<UriClipAsset>,
|
||||
F: Fn(&P) + 'static,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GESUriClipAsset,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
|
@ -187,10 +199,13 @@ impl<O: IsA<UriClipAsset>> UriClipAssetExt for O {
|
|||
|
||||
#[cfg(feature = "v1_18")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
||||
fn connect_is_nested_timeline_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
fn connect_is_nested_timeline_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_is_nested_timeline_trampoline<
|
||||
P: IsA<UriClipAsset>,
|
||||
F: Fn(&P) + 'static,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut ffi::GESUriClipAsset,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
|
|
|
@ -19,6 +19,9 @@ impl UriSourceAsset {
|
|||
pub const NONE: Option<&'static UriSourceAsset> = None;
|
||||
}
|
||||
|
||||
unsafe impl Send for UriSourceAsset {}
|
||||
unsafe impl Sync for UriSourceAsset {}
|
||||
|
||||
pub trait UriSourceAssetExt: 'static {
|
||||
#[doc(alias = "ges_uri_source_asset_get_filesource_asset")]
|
||||
#[doc(alias = "get_filesource_asset")]
|
||||
|
|
|
@ -67,7 +67,7 @@ impl<O: IsA<crate::Formatter>> FormatterExtManual for O {
|
|||
caps.to_glib_none().0,
|
||||
version,
|
||||
rank.into_glib(),
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue