mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 01:54:17 +00:00
gl: silence a critical if upstream does not provide us with meta params
This commit is contained in:
parent
19d138601b
commit
a9070713a2
3 changed files with 69 additions and 63 deletions
|
@ -627,32 +627,34 @@ gst_gl_test_src_decide_allocation (GstBaseSrc * basesrc, GstQuery * query)
|
||||||
gchar *apis;
|
gchar *apis;
|
||||||
|
|
||||||
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
||||||
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
if (upload_meta_params) {
|
||||||
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
||||||
GstGLContext *old = src->context;
|
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
||||||
|
GstGLContext *old = src->context;
|
||||||
|
|
||||||
src->context = context;
|
src->context = context;
|
||||||
if (old)
|
if (old)
|
||||||
gst_object_unref (old);
|
gst_object_unref (old);
|
||||||
} else if (gst_structure_get (upload_meta_params, "gst.gl.context.handle",
|
} else if (gst_structure_get (upload_meta_params, "gst.gl.context.handle",
|
||||||
G_TYPE_POINTER, &handle, "gst.gl.context.type", G_TYPE_STRING,
|
G_TYPE_POINTER, &handle, "gst.gl.context.type", G_TYPE_STRING,
|
||||||
&type, "gst.gl.context.apis", G_TYPE_STRING, &apis, NULL)
|
&type, "gst.gl.context.apis", G_TYPE_STRING, &apis, NULL)
|
||||||
&& handle) {
|
&& handle) {
|
||||||
GstGLPlatform platform = GST_GL_PLATFORM_NONE;
|
GstGLPlatform platform = GST_GL_PLATFORM_NONE;
|
||||||
GstGLAPI gl_apis;
|
GstGLAPI gl_apis;
|
||||||
|
|
||||||
GST_DEBUG ("got GL context handle 0x%p with type %s and apis %s", handle,
|
GST_DEBUG ("got GL context handle 0x%p with type %s and apis %s",
|
||||||
type, apis);
|
handle, type, apis);
|
||||||
|
|
||||||
if (g_strcmp0 (type, "glx") == 0)
|
if (g_strcmp0 (type, "glx") == 0)
|
||||||
platform = GST_GL_PLATFORM_GLX;
|
platform = GST_GL_PLATFORM_GLX;
|
||||||
|
|
||||||
gl_apis = gst_gl_api_from_string (apis);
|
gl_apis = gst_gl_api_from_string (apis);
|
||||||
|
|
||||||
if (gl_apis && platform)
|
if (gl_apis && platform)
|
||||||
other_context =
|
other_context =
|
||||||
gst_gl_context_new_wrapped (src->display, (guintptr) handle,
|
gst_gl_context_new_wrapped (src->display, (guintptr) handle,
|
||||||
platform, gl_apis);
|
platform, gl_apis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -883,32 +883,34 @@ gst_gl_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
|
||||||
gchar *apis;
|
gchar *apis;
|
||||||
|
|
||||||
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
||||||
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
if (upload_meta_params) {
|
||||||
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
||||||
GstGLContext *old = filter->context;
|
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
||||||
|
GstGLContext *old = filter->context;
|
||||||
|
|
||||||
filter->context = context;
|
filter->context = context;
|
||||||
if (old)
|
if (old)
|
||||||
gst_object_unref (old);
|
gst_object_unref (old);
|
||||||
} else if (gst_structure_get (upload_meta_params, "gst.gl.context.handle",
|
} else if (gst_structure_get (upload_meta_params, "gst.gl.context.handle",
|
||||||
G_TYPE_POINTER, &handle, "gst.gl.context.type", G_TYPE_STRING,
|
G_TYPE_POINTER, &handle, "gst.gl.context.type", G_TYPE_STRING,
|
||||||
&type, "gst.gl.context.apis", G_TYPE_STRING, &apis, NULL)
|
&type, "gst.gl.context.apis", G_TYPE_STRING, &apis, NULL)
|
||||||
&& handle) {
|
&& handle) {
|
||||||
GstGLPlatform platform = GST_GL_PLATFORM_NONE;
|
GstGLPlatform platform = GST_GL_PLATFORM_NONE;
|
||||||
GstGLAPI gl_apis;
|
GstGLAPI gl_apis;
|
||||||
|
|
||||||
GST_DEBUG ("got GL context handle 0x%p with type %s and apis %s", handle,
|
GST_DEBUG ("got GL context handle 0x%p with type %s and apis %s",
|
||||||
type, apis);
|
handle, type, apis);
|
||||||
|
|
||||||
if (g_strcmp0 (type, "glx") == 0)
|
if (g_strcmp0 (type, "glx") == 0)
|
||||||
platform = GST_GL_PLATFORM_GLX;
|
platform = GST_GL_PLATFORM_GLX;
|
||||||
|
|
||||||
gl_apis = gst_gl_api_from_string (apis);
|
gl_apis = gst_gl_api_from_string (apis);
|
||||||
|
|
||||||
if (gl_apis && platform)
|
if (gl_apis && platform)
|
||||||
other_context =
|
other_context =
|
||||||
gst_gl_context_new_wrapped (filter->display, (guintptr) handle,
|
gst_gl_context_new_wrapped (filter->display, (guintptr) handle,
|
||||||
platform, gl_apis);
|
platform, gl_apis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1117,32 +1117,34 @@ gst_gl_mixer_decide_allocation (GstGLMixer * mix, GstQuery * query)
|
||||||
gchar *apis;
|
gchar *apis;
|
||||||
|
|
||||||
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
||||||
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
if (upload_meta_params) {
|
||||||
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
||||||
GstGLContext *old = mix->context;
|
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
||||||
|
GstGLContext *old = mix->context;
|
||||||
|
|
||||||
mix->context = context;
|
mix->context = context;
|
||||||
if (old)
|
if (old)
|
||||||
gst_object_unref (old);
|
gst_object_unref (old);
|
||||||
} else if (gst_structure_get (upload_meta_params, "gst.gl.context.handle",
|
} else if (gst_structure_get (upload_meta_params, "gst.gl.context.handle",
|
||||||
G_TYPE_POINTER, &handle, "gst.gl.context.type", G_TYPE_STRING,
|
G_TYPE_POINTER, &handle, "gst.gl.context.type", G_TYPE_STRING,
|
||||||
&type, "gst.gl.context.apis", G_TYPE_STRING, &apis, NULL)
|
&type, "gst.gl.context.apis", G_TYPE_STRING, &apis, NULL)
|
||||||
&& handle) {
|
&& handle) {
|
||||||
GstGLPlatform platform = GST_GL_PLATFORM_NONE;
|
GstGLPlatform platform = GST_GL_PLATFORM_NONE;
|
||||||
GstGLAPI gl_apis;
|
GstGLAPI gl_apis;
|
||||||
|
|
||||||
GST_DEBUG ("got GL context handle 0x%p with type %s and apis %s", handle,
|
GST_DEBUG ("got GL context handle 0x%p with type %s and apis %s",
|
||||||
type, apis);
|
handle, type, apis);
|
||||||
|
|
||||||
if (g_strcmp0 (type, "glx") == 0)
|
if (g_strcmp0 (type, "glx") == 0)
|
||||||
platform = GST_GL_PLATFORM_GLX;
|
platform = GST_GL_PLATFORM_GLX;
|
||||||
|
|
||||||
gl_apis = gst_gl_api_from_string (apis);
|
gl_apis = gst_gl_api_from_string (apis);
|
||||||
|
|
||||||
if (gl_apis && platform)
|
if (gl_apis && platform)
|
||||||
other_context =
|
other_context =
|
||||||
gst_gl_context_new_wrapped (mix->display, (guintptr) handle,
|
gst_gl_context_new_wrapped (mix->display, (guintptr) handle,
|
||||||
platform, gl_apis);
|
platform, gl_apis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue