It might be possible to fulfill those but not with the first caps
structure. Instead of just fixating the first caps structure, check if
the preference can be fulfilled by any of the structures as the first
step.
Without this the following pipeline negotiates to mono after the
decoder because opusenc only has a single channel in its first caps
structure.
gst-launch-1.0 audiotestsrc ! audio/x-raw,channels=2 ! opusenc \
! queue ! opusdec ! queue ! opusenc ! fakesink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3689>
We want to make it so that we prefer a higher, not lower, number of
channels. Otherwise, this pipeline would convert from 2 to 1 channels:
gst-launch-1.0 audiotestsrc ! audio/x-raw,channels=2 ! opusenc ! queue ! opusdec ! queue ! opusenc ! fakesink
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3494>
They are part of gst_dep already and we have to make sure to always have
gst_dep. The order in dependencies matters, because it is also the order
in which Meson will set -I args. We want gstreamer's config.h to take
precedence over glib's private config.h when it's a subproject.
While at it, remove useless fallback args for gmodule/gio dependencies,
only gstreamer core needs it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2031>