Subclassing GstSystemClock in Rust
Sebastian Dröge
sebastian at centricular.com
Fri Oct 21 18:47:49 UTC 2022
On Fri, 2022-10-21 at 12:30 -0300, Rodrigo Santos via gstreamer-devel
wrote:
> Hey folks, I'm trying to create a CustomClock implementation in Rust
> that is a subclass of GstSystemClock. I found some examples of how
> one can create GstElements in Rust but none explaining how to
> subclass a GstSystemClock.
>
> Is it possible to create a custom clock implementation purely in
> Rust?
>
> The code below is the boilerplate I implemented so far. This code
> doesn't compiler, one of the error messages says:
>
> type ParentType = gst_sys::GstSystemClock;
> | ^^^^^^^^^^^^^^^^^^^^^^^ the trait
> `FromGlibPtrNone<*mut _>` is not implemented for `GstSystemClock`
>
> I'm fairly new to create new GLib types and Gstreamer plugins in
> Rust, what am I missing?
You would use `type ParentType = gst::SystemClock`. The one you
selected there is the plain C type.
In addition to that you'll also have to implement the SystemClockImpl
trait.
Once that is done, I think your code should compile like this unless I
missed something.
--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20221021/95a118e1/attachment-0001.htm>
More information about the gstreamer-devel
mailing list