From 2f629b435ba32e7bacd785f9a692f88bf732081f Mon Sep 17 00:00:00 2001 From: amindfv Date: Sat, 25 Feb 2023 22:40:19 +0000 Subject: [PATCH] alphacombine: add support for I420_10LE Part-of: --- .../docs/plugins/gst_plugins_cache.json | 6 +++--- .../gst/codecalpha/gstalphacombine.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json index e3b36faf57..6b79dc9113 100644 --- a/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json +++ b/subprojects/gst-plugins-bad/docs/plugins/gst_plugins_cache.json @@ -5508,17 +5508,17 @@ "long-name": "Alpha Combiner", "pad-templates": { "alpha": { - "caps": "video/x-raw:\n format: { GRAY8, I420, NV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", + "caps": "video/x-raw:\n format: { GRAY8, I420, I420_10LE, NV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", "direction": "sink", "presence": "always" }, "sink": { - "caps": "video/x-raw:\n format: { I420, NV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", + "caps": "video/x-raw:\n format: { I420, I420_10LE, NV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", "direction": "sink", "presence": "always" }, "src": { - "caps": "video/x-raw:\n format: { A420, AV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", + "caps": "video/x-raw:\n format: { A420, A420_10LE, AV12 }\n width: [ 1, 2147483647 ]\n height: [ 1, 2147483647 ]\n framerate: [ 0/1, 2147483647/1 ]\n", "direction": "src", "presence": "always" } diff --git a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c index 2f47191eec..b029d9a5fd 100644 --- a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c +++ b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c @@ -47,9 +47,9 @@ #include "gstalphacombine.h" -#define SUPPORTED_SINK_FORMATS "{ I420, NV12 }" -#define SUPPORTED_ALPHA_FORMATS "{ GRAY8, I420, NV12 }" -#define SUPPORTED_SRC_FORMATS "{ A420, AV12 }" +#define SUPPORTED_SINK_FORMATS "{ I420, I420_10LE, NV12 }" +#define SUPPORTED_ALPHA_FORMATS "{ GRAY8, I420, I420_10LE, NV12 }" +#define SUPPORTED_SRC_FORMATS "{ A420, A420_10LE, AV12 }" /* *INDENT-OFF* */ struct { @@ -81,6 +81,10 @@ struct { .sink = GST_VIDEO_FORMAT_NV12, .alpha = GST_VIDEO_FORMAT_I420, .src = GST_VIDEO_FORMAT_AV12 + },{ + .sink = GST_VIDEO_FORMAT_I420_10LE, + .alpha = GST_VIDEO_FORMAT_I420_10LE, + .src = GST_VIDEO_FORMAT_A420_10LE }, }; /* *INDENT-ON* */ @@ -215,7 +219,7 @@ gst_alpha_combine_negotiate (GstAlphaCombine * self) if (GST_VIDEO_INFO_COLORIMETRY (&self->sink_vinfo).range != GST_VIDEO_INFO_COLORIMETRY (&self->alpha_vinfo).range) { - GST_ELEMENT_ERROR (self, STREAM, FORMAT, ("Color range miss-match"), + GST_ELEMENT_ERROR (self, STREAM, FORMAT, ("Color range mismatch"), ("We can only combine buffers if they have the same color range.")); return FALSE; } @@ -401,7 +405,7 @@ gst_alpha_combine_set_sink_format (GstAlphaCombine * self, GstCaps * caps) sink_format = GST_VIDEO_INFO_FORMAT (&self->sink_vinfo); - /* The sink format determin the src format, though we cannot fully validate + /* The sink format determines the src format, though we cannot fully validate * the negotiation here, since we don't have the alpha format yet. */ for (i = 0; i < G_N_ELEMENTS (format_map); i++) { if (format_map[i].sink == sink_format) {