mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
glimagesinkbin: Add GstVideoOverlayCompositionMeta caps features
https://bugzilla.gnome.org/show_bug.cgi?id=745107
This commit is contained in:
parent
778ad10518
commit
a7d1b7fcad
5 changed files with 29 additions and 10 deletions
|
@ -55,13 +55,15 @@ static GstStaticPadTemplate gst_gl_color_convert_element_src_pad_template =
|
|||
GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (GST_GL_COLOR_CONVERT_VIDEO_CAPS));
|
||||
GST_STATIC_CAPS (GST_GL_COLOR_CONVERT_VIDEO_CAPS ";"
|
||||
GST_GL_COLOR_CONVERT_VIDEO_OVERLAY_COMPOSITION_CAPS));
|
||||
|
||||
static GstStaticPadTemplate gst_gl_color_convert_element_sink_pad_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (GST_GL_COLOR_CONVERT_VIDEO_CAPS));
|
||||
GST_STATIC_CAPS (GST_GL_COLOR_CONVERT_VIDEO_CAPS ";"
|
||||
GST_GL_COLOR_CONVERT_VIDEO_OVERLAY_COMPOSITION_CAPS));
|
||||
|
||||
static gboolean
|
||||
gst_gl_color_convert_element_stop (GstBaseTransform * bt)
|
||||
|
|
|
@ -322,14 +322,18 @@ static void gst_glimage_sink_handle_events (GstVideoOverlay * overlay,
|
|||
gboolean handle_events);
|
||||
static gboolean update_output_format (GstGLImageSink * glimage_sink);
|
||||
|
||||
#define GST_GL_SINK_CAPS \
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, "RGBA")
|
||||
|
||||
#define GST_GL_SINK_OVERLAY_CAPS \
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY "," \
|
||||
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, "RGBA")
|
||||
|
||||
static GstStaticPadTemplate gst_glimage_sink_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
|
||||
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
|
||||
"RGBA"))
|
||||
);
|
||||
GST_STATIC_CAPS (GST_GL_SINK_CAPS ";" GST_GL_SINK_OVERLAY_CAPS));
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -1047,6 +1051,8 @@ gst_glimage_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
|
|||
result = tmp;
|
||||
}
|
||||
|
||||
result = gst_gl_overlay_compositor_add_caps (result);
|
||||
|
||||
GST_DEBUG_OBJECT (bsink, "returning caps: %" GST_PTR_FORMAT, result);
|
||||
|
||||
return result;
|
||||
|
|
|
@ -731,10 +731,13 @@ gst_gl_color_convert_transform_caps (GstGLContext * convert,
|
|||
(GST_CAPS_FEATURE_MEMORY_GL_MEMORY, GST_GL_COLOR_CONVERT_FORMATS));
|
||||
|
||||
caps = gst_gl_color_convert_caps_remove_format_info (caps);
|
||||
|
||||
result = gst_caps_intersect (caps, templ);
|
||||
gst_caps_unref (caps);
|
||||
gst_caps_unref (templ);
|
||||
|
||||
result = gst_gl_overlay_compositor_add_caps (result);
|
||||
|
||||
if (filter) {
|
||||
GstCaps *tmp;
|
||||
|
||||
|
|
|
@ -98,6 +98,11 @@ struct _GstGLColorConvertClass
|
|||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY, \
|
||||
GST_GL_COLOR_CONVERT_FORMATS)
|
||||
|
||||
#define GST_GL_COLOR_CONVERT_VIDEO_OVERLAY_COMPOSITION_CAPS \
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_GL_MEMORY \
|
||||
"," GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, \
|
||||
GST_GL_COLOR_CONVERT_FORMATS)
|
||||
|
||||
GstGLColorConvert * gst_gl_color_convert_new (GstGLContext * context);
|
||||
|
||||
GstCaps * gst_gl_color_convert_transform_caps (GstGLContext * convert,
|
||||
|
|
|
@ -881,7 +881,7 @@ gst_gl_upload_get_input_template_caps (void)
|
|||
}
|
||||
|
||||
ret = gst_caps_simplify (ret);
|
||||
|
||||
ret = gst_gl_overlay_compositor_add_caps (ret);
|
||||
g_mutex_unlock (&upload_global_lock);
|
||||
|
||||
return ret;
|
||||
|
@ -976,13 +976,16 @@ gst_gl_upload_transform_caps (GstGLContext * context, GstPadDirection direction,
|
|||
tmp = gst_caps_new_empty ();
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (upload_methods); i++) {
|
||||
GstCaps *tmp2 =
|
||||
upload_methods[i]->transform_caps (context, direction, caps);
|
||||
GstCaps *tmp2;
|
||||
|
||||
tmp2 = upload_methods[i]->transform_caps (context, direction, caps);
|
||||
|
||||
if (tmp2)
|
||||
tmp = gst_caps_merge (tmp, tmp2);
|
||||
}
|
||||
|
||||
tmp = gst_gl_overlay_compositor_add_caps (tmp);
|
||||
|
||||
if (filter) {
|
||||
result = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (tmp);
|
||||
|
|
Loading…
Reference in a new issue