From 3fba2909799ab48fa53ec721b4b3291fecf55357 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 12 Jan 2017 01:57:29 +1100 Subject: [PATCH] glutils: remove trivial helper function gst_gl_caps_replace_all_caps_features() is only used in two places and can be trivially reproduced. --- docs/libs/gst-plugins-bad-libs-sections.txt | 1 - ext/gl/gstglmixer.c | 12 +++++++++--- gst-libs/gst/gl/gstglfilter.c | 10 +++++++++- gst-libs/gst/gl/gstglutils.c | 16 ---------------- gst-libs/gst/gl/gstglutils.h | 3 --- 5 files changed, 18 insertions(+), 24 deletions(-) diff --git a/docs/libs/gst-plugins-bad-libs-sections.txt b/docs/libs/gst-plugins-bad-libs-sections.txt index 00c2057af8..d19b4363b7 100644 --- a/docs/libs/gst-plugins-bad-libs-sections.txt +++ b/docs/libs/gst-plugins-bad-libs-sections.txt @@ -1618,7 +1618,6 @@ GstGLUploadPrivate gst_gl_handle_set_context gst_gl_handle_context_query gst_gl_context_check_framebuffer_status -gst_gl_caps_replace_all_caps_features gst_gl_ensure_element_data gst_gl_get_plane_data_size gst_gl_get_plane_start diff --git a/ext/gl/gstglmixer.c b/ext/gl/gstglmixer.c index 3fc5aa6f50..9a7446ab0b 100644 --- a/ext/gl/gstglmixer.c +++ b/ext/gl/gstglmixer.c @@ -220,15 +220,21 @@ static GstCaps * _update_caps (GstVideoAggregator * vagg, GstCaps * caps, GstCaps * filter) { GstCaps *tmp; + guint i, n; if (filter) { tmp = gst_caps_intersect (caps, filter); } else { - tmp = caps; + tmp = gst_caps_copy (caps); } - return gst_gl_caps_replace_all_caps_features (tmp, - GST_CAPS_FEATURE_MEMORY_GL_MEMORY); + n = gst_caps_get_size (tmp); + for (i = 0; i < n; i++) { + gst_caps_set_features (tmp, i, + gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); + } + + return tmp; } static GstCaps * diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index f19f8c6bc4..f0c02cf734 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -608,7 +608,15 @@ static GstCaps * gst_gl_filter_set_caps_features (const GstCaps * caps, const gchar * feature_name) { - GstCaps *ret = gst_gl_caps_replace_all_caps_features (caps, feature_name); + GstCaps *ret = gst_caps_copy (caps); + guint n = gst_caps_get_size (ret); + guint i = 0; + + for (i = 0; i < n; i++) { + gst_caps_set_features (ret, i, + gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_GL_MEMORY)); + } + gst_caps_set_simple (ret, "format", G_TYPE_STRING, "RGBA", NULL); return ret; } diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 4dd95c0c6f..0b7d55d305 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -490,22 +490,6 @@ gst_gl_get_plane_start (GstVideoInfo * info, GstVideoAlignment * valign, return (GST_VIDEO_INFO_PLANE_OFFSET (info, plane)) - plane_start; } -GstCaps * -gst_gl_caps_replace_all_caps_features (const GstCaps * caps, - const gchar * feature_name) -{ - GstCaps *tmp = gst_caps_copy (caps); - guint n = gst_caps_get_size (tmp); - guint i = 0; - - for (i = 0; i < n; i++) { - gst_caps_set_features (tmp, i, - gst_caps_features_from_string (feature_name)); - } - - return tmp; -} - /** * gst_gl_value_get_texture_target_mask: * @value: an initialized #GValue of type G_TYPE_STRING diff --git a/gst-libs/gst/gl/gstglutils.h b/gst-libs/gst/gl/gstglutils.h index 5389c71717..942371ebe2 100644 --- a/gst-libs/gst/gl/gstglutils.h +++ b/gst-libs/gst/gl/gstglutils.h @@ -47,9 +47,6 @@ gsize gst_gl_get_plane_data_size (GstVideoInfo * info, GstVideoAlignment * align GST_EXPORT gsize gst_gl_get_plane_start (GstVideoInfo * info, GstVideoAlignment * valign, guint plane); -GST_EXPORT -GstCaps * gst_gl_caps_replace_all_caps_features (const GstCaps * caps, - const gchar * feature_name); GST_EXPORT gboolean gst_gl_value_set_texture_target_from_mask (GValue * value,