glviewconvert: Copy composition meta from the primary buffer to both outputs
authorSebastian Dröge <sebastian@centricular.com>
Tue, 25 Sep 2018 13:56:24 +0000 (16:56 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 25 Sep 2018 14:01:15 +0000 (17:01 +0300)
Without this, glviewconvert (and thus glimagesink) will drop all overlay
composition metas.

gst-libs/gst/gl/gstglviewconvert.c

index 7e1e70ddb066e56584f7805c933ee7964512b555..35f380c89fdee6352b070a6c4e5ee8ea7ae35cc7 100644 (file)
@@ -2354,18 +2354,38 @@ gst_gl_view_convert_get_output (GstGLViewConvert * viewconvert,
 
   outbuf = priv->primary_out;
   if (outbuf) {
+    GstVideoOverlayCompositionMeta *composition_meta;
+
     gst_buffer_copy_into (outbuf, priv->primary_in,
         GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
     GST_BUFFER_FLAG_SET (outbuf,
         GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE |
         GST_VIDEO_BUFFER_FLAG_MULTIPLE_VIEW);
+
+    composition_meta =
+        gst_buffer_get_video_overlay_composition_meta (priv->primary_in);
+    if (composition_meta) {
+      GST_DEBUG ("found video overlay composition meta, applying on output.");
+      gst_buffer_add_video_overlay_composition_meta
+          (outbuf, composition_meta->overlay);
+    }
   }
 
   if (priv->auxilliary_out) {
+    GstVideoOverlayCompositionMeta *composition_meta;
+
     gst_buffer_copy_into (priv->auxilliary_out,
         priv->primary_out, GST_BUFFER_COPY_FLAGS, 0, -1);
     GST_BUFFER_FLAG_UNSET (priv->auxilliary_out,
         GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE);
+
+    composition_meta =
+        gst_buffer_get_video_overlay_composition_meta (priv->primary_out);
+    if (composition_meta) {
+      GST_DEBUG ("found video overlay composition meta, applying on output.");
+      gst_buffer_add_video_overlay_composition_meta
+          (priv->auxilliary_out, composition_meta->overlay);
+    }
   }
   priv->primary_out = NULL;