From 41e3b3286672bec4203b44fb8156d6e507828435 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 11 Feb 2015 01:27:28 +1100 Subject: [PATCH] glutils: expose running a query on a set of src/sink pads --- gst-libs/gst/gl/gstglutils.c | 14 +++++++------- gst-libs/gst/gl/gstglutils.h | 2 ++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index b021abf1ce..0569fa2ffd 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -487,7 +487,7 @@ gst_gl_display_found (GstElement * element, GstGLDisplay * display) GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT); static gboolean -context_pad_query (const GValue * item, GValue * value, gpointer user_data) +pad_query (const GValue * item, GValue * value, gpointer user_data) { GstPad *pad = g_value_get_object (item); GstQuery *query = user_data; @@ -500,16 +500,16 @@ context_pad_query (const GValue * item, GValue * value, gpointer user_data) return FALSE; } - GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, pad, "context pad peer query failed"); + GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, pad, "pad peer query failed"); return TRUE; } -static gboolean -run_context_query (GstElement * element, GstQuery * query, +gboolean +gst_gl_run_query (GstElement * element, GstQuery * query, GstPadDirection direction) { GstIterator *it; - GstIteratorFoldFunction func = context_pad_query; + GstIteratorFoldFunction func = pad_query; GValue res = { 0 }; g_value_init (&res, G_TYPE_BOOLEAN); @@ -541,11 +541,11 @@ _gst_context_query (GstElement * element, * 2b) Query upstream as above. */ query = gst_query_new_context (display_type); - if (run_context_query (element, query, GST_PAD_SRC)) { + if (gst_gl_run_query (element, query, GST_PAD_SRC)) { gst_query_parse_context (query, &ctxt); GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element, "found context (%p) in downstream query", ctxt); - } else if (run_context_query (element, query, GST_PAD_SINK)) { + } else if (gst_gl_run_query (element, query, GST_PAD_SINK)) { gst_query_parse_context (query, &ctxt); GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element, "found context (%p) in upstream query", ctxt); diff --git a/gst-libs/gst/gl/gstglutils.h b/gst-libs/gst/gl/gstglutils.h index 867887e5ca..c915bfb6fe 100644 --- a/gst-libs/gst/gl/gstglutils.h +++ b/gst-libs/gst/gl/gstglutils.h @@ -99,6 +99,8 @@ gboolean gst_gl_handle_set_context (GstElement * element, GstContext * context, gboolean gst_gl_handle_context_query (GstElement * element, GstQuery * query, GstGLDisplay ** display, GstGLContext ** other_context); +gboolean gst_gl_run_query (GstElement * element, + GstQuery * query, GstPadDirection direction); gsize gst_gl_get_plane_data_size (GstVideoInfo * info, GstVideoAlignment * align, guint plane); GstCaps * gst_gl_caps_replace_all_caps_features (const GstCaps * caps,