summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2017-01-13 12:49:37 +1100
committerMatthew Waters <matthew@centricular.com>2017-01-13 13:01:28 +1100
commit03b539bdfc2645d570db82e9d9717c4a0ffd5f0f (patch)
tree843dd89f9a4bbfae017c419322c2181551c8afdb
parentfb5339a3872a2159afd9e02a7dc4e71c2c1a34eb (diff)
downloadgstreamer-plugins-bad-03b539bdfc2645d570db82e9d9717c4a0ffd5f0f.tar.gz
gl: update sys dependants for function removals
4315a4b54d9 forgot to change the androidmedia/videotoolbox/caopengllayer sources as required.
-rw-r--r--ext/gl/caopengllayersink.m39
-rw-r--r--gst-libs/gst/gl/Makefile.am1
-rw-r--r--sys/androidmedia/gstamcvideodec.c66
-rw-r--r--sys/applemedia/glcontexthelper.c26
4 files changed, 14 insertions, 118 deletions
diff --git a/ext/gl/caopengllayersink.m b/ext/gl/caopengllayersink.m
index a0c6e5789..851a4e0b2 100644
--- a/ext/gl/caopengllayersink.m
+++ b/ext/gl/caopengllayersink.m
@@ -387,41 +387,10 @@ gst_ca_opengl_layer_sink_query (GstBaseSink * bsink, GstQuery * query)
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CONTEXT:
{
- const gchar *context_type;
- GstContext *context, *old_context;
- gboolean ret;
-
- ret =
- gst_gl_handle_context_query ((GstElement *) ca_sink, query,
- &ca_sink->display, &ca_sink->other_context);
- if (ca_sink->display)
- gst_gl_display_filter_gl_api (ca_sink->display, SUPPORTED_GL_APIS);
-
- gst_query_parse_context_type (query, &context_type);
-
- if (g_strcmp0 (context_type, "gst.gl.local_context") == 0) {
- GstStructure *s;
-
- gst_query_parse_context (query, &old_context);
-
- if (old_context)
- context = gst_context_copy (old_context);
- else
- context = gst_context_new ("gst.gl.local_context", FALSE);
-
- s = gst_context_writable_structure (context);
- gst_structure_set (s, "context", GST_TYPE_GL_CONTEXT,
- ca_sink->context, NULL);
- gst_query_set_context (query, context);
- gst_context_unref (context);
-
- ret = ca_sink->context != NULL;
- }
- GST_DEBUG_OBJECT (ca_sink, "context query of type %s %i",
- context_type, ret);
-
- if (ret)
- return ret;
+ if (gst_gl_handle_context_query ((GstElement *) ca_sink, query,
+ ca_sink->display, ca_sink->context, ca_sink->other_context))
+ return TRUE;
+ break;
}
case GST_QUERY_DRAIN:
{
diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
index 6e4b62bb8..9b21785dd 100644
--- a/gst-libs/gst/gl/Makefile.am
+++ b/gst-libs/gst/gl/Makefile.am
@@ -71,6 +71,7 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \
noinst_HEADERS = \
gstglfeature_private.h \
gstglsl_private.h \
+ gstglutils_private.h \
utils/opengl_versions.h \
utils/gles_versions.h
diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
index 21a1958ee..e3c32a903 100644
--- a/sys/androidmedia/gstamcvideodec.c
+++ b/sys/androidmedia/gstamcvideodec.c
@@ -1032,8 +1032,8 @@ _gl_sync_render_unlocked (struct gl_sync *sync)
if (!af_meta) {
GST_WARNING ("Failed to retreive the transformation meta from the "
"gl_sync %p buffer %p", sync, sync->buffer);
- } else if (gst_amc_surface_texture_get_transform_matrix (sync->
- surface->texture, matrix, &error)) {
+ } else if (gst_amc_surface_texture_get_transform_matrix (sync->surface->
+ texture, matrix, &error)) {
gst_video_affine_transformation_meta_apply_matrix (af_meta, matrix);
gst_video_affine_transformation_meta_apply_matrix (af_meta, yflip_matrix);
@@ -2406,42 +2406,12 @@ gst_amc_video_dec_drain (GstAmcVideoDec * self)
static gboolean
gst_amc_video_dec_src_query (GstVideoDecoder * bdec, GstQuery * query)
{
- GstAmcVideoDec *self = GST_AMC_VIDEO_DEC (bdec);
- gboolean ret;
-
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CONTEXT:
{
- const gchar *context_type;
- GstContext *context, *old_context;
-
- ret = gst_gl_handle_context_query ((GstElement *) self, query,
- &self->gl_display, &self->other_gl_context);
- gst_query_parse_context_type (query, &context_type);
-
- if (g_strcmp0 (context_type, "gst.gl.local_context") == 0) {
- GstStructure *s;
-
- gst_query_parse_context (query, &old_context);
-
- if (old_context)
- context = gst_context_copy (old_context);
- else
- context = gst_context_new ("gst.gl.local_context", FALSE);
-
- s = gst_context_writable_structure (context);
- gst_structure_set (s, "context", GST_TYPE_GL_CONTEXT, self->gl_context,
- NULL);
- gst_query_set_context (query, context);
- gst_context_unref (context);
-
- ret = self->gl_context != NULL;
- }
- GST_LOG_OBJECT (self, "context query of type %s %i", context_type, ret);
-
- if (ret)
- return ret;
-
+ if (gst_gl_handle_context_query ((GstElement *) self, query,
+ self->gl_display, self->gl_context, self->other_gl_context))
+ return TRUE;
break;
}
default:
@@ -2476,31 +2446,9 @@ _caps_are_rgba_with_gl_memory (GstCaps * caps)
static gboolean
_find_local_gl_context (GstAmcVideoDec * self)
{
- GstQuery *query;
- GstContext *context;
- const GstStructure *s;
-
- if (self->gl_context)
- return TRUE;
-
- query = gst_query_new_context ("gst.gl.local_context");
- if (!self->gl_context
- && gst_gl_run_query (GST_ELEMENT (self), query, GST_PAD_SRC)) {
- gst_query_parse_context (query, &context);
- if (context) {
- s = gst_context_get_structure (context);
- gst_structure_get (s, "context", GST_TYPE_GL_CONTEXT, &self->gl_context,
- NULL);
- }
- }
-
- GST_DEBUG_OBJECT (self, "found local context %p", self->gl_context);
-
- gst_query_unref (query);
-
- if (self->gl_context)
+ if (gst_gl_query_local_gl_context (GST_ELEMENT (self), GST_PAD_SRC,
+ &self->gl_context))
return TRUE;
-
return FALSE;
}
diff --git a/sys/applemedia/glcontexthelper.c b/sys/applemedia/glcontexthelper.c
index 044f04234..c6940d462 100644
--- a/sys/applemedia/glcontexthelper.c
+++ b/sys/applemedia/glcontexthelper.c
@@ -22,32 +22,10 @@
static GstGLContext *
_find_local_gl_context (GstGLContextHelper * ctxh)
{
- GstQuery *query;
- GstContext *context;
GstGLContext *gl_context = NULL;
- const GstStructure *s;
- g_return_val_if_fail (ctxh != NULL, FALSE);
-
- query = gst_query_new_context ("gst.gl.local_context");
- if (gst_gl_run_query (ctxh->element, query, GST_PAD_SRC)) {
- gst_query_parse_context (query, &context);
- if (context) {
- s = gst_context_get_structure (context);
- gst_structure_get (s, "context", GST_TYPE_GL_CONTEXT, &gl_context, NULL);
- }
- }
- if (!gl_context && gst_gl_run_query (ctxh->element, query, GST_PAD_SINK)) {
- gst_query_parse_context (query, &context);
- if (context) {
- s = gst_context_get_structure (context);
- gst_structure_get (s, "context", GST_TYPE_GL_CONTEXT, &gl_context, NULL);
- }
- }
-
- GST_DEBUG_OBJECT (ctxh->element, "found local context %p", gl_context);
-
- gst_query_unref (query);
+ gst_gl_query_local_gl_context (GST_ELEMENT (ctxh->element), GST_PAD_SRC,
+ &gl_context);
return gl_context;
}