mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-03 02:03:48 +00:00
ts: rt/pad: fix obsolete FIXMEs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2278>
This commit is contained in:
parent
e3c97941ec
commit
9b677234dd
1 changed files with 7 additions and 47 deletions
|
@ -118,8 +118,7 @@ fn event_to_event_full_serialized(
|
||||||
/// [`PadSrc`]: struct.PadSrc.html
|
/// [`PadSrc`]: struct.PadSrc.html
|
||||||
/// [`pad` module]: index.html
|
/// [`pad` module]: index.html
|
||||||
pub trait PadSrcHandler: Clone + Send + Sync + 'static {
|
pub trait PadSrcHandler: Clone + Send + Sync + 'static {
|
||||||
// FIXME we should use a GAT here: ObjectSubclass<Type: IsA<gst::Element> + Send>
|
type ElementImpl: ElementImpl<Type: Send>;
|
||||||
type ElementImpl: ElementImpl + ObjectSubclass;
|
|
||||||
|
|
||||||
fn src_activate(
|
fn src_activate(
|
||||||
self,
|
self,
|
||||||
|
@ -159,15 +158,7 @@ pub trait PadSrcHandler: Clone + Send + Sync + 'static {
|
||||||
|
|
||||||
fn src_event(self, pad: &gst::Pad, imp: &Self::ElementImpl, event: gst::Event) -> bool {
|
fn src_event(self, pad: &gst::Pad, imp: &Self::ElementImpl, event: gst::Event) -> bool {
|
||||||
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", event);
|
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", event);
|
||||||
|
gst::Pad::event_default(pad, Some(imp.obj().as_ref()), event)
|
||||||
let elem = imp.obj();
|
|
||||||
// FIXME with GAT on `Self::ElementImpl`, we should be able to
|
|
||||||
// use `.upcast::<gst::Element>()`
|
|
||||||
//
|
|
||||||
// Safety: `Self::ElementImpl` is bound to `gst::subclass::ElementImpl`.
|
|
||||||
let element = unsafe { elem.unsafe_cast_ref::<gst::Element>() };
|
|
||||||
|
|
||||||
gst::Pad::event_default(pad, Some(element), event)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn src_event_full(
|
fn src_event_full(
|
||||||
|
@ -190,15 +181,7 @@ pub trait PadSrcHandler: Clone + Send + Sync + 'static {
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", query);
|
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", query);
|
||||||
|
gst::Pad::query_default(pad, Some(imp.obj().as_ref()), query)
|
||||||
let elem = imp.obj();
|
|
||||||
// FIXME with GAT on `Self::ElementImpl`, we should be able to
|
|
||||||
// use `.upcast::<gst::Element>()`
|
|
||||||
//
|
|
||||||
// Safety: `Self::ElementImpl` is bound to `gst::subclass::ElementImpl`.
|
|
||||||
let element = unsafe { elem.unsafe_cast_ref::<gst::Element>() };
|
|
||||||
|
|
||||||
gst::Pad::query_default(pad, Some(element), query)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -512,8 +495,7 @@ impl Deref for PadSrc {
|
||||||
/// [`PadSink`]: struct.PadSink.html
|
/// [`PadSink`]: struct.PadSink.html
|
||||||
/// [`pad` module]: index.html
|
/// [`pad` module]: index.html
|
||||||
pub trait PadSinkHandler: Clone + Send + Sync + 'static {
|
pub trait PadSinkHandler: Clone + Send + Sync + 'static {
|
||||||
// FIXME we should use a GAT here: ObjectSubclass<Type: IsA<gst::Element> + Send>
|
type ElementImpl: ElementImpl<Type: Send>;
|
||||||
type ElementImpl: ElementImpl + ObjectSubclass;
|
|
||||||
|
|
||||||
fn sink_activate(
|
fn sink_activate(
|
||||||
self,
|
self,
|
||||||
|
@ -572,15 +554,7 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static {
|
||||||
fn sink_event(self, pad: &gst::Pad, imp: &Self::ElementImpl, event: gst::Event) -> bool {
|
fn sink_event(self, pad: &gst::Pad, imp: &Self::ElementImpl, event: gst::Event) -> bool {
|
||||||
assert!(!event.is_serialized());
|
assert!(!event.is_serialized());
|
||||||
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", event);
|
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", event);
|
||||||
|
gst::Pad::event_default(pad, Some(imp.obj().as_ref()), event)
|
||||||
let elem = imp.obj();
|
|
||||||
// FIXME with GAT on `Self::ElementImpl`, we should be able to
|
|
||||||
// use `.upcast::<gst::Element>()`
|
|
||||||
//
|
|
||||||
// Safety: `Self::ElementImpl` is bound to `gst::subclass::ElementImpl`.
|
|
||||||
let element = unsafe { elem.unsafe_cast_ref::<gst::Element>() };
|
|
||||||
|
|
||||||
gst::Pad::event_default(pad, Some(element), event)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sink_event_serialized(
|
fn sink_event_serialized(
|
||||||
|
@ -590,16 +564,10 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static {
|
||||||
event: gst::Event,
|
event: gst::Event,
|
||||||
) -> BoxFuture<'static, bool> {
|
) -> BoxFuture<'static, bool> {
|
||||||
assert!(event.is_serialized());
|
assert!(event.is_serialized());
|
||||||
// FIXME with GAT on `Self::ElementImpl`, we should be able to
|
|
||||||
// use `.upcast::<gst::Element>()`
|
|
||||||
//
|
|
||||||
// Safety: `Self::ElementImpl` is bound to `gst::subclass::ElementImpl`.
|
|
||||||
let element = unsafe { elem.unsafe_cast::<gst::Element>() };
|
|
||||||
|
|
||||||
async move {
|
async move {
|
||||||
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", event);
|
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", event);
|
||||||
|
gst::Pad::event_default(&pad, Some(&elem), event)
|
||||||
gst::Pad::event_default(&pad, Some(&element), event)
|
|
||||||
}
|
}
|
||||||
.boxed()
|
.boxed()
|
||||||
}
|
}
|
||||||
|
@ -646,15 +614,7 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static {
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", query);
|
gst::log!(RUNTIME_CAT, obj = pad, "Handling {:?}", query);
|
||||||
|
gst::Pad::query_default(pad, Some(imp.obj().as_ref()), query)
|
||||||
let elem = imp.obj();
|
|
||||||
// FIXME with GAT on `Self::ElementImpl`, we should be able to
|
|
||||||
// use `.upcast::<gst::Element>()`
|
|
||||||
//
|
|
||||||
// Safety: `Self::ElementImpl` is bound to `gst::subclass::ElementImpl`.
|
|
||||||
let element = unsafe { elem.unsafe_cast_ref::<gst::Element>() };
|
|
||||||
|
|
||||||
gst::Pad::query_default(pad, Some(element), query)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue