commit c4e4daedd249e738e5e1d85aa41fa1c4dd72f0a6
parent f7c82496e74643e4359af4de2f2545e6890ec356
Author: Andrew Osmond <aosmond@gmail.com>
Date: Mon, 5 Jan 2026 20:33:42 +0000
Bug 2008422 - Allow H264/HEVC MediaCodec decoders in parent process for gtests. r=media-playback-reviewers,jolin
This allows TestMediaDataDecoder/PropertyTest.DefaultValues/* to pass on Android.
Differential Revision: https://phabricator.services.mozilla.com/D277801
Diffstat:
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -665,7 +665,9 @@ void FFmpegVideoDecoder<LIBAV_VER>::InitHWDecoderIfAllowed() {
# endif // MOZ_ENABLE_D3D11VA
# ifdef MOZ_WIDGET_ANDROID
- if (XRE_IsRDDProcess() && NS_SUCCEEDED(InitMediaCodecDecoder())) {
+ if ((XRE_IsRDDProcess() ||
+ (XRE_IsParentProcess() && PR_GetEnv("MOZ_RUN_GTEST"))) &&
+ NS_SUCCEEDED(InitMediaCodecDecoder())) {
return;
}
# endif
@@ -2427,15 +2429,9 @@ bool FFmpegVideoDecoder<LIBAV_VER>::CanUseZeroCopyVideoFrame() const {
#ifdef MOZ_WIDGET_ANDROID
MediaResult FFmpegVideoDecoder<LIBAV_VER>::InitMediaCodecDecoder() {
- MOZ_DIAGNOSTIC_ASSERT(XRE_IsRDDProcess());
FFMPEG_LOG("Initialising MediaCodec FFmpeg decoder");
StaticMutexAutoLock mon(sMutex);
- if (!mImageAllocator /* todo check compositor */) {
- FFMPEG_LOG(" no KnowsCompositor or it doesn't support MediaCodec");
- return NS_ERROR_DOM_MEDIA_FATAL_ERR;
- }
-
if (mInfo.mColorDepth > gfx::ColorDepth::COLOR_10) {
return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("not supported color depth"));