Hi everyone,
It seems the Event (org.freedesktop.gstreamer.event.Event) constructor went package visible and it is not possible to extend that class and create a CustomEvent.
I am using the following API call in my CustomEvent constructor (from GstEventAPI):
Event gst_event_new_custom(EventType type, @Invalidate Structure structure);
public CustomEvent(Structure structure, EventType eventType)
{
super(Natives.initializer(gst.ptr_gst_event_new_custom(eventType, structure), false, true));
this.structure = structure;
}
and this CustomEvent is an Event:
public class CustomEvent extends Event
The problem here is I can't access the constructor of Event.java because it is package visible. All the other events defined in there have access to it and can pass an Initializer to parent Event constructor without an issue.
I have seen the following release note from Neil which hints that there might be a way of achieving this but I did not get it.
"- New extension mechanism to register additional `NativeObject`
subclasses (it was theoretically possible to achieve this before, but
with major caveats and unsupported). See
`NativeObject.TypeRegistration` and `Natives.registration(..)`.
Instances of `NativeObject.TypeProvider` should be made available by
the standard Java `ServiceLoader` mechanism. Internal types use the
same mechanism, reducing uses of reflection in the library"
Any suggestions are welcome here. Right now I just downloaded to source and made the visibility "protected" and linked this modified gst-java-core. Testing this way I can see that CustomEvent works but I prefer to use the library as it is if that is possible.