gl: advertise GstGLMemory usage in the caps as capsfeatures
authorMatthew Waters <ystreet00@gmail.com>
Wed, 7 May 2014 11:45:53 +0000 (21:45 +1000)
committerMatthew Waters <ystreet00@gmail.com>
Wed, 7 May 2014 11:48:57 +0000 (21:48 +1000)
https://bugzilla.gnome.org/show_bug.cgi?id=729658

ext/gl/gstglimagesink.c
ext/gl/gstgltestsrc.c
gst-libs/gst/gl/gstglfilter.c
gst-libs/gst/gl/gstglmemory.h
gst-libs/gst/gl/gstglmixer.c

index 1cd5c5eaaf7edd5bd7d46297911a6c144b7c541f..458bf00246c350de6bc1311a1def8c4811080349 100644 (file)
@@ -151,7 +151,9 @@ static GstStaticPadTemplate gst_glimage_sink_template =
     GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+        (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
+            "RGBA") "; "
 #if GST_GL_HAVE_PLATFORM_EGL
         GST_VIDEO_CAPS_MAKE_WITH_FEATURES
         (GST_CAPS_FEATURE_MEMORY_EGL_IMAGE, "RGBA") "; "
index b7b2792a8e9e8a2c52fb82a008446754f254b9bb..9926e595fffbdf839736f385d409dff585fcc665 100644 (file)
 #include "gltestsrc.h"
 #include <gst/gst-i18n-plugin.h>
 
+#if GST_GL_HAVE_PLATFORM_EGL
+#include <gst/gl/egl/gsteglimagememory.h>
+#endif
+
 #define USE_PEER_BUFFERALLOC
 
 GST_DEBUG_CATEGORY_STATIC (gl_test_src_debug);
@@ -61,6 +65,21 @@ enum
       /* FILL ME */
 };
 
+static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
+    GST_PAD_SRC,
+    GST_PAD_ALWAYS,
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+        (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
+            "RGBA") "; "
+#if GST_GL_HAVE_PLATFORM_EGL
+        GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_EGL_IMAGE,
+            "RGBA") "; "
+#endif
+        GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+        (GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META,
+            "RGBA") "; " GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS))
+    );
+
 #define gst_gl_test_src_parent_class parent_class
 G_DEFINE_TYPE (GstGLTestSrc, gst_gl_test_src, GST_TYPE_PUSH_SRC);
 
@@ -159,8 +178,7 @@ gst_gl_test_src_class_init (GstGLTestSrcClass * klass)
       "David A. Schleef <ds@schleef.org>");
 
   gst_element_class_add_pad_template (element_class,
-      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
-          gst_caps_from_string (GST_GL_COLOR_CONVERT_VIDEO_CAPS)));
+      gst_static_pad_template_get (&src_factory));
 
   element_class->set_context = gst_gl_test_src_set_context;
 
index 48748515707049dbc846615236c362b2c2661a0f..e40679cdde3093d874f7e6b1b07f513a6339a32a 100644 (file)
@@ -38,7 +38,9 @@ static GstStaticPadTemplate gst_gl_filter_src_pad_template =
     GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+        (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
+            "RGBA") "; "
 #if GST_GL_HAVE_PLATFORM_EGL
         GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_EGL_IMAGE,
             "RGBA") "; "
@@ -52,7 +54,9 @@ static GstStaticPadTemplate gst_gl_filter_sink_pad_template =
     GST_STATIC_PAD_TEMPLATE ("sink",
     GST_PAD_SINK,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+        (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
+            "RGBA") "; "
 #if GST_GL_HAVE_PLATFORM_EGL
         GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_EGL_IMAGE,
             "RGBA") "; "
index 559e62d8272bf269240e0d39441860eb0bb0b072..535bea79b95ce881d545699861d54bc96c9285a7 100644 (file)
@@ -104,6 +104,8 @@ struct _GstGLMemory
   gpointer              _gst_reserved[GST_PADDING];
 };
 
+#define GST_CAPS_FEATURE_MEMORY_GL_MEMORY "memory:GLMemory"
+
 /**
  * GST_GL_MEMORY_ALLOCATOR:
  *
index 238f4e1030dd426833335b5fe07bacb66225ac24..40dcad5426462e0b831fefb30394d5f53b4ae4bb 100644 (file)
@@ -533,19 +533,25 @@ enum
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS) "; "
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+        (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
+            "RGBA") "; "
         GST_VIDEO_CAPS_MAKE_WITH_FEATURES
         (GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META,
-            "RGBA"))
+            "RGBA")
+        "; " GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS))
     );
 
 static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%d",
     GST_PAD_SINK,
     GST_PAD_REQUEST,
-    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS) "; "
+    GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
+        (GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
+            "RGBA") "; "
         GST_VIDEO_CAPS_MAKE_WITH_FEATURES
         (GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META,
-            "RGBA"))
+            "RGBA")
+        "; " GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS))
     );
 
 static gboolean gst_gl_mixer_src_query (GstPad * pad, GstObject * object,