Skip to content

Conversation

@lafoletc
Copy link
Contributor

@lafoletc lafoletc commented Jul 8, 2017

No description provided.

@neilcsmith-net neilcsmith-net added this to the 0.9.1 milestone Jul 9, 2017
@neilcsmith-net
Copy link
Member

Thanks! Need to have more of a look at this one. I don't like exposing GType or Pointer in the public facing API. In fact, I'd like to remove or deprecate the ones we have before we release 1.0.

Instead of GType we should be using classes, which would also remove the generics issue. Maybe something based on the existing subtype mappers?

@lafoletc
Copy link
Contributor Author

lafoletc commented Jul 9, 2017

For method Buffer.getMeta(final GType api), gst_buffer_get_meta() need a GType.
We could replace parameter "GType api" by its string and retrieve the GType with GType.valueof(string) but it's not a could idea to deal with string

@lafoletc
Copy link
Contributor Author

lafoletc commented Jul 9, 2017

I have make a try with classes :
For example with
public class VideoMeta extends Meta {
public static final String GTYPE_NAME = "GstVideoMeta";
public static final String GTYPE_API_NAME = "GstVideoMetaAPI";
...
}
We would need to add a second string identifier to specify the api and put in a cache the GType api for this class

@neilcsmith-net
Copy link
Member

Possibly. We might need the caching but not sure we need to expose the GTYPE fields. I've been thinking about mechanisms for type registration so that we allow the library to be extended from outside more easily.

Another option here I guess would be to have a Meta.Type<? extends Meta> class that encapsulates the GType info in a type-safe way.

So that you have

public <T extends Meta> T getMeta(Meta.Type<T> type)

called like

VideoMeta videoMeta = getMeta(VideoMeta.TYPE);

@neilcsmith-net neilcsmith-net modified the milestones: 0.9.1, 1.0.0 Dec 18, 2017
@neilcsmith-net
Copy link
Member

Adding a note that this will also require fixing for the GType size issue before merging.

@neilcsmith-net neilcsmith-net modified the milestones: 1.0, Post 1.0 Mar 1, 2019
@neilcsmith-net neilcsmith-net modified the milestones: 1.1, 1.2 Jun 9, 2019
@neilcsmith-net neilcsmith-net modified the milestones: 1.2, 1.3 Apr 8, 2020
@MaZderMind
Copy link
Contributor

This PR is also lacking some Unit-Tests for the new API.

@neilcsmith-net
Copy link
Member

@MaZderMind yes, the whole thing needs rewriting for post-v1. It's kept open so can discuss or start from scratch on that.

@neilcsmith-net
Copy link
Member

OK, going to close this. Hopefully all functionality here, and more, is covered in #208 . Next step is to add proper wrapper classes for other metas.

@neilcsmith-net neilcsmith-net removed this from the 1.3 milestone Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants