+ GstCaps *res, *caps, *allowed_caps;
+ gboolean allow_mono = TRUE;
+
+ allowed_caps = gst_pad_get_allowed_caps (GST_AUDIO_ENCODER_SRC_PAD (enc));
+ GST_DEBUG_OBJECT (enc, "allowed caps %" GST_PTR_FORMAT, allowed_caps);
+
+ /* We need at least 2 channels if Parametric Stereo is in use. */
+ if (allowed_caps && gst_caps_get_size (allowed_caps) > 0) {
+ GstStructure *s = gst_caps_get_structure (allowed_caps, 0);
+ const gchar *profile = NULL;
+
+ if ((profile = gst_structure_get_string (s, "profile"))
+ && strcmp (profile, "ps") == 0) {
+ allow_mono = FALSE;
+ }
+ }
+ gst_clear_caps (&allowed_caps);