mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
glutils: expose running a query on a set of src/sink pads
This commit is contained in:
parent
f9ac4984eb
commit
6d4cca89ef
2 changed files with 9 additions and 7 deletions
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue