QPlatformMediaIntegration: Add setBackend to force a media backend


The current behavior of QPlatformMediaIntegration is to fall back to
other available media plugins if the selected one fails to load. This is
not wanted when running integration tests: if the backend under test
fails to load, it should count as a failed test rather than silently
testing a different backend or the fallback stub. Additionally, several
integration tests will skip if the tested feature is reported as
unsupported, which is the case when we load the fallback backend. These
are then reported as passed.

This patch renames the private setPreferredBackend() to setBackend() and
gives it precedence over the QT_MEDIA_BACKEND environment variable and
the built-in default. When set, backend fallback logic is also disabled.

Integration tests will now call setBackend() to force the backend, and
fail if we end up loading the fallback backend.

Pick-to: 6.12
Change-Id: Ie2835183ee79a15559edfc52576287beb21a88d2
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
commit385ca4368362ff99b8af5ff776f7476e3b975223
parent888466b037c72f70780e610703f9b85e7e36cf9b
authorNils Petter Skålerud <nils.petter.skalerud@qt.io>
committerNils Petter Skålerud <nils.petter.skalerud@qt.io>
commit timeTue, 4 Aug 2026 15:35:09 +0000