GstMeta GTypes - API vs implementation?
Neil C Smith
neil at codelerity.com
Thu Oct 8 09:48:15 UTC 2020
On Wed, 7 Oct 2020 at 21:28, Sebastian Dröge <sebastian at centricular.com> wrote:
>
> On Wed, 2020-10-07 at 15:59 +0100, Neil C Smith wrote:
> > That's a sort of pattern we could work with, as long as it's
> > guaranteed to hold in all cases?
>
> Maybe not. The current API in the Rust bindings is based on how the C
> API is used in practice everywhere, not on how it could in theory be
> used as that would complicate everything considerably and I don't see
> it happening that someone ever actually makes use of that in the
> future. If I'm wrong then it's not much of a problem and the API can be
> updated :)
Thanks Sebastian! Yes, I think we're in the same position then. I
assumed this was the case before initiating this thread, but wanted to
check I wasn't missing somewhere that theory had been put into
practice! :-)
> The reason for the split between two GTypes for the meta was (IIRC) to
> be able to have some kind of inheritance. You could have one meta that
> *also* implements another API, like a GstVideoMeta2 that is compatible
> with GstVideoMeta. I don't see how this can be possible with the
> current implementation in C and how it can be introduced at this point
> without breaking a lot of code, so I'm not really worrying about that.
Good to know. I assumed that was the reason, but curious that it was
done (or had to be done) in a way that isn't introspectable via the
type system (as far as I can tell).
> For all practical purposes, there are two GTypes for every meta, and
> the reason for making that the API one in the Rust bindings is that
> this is what e.g. gst_buffer_iterate_meta_filtered() works with.
Yes, we'll do similar - live and die on the same sword! :-)
Many thanks for both of your inputs.
Best wishes,
Neil
--
Neil C Smith
Codelerity Ltd.
www.codelerity.com
Codelerity Ltd. is a company registered in England and Wales
Registered company number : 12063669
Registered office address : Office 4 219 Kensington High Street,
Kensington, London, England, W8 6BD
More information about the gstreamer-devel
mailing list