Constructors in abstract classes should be static methods rather than unusable constructors #184

Closed
opened 2025-01-09 21:31:53 +01:00 by BwackNinja · 0 comments
BwackNinja commented 2025-01-09 21:31:53 +01:00 (Migrated from github.com)

In GstGL, GLContext is abstract and has a constructor new that takes a GLDisplay, calling gst_gl_context_new. That can't be used since the class is abstract. The other constructor new_wrapped calls gst_gl_context_new_wrapped and instead is a static method so that constructor is usable.

I've worked around it by modifying the bindings so GLContext isn't abstract, but it would be nice if this was handled automatically.

In `GstGL`, `GLContext` is abstract and has a constructor `new` that takes a `GLDisplay`, calling `gst_gl_context_new`. That can't be used since the class is abstract. The other constructor `new_wrapped` calls `gst_gl_context_new_wrapped` and instead is a static method so that constructor is usable. I've worked around it by modifying the bindings so `GLContext` isn't abstract, but it would be nice if this was handled automatically.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
java-gi/java-gi#184
No description provided.