GstVideoInfo best_info;
GstVideoMixer2Pad *pad;
gboolean need_alpha = FALSE;
+ gboolean at_least_one_alpha = FALSE;
GstCaps *downstream_caps;
GstCaps *possible_caps;
gchar *best_colorimetry;
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;
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;