From: Matthew Waters Date: Wed, 7 May 2014 11:45:53 +0000 (+1000) Subject: gl: advertise GstGLMemory usage in the caps as capsfeatures X-Git-Tag: 1.19.3~507^2~11180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a27589629d593972cd3c1c1f249c6d7c49ffdd53;p=platform%2Fupstream%2Fgstreamer.git gl: advertise GstGLMemory usage in the caps as capsfeatures https://bugzilla.gnome.org/show_bug.cgi?id=729658 --- diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 1cd5c5eaaf..458bf00246 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -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") "; " diff --git a/ext/gl/gstgltestsrc.c b/ext/gl/gstgltestsrc.c index b7b2792a8e..9926e595ff 100644 --- a/ext/gl/gstgltestsrc.c +++ b/ext/gl/gstgltestsrc.c @@ -47,6 +47,10 @@ #include "gltestsrc.h" #include +#if GST_GL_HAVE_PLATFORM_EGL +#include +#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 "); 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; diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 4874851570..e40679cdde 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -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") "; " diff --git a/gst-libs/gst/gl/gstglmemory.h b/gst-libs/gst/gl/gstglmemory.h index 559e62d827..535bea79b9 100644 --- a/gst-libs/gst/gl/gstglmemory.h +++ b/gst-libs/gst/gl/gstglmemory.h @@ -104,6 +104,8 @@ struct _GstGLMemory gpointer _gst_reserved[GST_PADDING]; }; +#define GST_CAPS_FEATURE_MEMORY_GL_MEMORY "memory:GLMemory" + /** * GST_GL_MEMORY_ALLOCATOR: * diff --git a/gst-libs/gst/gl/gstglmixer.c b/gst-libs/gst/gl/gstglmixer.c index 238f4e1030..40dcad5426 100644 --- a/gst-libs/gst/gl/gstglmixer.c +++ b/gst-libs/gst/gl/gstglmixer.c @@ -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,