diff options
author | Matthew Waters <ystreet00@gmail.com> | 2014-06-25 21:50:40 +1000 |
---|---|---|
committer | Matthew Waters <ystreet00@gmail.com> | 2014-06-25 21:50:40 +1000 |
commit | a2bd2ce83b68202feb3f6fc243044f726706dc44 (patch) | |
tree | 8691a2ef9343314824970b9651047e327553121d | |
parent | 7797b15de75c815c0a95a8892779485607622b7c (diff) | |
download | gstreamer-plugins-bad-a2bd2ce83b68202feb3f6fc243044f726706dc44.tar.gz |
glfilter: prefer passthrough for non-sysmem caps
-rw-r--r-- | gst-libs/gst/gl/gstglfilter.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 2523bfe9e..6a1ab22bd 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -728,25 +728,26 @@ gst_gl_filter_transform_caps (GstBaseTransform * bt, { GstCaps *tmp = NULL; GstCaps *result = NULL; - - tmp = gst_caps_new_empty (); - - if (direction == GST_PAD_SINK) { - GstCaps *glcaps = gst_gl_filter_set_caps_features (caps, - GST_CAPS_FEATURE_MEMORY_GL_MEMORY); + GstCaps *glcaps = gst_gl_filter_set_caps_features (caps, + GST_CAPS_FEATURE_MEMORY_GL_MEMORY); #if GST_GL_HAVE_PLATFORM_EGL - GstCaps *eglcaps = gst_gl_filter_set_caps_features (caps, - GST_CAPS_FEATURE_MEMORY_EGL_IMAGE); + GstCaps *eglcaps = gst_gl_filter_set_caps_features (caps, + GST_CAPS_FEATURE_MEMORY_EGL_IMAGE); #endif - GstCaps *uploadcaps = gst_gl_filter_set_caps_features (caps, - GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META); + GstCaps *uploadcaps = gst_gl_filter_set_caps_features (caps, + GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META); + GstCaps *raw_caps = + gst_caps_from_string (GST_VIDEO_CAPS_MAKE (GST_GL_COLOR_CONVERT_FORMATS)); + GstCapsFeatures *f; - tmp = gst_caps_merge (tmp, glcaps); + tmp = gst_caps_new_empty (); + + tmp = gst_caps_merge (tmp, glcaps); #if GST_GL_HAVE_PLATFORM_EGL - tmp = gst_caps_merge (tmp, eglcaps); + tmp = gst_caps_merge (tmp, eglcaps); #endif - tmp = gst_caps_merge (tmp, uploadcaps); - } + tmp = gst_caps_merge (tmp, uploadcaps); + tmp = gst_caps_merge (tmp, raw_caps); tmp = gst_caps_merge (tmp, gst_gl_filter_caps_remove_format_info (caps)); @@ -758,7 +759,11 @@ gst_gl_filter_transform_caps (GstBaseTransform * bt, } /* if output still intersects input then prefer the intersection */ - if (direction == GST_PAD_SINK) { + f = gst_caps_get_features (caps, 0); + + if (!gst_caps_features_is_any (f) + && !gst_caps_features_is_equal (f, + GST_CAPS_FEATURES_MEMORY_SYSTEM_MEMORY)) { tmp = gst_caps_intersect_full (result, caps, GST_CAPS_INTERSECT_FIRST); result = gst_caps_merge (tmp, result); } |