Bug 204669 - [GStreamer] Simplify GL display/context ref handling
Summary: [GStreamer] Simplify GL display/context ref handling
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 204624
Blocks:
  Show dependency treegraph
 
Reported: 2019-11-28 02:03 PST by Philippe Normand
Modified: 2021-04-14 09:23 PDT (History)
15 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2019-11-28 02:03:29 PST
+++ This bug was initially created as a clone of Bug #204624 +++


> Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:151
> +    // The floating ref removal support was added in https://bugzilla.gnome.org/show_bug.cgi?id=743062.
> +    bool shouldAdoptRef = webkitGstCheckVersion(1, 14, 0);


I think we could simplify the code by adding adoptGLRef() or something like that, similar to ensureGRef, that only accepts GstGLDisplay org GstGLContext and adopts the returned ref or not depending on the GST version.
Comment 1 Philippe Normand 2019-11-28 02:04:10 PST
> Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:252
> +#if GST_CHECK_VERSION(1, 12, 0)
> +        gst_structure_set(structure, "context", GST_TYPE_GL_CONTEXT, priv->glContext.get(), nullptr);
> +#else
> +        gst_structure_set(structure, "context", GST_GL_TYPE_CONTEXT, priv->glContext.get(), nullptr);
> +#endif


Follow up or not, I think we could #define this above and have just one line here.
Comment 2 Philippe Normand 2021-04-14 09:23:25 PDT
Since we now require at least gst 1.14 this is no longer a concern.