2024-07-23 13:06:11 +00:00
|
|
|
diff -up firefox-128.0/dom/media/mp4/MP4Demuxer.cpp.mozilla-bmo1670333 firefox-128.0/dom/media/mp4/MP4Demuxer.cpp
|
|
|
|
--- firefox-128.0/dom/media/mp4/MP4Demuxer.cpp.mozilla-bmo1670333 2024-07-04 18:20:27.000000000 +0200
|
|
|
|
+++ firefox-128.0/dom/media/mp4/MP4Demuxer.cpp 2024-07-16 13:49:10.475630426 +0200
|
|
|
|
@@ -33,6 +33,8 @@ mozilla::LogModule* GetDemuxerLog() { re
|
2024-06-24 08:50:51 +00:00
|
|
|
DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
|
|
|
|
__func__, ##__VA_ARGS__)
|
|
|
|
|
|
|
|
+extern bool gUseKeyframeFromContainer;
|
|
|
|
+
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
using TimeUnit = media::TimeUnit;
|
2024-07-23 13:06:11 +00:00
|
|
|
@@ -419,6 +421,12 @@ already_AddRefed<MediaRawData> MP4TrackD
|
2024-06-24 08:50:51 +00:00
|
|
|
[[fallthrough]];
|
|
|
|
case H264::FrameType::OTHER: {
|
|
|
|
bool keyframe = type == H264::FrameType::I_FRAME;
|
|
|
|
+ if (gUseKeyframeFromContainer) {
|
|
|
|
+ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
|
|
|
|
+ sample->mKeyframe = keyframe;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
if (sample->mKeyframe != keyframe) {
|
|
|
|
NS_WARNING(nsPrintfCString("Frame incorrectly marked as %skeyframe "
|
|
|
|
"@ pts:%" PRId64 " dur:%" PRId64
|
2024-07-23 13:06:11 +00:00
|
|
|
diff -up firefox-128.0/dom/media/platforms/PDMFactory.cpp.mozilla-bmo1670333 firefox-128.0/dom/media/platforms/PDMFactory.cpp
|
|
|
|
--- firefox-128.0/dom/media/platforms/PDMFactory.cpp.mozilla-bmo1670333 2024-07-04 18:20:26.000000000 +0200
|
|
|
|
+++ firefox-128.0/dom/media/platforms/PDMFactory.cpp 2024-07-16 14:16:04.635809901 +0200
|
|
|
|
@@ -62,6 +62,8 @@
|
2024-06-24 08:50:51 +00:00
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
+bool gUseKeyframeFromContainer = false;
|
|
|
|
+
|
|
|
|
using DecodeSupport = mozilla::media::DecodeSupport;
|
|
|
|
using DecodeSupportSet = mozilla::media::DecodeSupportSet;
|
|
|
|
using MediaCodec = mozilla::media::MediaCodec;
|
2024-07-23 13:06:11 +00:00
|
|
|
@@ -543,7 +545,7 @@ void PDMFactory::CreateRddPDMs() {
|
2024-06-24 08:50:51 +00:00
|
|
|
#ifdef MOZ_FFMPEG
|
|
|
|
if (StaticPrefs::media_ffmpeg_enabled() &&
|
|
|
|
StaticPrefs::media_rdd_ffmpeg_enabled() &&
|
2024-07-23 13:06:11 +00:00
|
|
|
- !StartupPDM(FFmpegRuntimeLinker::CreateDecoder())) {
|
|
|
|
+ !(mFFmpegUsed = StartupPDM(FFmpegRuntimeLinker::CreateDecoder()))) {
|
2024-06-24 08:50:51 +00:00
|
|
|
mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
|
|
|
|
FFmpegRuntimeLinker::LinkStatusCode());
|
|
|
|
}
|
2024-07-23 13:06:11 +00:00
|
|
|
@@ -719,7 +721,7 @@ void PDMFactory::CreateDefaultPDMs() {
|
|
|
|
StartupPDM(AgnosticDecoderModule::Create(),
|
|
|
|
StaticPrefs::media_prefer_non_ffvpx());
|
2024-06-24 08:50:51 +00:00
|
|
|
|
|
|
|
- if (StaticPrefs::media_gmp_decoder_enabled() &&
|
|
|
|
+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
|
|
|
|
!StartupPDM(GMPDecoderModule::Create(),
|
|
|
|
StaticPrefs::media_gmp_decoder_preferred())) {
|
|
|
|
mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
|
2024-07-23 13:06:11 +00:00
|
|
|
diff -up firefox-128.0/dom/media/platforms/PDMFactory.h.mozilla-bmo1670333 firefox-128.0/dom/media/platforms/PDMFactory.h
|
|
|
|
--- firefox-128.0/dom/media/platforms/PDMFactory.h.mozilla-bmo1670333 2024-07-04 18:20:26.000000000 +0200
|
|
|
|
+++ firefox-128.0/dom/media/platforms/PDMFactory.h 2024-07-16 13:49:10.476630421 +0200
|
|
|
|
@@ -98,6 +98,7 @@ class PDMFactory final {
|
2024-06-24 08:50:51 +00:00
|
|
|
RefPtr<PlatformDecoderModule> mNullPDM;
|
|
|
|
|
|
|
|
DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
|
|
|
|
+ bool mFFmpegUsed = false;
|
|
|
|
|
|
|
|
friend class RemoteVideoDecoderParent;
|
|
|
|
static void EnsureInit();
|