Bug 1767930 - Enable Utility AudioDecoder for Android r=jolin

Differential Revision: https://phabricator.services.mozilla.com/D145785
This commit is contained in:
Alexandre Lissy 2022-05-26 23:00:07 +00:00
Родитель 74097ce09d
Коммит c53de97817
4 изменённых файлов: 30 добавлений и 2 удалений

Просмотреть файл

@ -3001,8 +3001,11 @@ bool ContentParent::InitInternal(ProcessPriority aInitialPriority) {
} }
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
if (!(StaticPrefs::media_utility_process_enabled() &&
StaticPrefs::media_utility_android_media_codec_enabled())) {
Unused << SendDecoderSupportedMimeTypes( Unused << SendDecoderSupportedMimeTypes(
AndroidDecoderModule::GetSupportedMimeTypes()); AndroidDecoderModule::GetSupportedMimeTypes());
}
#endif #endif
// Must send screen info before send initialData // Must send screen info before send initialData

Просмотреть файл

@ -567,6 +567,12 @@ void PDMFactory::CreateUtilityPDMs() {
mFailureFlags += GetFailureFlagBasedOnFFmpegStatus( mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
FFmpegRuntimeLinker::LinkStatusCode()); FFmpegRuntimeLinker::LinkStatusCode());
} }
#endif
#ifdef MOZ_WIDGET_ANDROID
if (StaticPrefs::media_utility_android_media_codec_enabled()) {
StartupPDM(AndroidDecoderModule::Create(),
StaticPrefs::media_android_media_codec_preferred());
}
#endif #endif
CreateAndStartupPDM<AgnosticDecoderModule>(); CreateAndStartupPDM<AgnosticDecoderModule>();
} }

Просмотреть файл

@ -19,6 +19,11 @@
# include "mozilla/sandboxTarget.h" # include "mozilla/sandboxTarget.h"
#endif // defined(XP_WIN) && defined(MOZ_SANDBOX) #endif // defined(XP_WIN) && defined(MOZ_SANDBOX)
#ifdef MOZ_WIDGET_ANDROID
# include "mozilla/StaticPrefs_media.h"
# include "AndroidDecoderModule.h"
#endif
namespace mozilla::ipc { namespace mozilla::ipc {
UtilityAudioDecoderParent::UtilityAudioDecoderParent() { UtilityAudioDecoderParent::UtilityAudioDecoderParent() {
@ -57,6 +62,13 @@ void UtilityAudioDecoderParent::Start(
DebugOnly<bool> ok = std::move(aEndpoint).Bind(this); DebugOnly<bool> ok = std::move(aEndpoint).Bind(this);
MOZ_ASSERT(ok); MOZ_ASSERT(ok);
#ifdef MOZ_WIDGET_ANDROID
if (StaticPrefs::media_utility_android_media_codec_enabled()) {
AndroidDecoderModule::SetSupportedMimeTypes(
AndroidDecoderModule::GetSupportedMimeTypes());
}
#endif
auto supported = PDMFactory::Supported(); auto supported = PDMFactory::Supported();
Unused << SendUpdateMediaCodecsSupported(std::move(supported)); Unused << SendUpdateMediaCodecsSupported(std::move(supported));
} }

Просмотреть файл

@ -9015,6 +9015,13 @@
value: true value: true
mirror: always mirror: always
# Bug 1771196
# Dont yet enable AndroidDecoderModule on Utility
- name: media.utility-android-media-codec.enabled
type: RelaxedAtomicBool
value: false
mirror: always
- name: media.android-media-codec.preferred - name: media.android-media-codec.preferred
type: RelaxedAtomicBool type: RelaxedAtomicBool
value: true value: true