aboutsummaryrefslogtreecommitdiff
path: root/gst/videomixer/videomixer2.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2013-12-27 10:59:10 +0100
committerSebastian Dröge <sebastian@centricular.com>2013-12-27 10:59:10 +0100
commit42103d1559158b5e871a04a0e58b2acae260dd5a (patch)
treeb23975745859a8193921a2daf4c0f10cb93b5faa /gst/videomixer/videomixer2.c
parente20865c5348855dadcec34e752ffa9475234b5a1 (diff)
Imported Upstream version 1.2.2
Diffstat (limited to 'gst/videomixer/videomixer2.c')
-rw-r--r--gst/videomixer/videomixer2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gst/videomixer/videomixer2.c b/gst/videomixer/videomixer2.c
index fbcab602..75fef1e8 100644
--- a/gst/videomixer/videomixer2.c
+++ b/gst/videomixer/videomixer2.c
@@ -300,6 +300,7 @@ gst_videomixer2_update_converters (GstVideoMixer2 * mix)
GstVideoInfo best_info;
GstVideoMixer2Pad *pad;
gboolean need_alpha = FALSE;
+ gboolean at_least_one_alpha = FALSE;
GstCaps *downstream_caps;
GstCaps *possible_caps;
gchar *best_colorimetry;
@@ -325,6 +326,9 @@ gst_videomixer2_update_converters (GstVideoMixer2 * mix)
if (!pad->info.finfo)
continue;
+ if (pad->info.finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA)
+ at_least_one_alpha = TRUE;
+
/* If we want alpha, disregard all the other formats */
if (need_alpha && !(pad->info.finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA))
continue;
@@ -379,6 +383,14 @@ gst_videomixer2_update_converters (GstVideoMixer2 * mix)
gst_caps_unref (downstream_caps);
+ if (at_least_one_alpha
+ && !(best_info.finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA)) {
+ GST_ELEMENT_ERROR (mix, CORE, NEGOTIATION,
+ ("At least one of the input pads contains alpha, but downstream can't support alpha."),
+ ("Either convert your inputs to not contain alpha or add a videoconvert after the mixer"));
+ return FALSE;
+ }
+
best_colorimetry = gst_video_colorimetry_to_string (&(best_info.colorimetry));
best_chroma = gst_video_chroma_to_string (best_info.chroma_site);
mix->info = best_info;