diff options
author | Matthew Waters <matthew@centricular.com> | 2016-03-17 01:52:00 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2016-03-17 02:37:21 +1100 |
commit | 200767ba0eeca9b81ec0341ce477ea19b837f46b (patch) | |
tree | 1872bc47528c4f15c9b79dfcf7eb98b5cd7268c3 /gst-libs | |
parent | 993ec87ae6f19f189938bc7cd97a928fec70a2f8 (diff) | |
download | gstreamer-plugins-bad-200767ba0eeca9b81ec0341ce477ea19b837f46b.tar.gz |
glfilter: only allow the same src/sink caps when we are in passthrough mode
If we are given caps with extra features (like the overlay composition
features), we can only deal with that when we are in passthrough mode.
Previously we were bailing entirely and not allowing passthrough filter elements
with things like textoverlay.
Fixes the following pipeline (assuming glfilter supports passthrough):
gl ! textoverlay ! glfilter ! ... ! glimagesinkelement
https://bugzilla.gnome.org/show_bug.cgi?id=763756
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/gl/gstglfilter.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 1e18e410e..d25bb7298 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -45,6 +45,12 @@ GST_STATIC_PAD_TEMPLATE ("src", "width = " GST_VIDEO_SIZE_RANGE ", " "height = " GST_VIDEO_SIZE_RANGE ", " "framerate = " GST_VIDEO_FPS_RANGE "," + "texture-target = (string) 2D ; " + "video/x-raw(ANY), " + "format = (string) RGBA, " + "width = " GST_VIDEO_SIZE_RANGE ", " + "height = " GST_VIDEO_SIZE_RANGE ", " + "framerate = " GST_VIDEO_FPS_RANGE "," "texture-target = (string) 2D" )); @@ -52,7 +58,13 @@ static GstStaticPadTemplate gst_gl_filter_sink_pad_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), " + GST_STATIC_CAPS ("video/x-raw(ANY), " + "format = (string) RGBA, " + "width = " GST_VIDEO_SIZE_RANGE ", " + "height = " GST_VIDEO_SIZE_RANGE ", " + "framerate = " GST_VIDEO_FPS_RANGE "," + "texture-target = (string) 2D ; " + "video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), " "format = (string) RGBA, " "width = " GST_VIDEO_SIZE_RANGE ", " "height = " GST_VIDEO_SIZE_RANGE ", " @@ -70,8 +82,7 @@ enum #define gst_gl_filter_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilter, gst_gl_filter, GST_TYPE_GL_BASE_FILTER, GST_DEBUG_CATEGORY_INIT (gst_gl_filter_debug, "glfilter", 0, - "glfilter element"); - ); + "glfilter element");); static void gst_gl_filter_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -631,13 +642,18 @@ gst_gl_filter_transform_caps (GstBaseTransform * bt, GstCaps *tmp = NULL; GstCaps *result = NULL; - tmp = GST_GL_FILTER_GET_CLASS (filter)->transform_internal_caps (filter, - direction, caps, NULL); + if (gst_base_transform_is_passthrough (bt)) { + tmp = gst_caps_ref (caps); + } else { + tmp = GST_GL_FILTER_GET_CLASS (filter)->transform_internal_caps (filter, + direction, caps, NULL); - result = - gst_gl_filter_set_caps_features (tmp, GST_CAPS_FEATURE_MEMORY_GL_MEMORY); - gst_caps_unref (tmp); - tmp = result; + result = + gst_gl_filter_set_caps_features (tmp, + GST_CAPS_FEATURE_MEMORY_GL_MEMORY); + gst_caps_unref (tmp); + tmp = result; + } if (filter_caps) { result = |