diff --git a/ext/gl/gstglcolorconvertelement.c b/ext/gl/gstglcolorconvertelement.c index 8ad44abe54..5a42968782 100644 --- a/ext/gl/gstglcolorconvertelement.c +++ b/ext/gl/gstglcolorconvertelement.c @@ -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) diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index 6dcae74bc7..4120a893cb 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -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; diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c index 549db48327..8adf4b1abf 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.c +++ b/gst-libs/gst/gl/gstglcolorconvert.c @@ -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; diff --git a/gst-libs/gst/gl/gstglcolorconvert.h b/gst-libs/gst/gl/gstglcolorconvert.h index 4aa89854d7..8e66be4d3c 100644 --- a/gst-libs/gst/gl/gstglcolorconvert.h +++ b/gst-libs/gst/gl/gstglcolorconvert.h @@ -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, diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 3d9596d183..3387eeb42c 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -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);