Bug 1870346 - Add WebCodecs pref to force decoding of H264 on OSX for testing. r=media-playback-reviewers,chunmin

This is needed so that we can write talos tests that exercise different
codecs on Windows/OSX/Linux. We can't distinguish between platforms to
skip or gracefully fail this test for a particular platform, and since
the H264 we are testing with is able to be decoded successfully, let's
just make a pref to allow us (and others) to test with what we have
implemented even if partially broken.

Differential Revision: https://phabricator.services.mozilla.com/D196603
This commit is contained in:
Andrew Osmond 2023-12-15 22:18:41 +00:00
parent 0a0def9a5d
commit d00fc5db08
2 changed files with 8 additions and 1 deletions

View file

@ -19,6 +19,7 @@
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/Try.h" #include "mozilla/Try.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "mozilla/dom/EncodedVideoChunk.h" #include "mozilla/dom/EncodedVideoChunk.h"
@ -232,7 +233,8 @@ static bool CanDecode(const Config& aConfig) {
if (!IsSupportedCodec(param.mParsedCodec)) { if (!IsSupportedCodec(param.mParsedCodec)) {
return false; return false;
} }
if (IsOnMacOS() && IsH264CodecString(param.mParsedCodec)) { if (IsOnMacOS() && IsH264CodecString(param.mParsedCodec) &&
!StaticPrefs::dom_media_webcodecs_force_osx_h264_enabled()) {
// This will be fixed in Bug 1846796. // This will be fixed in Bug 1846796.
return false; return false;
} }

View file

@ -3042,6 +3042,11 @@
value: @IS_NIGHTLY_BUILD@ value: @IS_NIGHTLY_BUILD@
mirror: always mirror: always
- name: dom.media.webcodecs.force-osx-h264-enabled
type: RelaxedAtomicBool
value: false
mirror: always
# Number of seconds of very quiet or silent audio before considering the audio # Number of seconds of very quiet or silent audio before considering the audio
# inaudible. # inaudible.
- name: dom.media.silence_duration_for_audibility - name: dom.media.silence_duration_for_audibility