зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1560368 - add Opus decoding on RDD. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D37620 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
81db073a18
Коммит
9ade78d985
|
@ -6,6 +6,7 @@
|
|||
#include "RemoteAudioDecoder.h"
|
||||
|
||||
#include "RemoteDecoderManagerChild.h"
|
||||
#include "OpusDecoder.h"
|
||||
#include "VorbisDecoder.h"
|
||||
#include "WAVDecoder.h"
|
||||
|
||||
|
@ -85,6 +86,8 @@ RemoteAudioDecoderParent::RemoteAudioDecoderParent(
|
|||
|
||||
if (VorbisDataDecoder::IsVorbis(params.mConfig.mMimeType)) {
|
||||
mDecoder = new VorbisDataDecoder(params);
|
||||
} else if (OpusDataDecoder::IsOpus(params.mConfig.mMimeType)) {
|
||||
mDecoder = new OpusDataDecoder(params);
|
||||
} else if (WaveDataDecoder::IsWave(params.mConfig.mMimeType)) {
|
||||
mDecoder = new WaveDataDecoder(params);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "RemoteDecoderManagerChild.h"
|
||||
#include "RemoteMediaDataDecoder.h"
|
||||
#include "RemoteVideoDecoder.h"
|
||||
#include "OpusDecoder.h"
|
||||
#include "VorbisDecoder.h"
|
||||
#include "WAVDecoder.h"
|
||||
|
||||
|
@ -46,6 +47,9 @@ bool RemoteDecoderModule::SupportsMimeType(
|
|||
if (StaticPrefs::media_rdd_wav_enabled()) {
|
||||
supports |= WaveDataDecoder::IsWave(aMimeType);
|
||||
}
|
||||
if (StaticPrefs::media_rdd_opus_enabled()) {
|
||||
supports |= OpusDataDecoder::IsOpus(aMimeType);
|
||||
}
|
||||
|
||||
MOZ_LOG(
|
||||
sPDMLog, LogLevel::Debug,
|
||||
|
|
|
@ -22,9 +22,8 @@ namespace mozilla {
|
|||
|
||||
bool AgnosticDecoderModule::SupportsMimeType(
|
||||
const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const {
|
||||
bool supports = VPXDecoder::IsVPX(aMimeType) ||
|
||||
OpusDataDecoder::IsOpus(aMimeType) ||
|
||||
TheoraDecoder::IsTheora(aMimeType);
|
||||
bool supports =
|
||||
VPXDecoder::IsVPX(aMimeType) || TheoraDecoder::IsTheora(aMimeType);
|
||||
if (!StaticPrefs::media_rdd_vorbis_enabled() ||
|
||||
!StaticPrefs::media_rdd_process_enabled() ||
|
||||
!BrowserTabsRemoteAutostart()) {
|
||||
|
@ -35,6 +34,11 @@ bool AgnosticDecoderModule::SupportsMimeType(
|
|||
!BrowserTabsRemoteAutostart()) {
|
||||
supports |= WaveDataDecoder::IsWave(aMimeType);
|
||||
}
|
||||
if (!StaticPrefs::media_rdd_opus_enabled() ||
|
||||
!StaticPrefs::media_rdd_process_enabled() ||
|
||||
!BrowserTabsRemoteAutostart()) {
|
||||
supports |= OpusDataDecoder::IsOpus(aMimeType);
|
||||
}
|
||||
#ifdef MOZ_AV1
|
||||
// We remove support for decoding AV1 here if RDD is enabled so that
|
||||
// decoding on the content process doesn't accidentally happen in case
|
||||
|
|
|
@ -5910,6 +5910,23 @@ VARCACHE_PREF(
|
|||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
#if defined(XP_LINUX) && !defined(ANDROID)
|
||||
# define PREF_VALUE true
|
||||
#elif defined(XP_WIN) && !defined(_ARM64_)
|
||||
# define PREF_VALUE false
|
||||
#elif defined(XP_MACOSX)
|
||||
# define PREF_VALUE true
|
||||
#else
|
||||
# define PREF_VALUE false
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
Live,
|
||||
"media.rdd-opus.enabled",
|
||||
media_rdd_opus_enabled,
|
||||
RelaxedAtomicBool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
#ifdef ANDROID
|
||||
|
||||
// Enable the MediaCodec PlatformDecoderModule by default.
|
||||
|
|
Загрузка…
Ссылка в новой задаче