glvideomixer: override sink pad template
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>
Fri, 3 Jun 2022 09:40:35 +0000 (11:40 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 14 Dec 2022 12:50:36 +0000 (12:50 +0000)
Allow us to pass the GType of its pad and so
improve the documentation when inspecting glvideomixer.

Fix #1253

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2527>

subprojects/gst-docs/symbols/symbol_index.json
subprojects/gst-plugins-base/docs/plugins/gst_plugins_cache.json
subprojects/gst-plugins-base/ext/gl/gstglvideomixer.c

index dcc2db4..1201c5b 100644 (file)
   "GstGLVideoMixerBlendFunction::src-alpha-saturate",
   "GstGLVideoMixerBlendFunction::src-color",
   "GstGLVideoMixerBlendFunction::zero",
+  "GstGLVideoMixerInput",
+  "GstGLVideoMixerInput:alpha",
+  "GstGLVideoMixerInput:blend-constant-color-alpha",
+  "GstGLVideoMixerInput:blend-constant-color-blue",
+  "GstGLVideoMixerInput:blend-constant-color-green",
+  "GstGLVideoMixerInput:blend-constant-color-red",
+  "GstGLVideoMixerInput:blend-equation-alpha",
+  "GstGLVideoMixerInput:blend-equation-rgb",
+  "GstGLVideoMixerInput:blend-function-dst-alpha",
+  "GstGLVideoMixerInput:blend-function-dst-rgb",
+  "GstGLVideoMixerInput:blend-function-src-alpha",
+  "GstGLVideoMixerInput:blend-function-src-rgb",
+  "GstGLVideoMixerInput:height",
+  "GstGLVideoMixerInput:repeat-after-eos",
+  "GstGLVideoMixerInput:width",
+  "GstGLVideoMixerInput:xpos",
+  "GstGLVideoMixerInput:ypos",
+  "GstGLVideoMixerInput:zorder",
   "GstGLVideoMixerPad",
   "GstGLVideoMixerPad:alpha",
   "GstGLVideoMixerPad:blend-constant-color-alpha",
index c3d8b03..13c76a7 100644 (file)
                     "sink_%%u": {
                         "caps": "video/x-raw(memory:GLMemory, meta:GstVideoOverlayComposition):\n         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:DMABuf, meta:GstVideoOverlayComposition):\n         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:SystemMemory, meta:GstVideoOverlayComposition):\n         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(meta:GstVideoGLTextureUploadMeta, meta:GstVideoOverlayComposition):\n         format: RGBA\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:GLMemory):\n         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(memory:DMABuf):\n         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\nvideo/x-raw:\n         format: { RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, GBRA, GBR, RGBP, BGRP, RGB, BGR, RGB16, BGR16, AYUV, VUYA, Y410, I420, YV12, NV12, NV21, NV16, NV61, YUY2, UYVY, Y210, Y41B, Y42B, Y444, GRAY8, GRAY16_LE, GRAY16_BE, ARGB64, A420, AV12, NV12_16L32S, NV12_4L4, BGR10A2_LE, RGB10A2_LE, P010_10LE, P012_LE, P016_LE, Y212_LE, Y412_LE }\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\n\nvideo/x-raw(meta:GstVideoGLTextureUploadMeta):\n         format: RGBA\n          width: [ 1, 2147483647 ]\n         height: [ 1, 2147483647 ]\n      framerate: [ 0/1, 2147483647/1 ]\n",
                         "direction": "sink",
-                        "presence": "request"
+                        "presence": "request",
+                        "type": "GstGLVideoMixerInput"
                     },
                     "src": {
                         "caps": "video/x-raw(ANY):\n",
                     }
                 ]
             },
+            "GstGLVideoMixerInput": {
+                "hierarchy": [
+                    "GstGLVideoMixerInput",
+                    "GstGhostPad",
+                    "GstProxyPad",
+                    "GstPad",
+                    "GstObject",
+                    "GInitiallyUnowned",
+                    "GObject"
+                ],
+                "kind": "object",
+                "properties": {
+                    "alpha": {
+                        "blurb": "Alpha of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "1",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gdouble",
+                        "writable": true
+                    },
+                    "blend-constant-color-alpha": {
+                        "blurb": "Blend Constant Color Alpha",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "1",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gdouble",
+                        "writable": true
+                    },
+                    "blend-constant-color-blue": {
+                        "blurb": "Blend Constant Color Green",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "1",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gdouble",
+                        "writable": true
+                    },
+                    "blend-constant-color-green": {
+                        "blurb": "Blend Constant Color Green",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "1",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gdouble",
+                        "writable": true
+                    },
+                    "blend-constant-color-red": {
+                        "blurb": "Blend Constant Color Red",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "1",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gdouble",
+                        "writable": true
+                    },
+                    "blend-equation-alpha": {
+                        "blurb": "Blend Equation for Alpha",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "add (0)",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "GstGLVideoMixerBlendEquation",
+                        "writable": true
+                    },
+                    "blend-equation-rgb": {
+                        "blurb": "Blend Equation for RGB",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "add (0)",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "GstGLVideoMixerBlendEquation",
+                        "writable": true
+                    },
+                    "blend-function-dst-alpha": {
+                        "blurb": "Blend Function for Destination Alpha",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "zero (0)",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "GstGLVideoMixerBlendFunction",
+                        "writable": true
+                    },
+                    "blend-function-dst-rgb": {
+                        "blurb": "Blend Function for Destination RGB",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "zero (0)",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "GstGLVideoMixerBlendFunction",
+                        "writable": true
+                    },
+                    "blend-function-src-alpha": {
+                        "blurb": "Blend Function for Source Alpha",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "zero (0)",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "GstGLVideoMixerBlendFunction",
+                        "writable": true
+                    },
+                    "blend-function-src-rgb": {
+                        "blurb": "Blend Function for Source RGB",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "zero (0)",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "GstGLVideoMixerBlendFunction",
+                        "writable": true
+                    },
+                    "crop-bottom": {
+                        "blurb": "Crop bottom of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "crop-left": {
+                        "blurb": "Crop left of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "crop-right": {
+                        "blurb": "Crop right of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "crop-top": {
+                        "blurb": "Crop top of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "height": {
+                        "blurb": "Height of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "-2147483648",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "repeat-after-eos": {
+                        "blurb": "Aggregate the last frame on pads that are EOS till they are released",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "false",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gboolean",
+                        "writable": true
+                    },
+                    "width": {
+                        "blurb": "Width of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "-2147483648",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "xpos": {
+                        "blurb": "X Position of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "-2147483648",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "ypos": {
+                        "blurb": "Y Position of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "2147483647",
+                        "min": "-2147483648",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "gint",
+                        "writable": true
+                    },
+                    "zorder": {
+                        "blurb": "Z Order of the picture",
+                        "conditionally-available": false,
+                        "construct": false,
+                        "construct-only": false,
+                        "controllable": true,
+                        "default": "0",
+                        "max": "10000",
+                        "min": "0",
+                        "mutable": "null",
+                        "readable": true,
+                        "type": "guint",
+                        "writable": true
+                    }
+                }
+            },
             "GstGLVideoMixerPad": {
                 "hierarchy": [
                     "GstGLVideoMixerPad",
index e9dc5b0..0751c89 100644 (file)
@@ -465,6 +465,7 @@ gst_gl_video_mixer_bin_class_init (GstGLVideoMixerBinClass * klass)
   GstGLMixerBinClass *mixer_class = GST_GL_MIXER_BIN_CLASS (klass);
   GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  GstCaps *upload_caps;
 
   mixer_class->create_input_pad = _create_video_mixer_input;
 
@@ -476,9 +477,20 @@ gst_gl_video_mixer_bin_class_init (GstGLVideoMixerBinClass * klass)
           GST_TYPE_GL_VIDEO_MIXER_BACKGROUND,
           DEFAULT_BACKGROUND, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  /* override the sink_%u pad template from GstGLMixerBin.
+   * We pass it the GType of our sink pad so it's properly documented when
+   * inspecting the element. */
+  upload_caps = gst_gl_upload_get_input_template_caps ();
+  gst_element_class_add_pad_template (element_class,
+      gst_pad_template_new_with_gtype ("sink_%u", GST_PAD_SINK, GST_PAD_REQUEST,
+          upload_caps, gst_gl_video_mixer_input_get_type ()));
+  gst_caps_unref (upload_caps);
+
   gst_element_class_set_metadata (element_class, "OpenGL video_mixer bin",
       "Bin/Filter/Effect/Video/Compositor", "OpenGL video_mixer bin",
       "Matthew Waters <matthew@centricular.com>");
+
+  gst_type_mark_as_plugin_api (gst_gl_video_mixer_input_get_type (), 0);
 }
 
 static void