2022-04-06 08:36:00 +00:00
|
|
|
diff -up firefox-99.0/dom/media/mp4/MP4Demuxer.cpp.1670333 firefox-99.0/dom/media/mp4/MP4Demuxer.cpp
|
|
|
|
--- firefox-99.0/dom/media/mp4/MP4Demuxer.cpp.1670333 2022-03-31 01:24:44.000000000 +0200
|
|
|
|
+++ firefox-99.0/dom/media/mp4/MP4Demuxer.cpp 2022-04-04 09:58:35.606351546 +0200
|
2020-10-19 19:01:34 +00:00
|
|
|
@@ -31,6 +31,8 @@ mozilla::LogModule* GetDemuxerLog() { re
|
|
|
|
DDMOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, "::%s: " arg, \
|
|
|
|
__func__, ##__VA_ARGS__)
|
|
|
|
|
|
|
|
+extern bool gUseKeyframeFromContainer;
|
|
|
|
+
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
DDLoggedTypeDeclNameAndBase(MP4TrackDemuxer, MediaTrackDemuxer);
|
|
|
|
@@ -394,6 +396,12 @@ already_AddRefed<MediaRawData> MP4TrackD
|
2020-10-15 09:07:22 +00:00
|
|
|
[[fallthrough]];
|
|
|
|
case H264::FrameType::OTHER: {
|
|
|
|
bool keyframe = type == H264::FrameType::I_FRAME;
|
2020-10-19 19:01:34 +00:00
|
|
|
+ if (gUseKeyframeFromContainer) {
|
|
|
|
+ if (sample->mKeyframe && sample->mKeyframe != keyframe) {
|
|
|
|
+ sample->mKeyframe = keyframe;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
if (sample->mKeyframe != keyframe) {
|
2020-10-15 09:07:22 +00:00
|
|
|
NS_WARNING(nsPrintfCString("Frame incorrectly marked as %skeyframe "
|
|
|
|
"@ pts:%" PRId64 " dur:%" PRId64
|
2022-04-06 08:36:00 +00:00
|
|
|
diff -up firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 firefox-99.0/dom/media/platforms/PDMFactory.cpp
|
|
|
|
--- firefox-99.0/dom/media/platforms/PDMFactory.cpp.1670333 2022-03-31 01:24:44.000000000 +0200
|
|
|
|
+++ firefox-99.0/dom/media/platforms/PDMFactory.cpp 2022-04-04 10:09:57.383419125 +0200
|
2021-03-23 09:29:22 +00:00
|
|
|
@@ -58,6 +58,8 @@
|
2020-10-19 19:01:34 +00:00
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
+bool gUseKeyframeFromContainer = false;
|
|
|
|
+
|
|
|
|
namespace mozilla {
|
|
|
|
|
2021-03-23 09:29:22 +00:00
|
|
|
#define PDM_INIT_LOG(msg, ...) \
|
2022-04-06 08:36:00 +00:00
|
|
|
@@ -495,7 +497,7 @@ void PDMFactory::CreateRddPDMs() {
|
2020-10-19 19:01:34 +00:00
|
|
|
#ifdef MOZ_FFMPEG
|
2022-04-06 08:36:00 +00:00
|
|
|
if (StaticPrefs::media_ffmpeg_enabled() &&
|
|
|
|
StaticPrefs::media_rdd_ffmpeg_enabled() &&
|
2020-12-10 19:02:09 +00:00
|
|
|
- !CreateAndStartupPDM<FFmpegRuntimeLinker>()) {
|
2022-04-06 08:36:00 +00:00
|
|
|
+ !(mFFmpegUsed = CreateAndStartupPDM<FFmpegRuntimeLinker>())) {
|
|
|
|
mFailureFlags += GetFailureFlagBasedOnFFmpegStatus(
|
|
|
|
FFmpegRuntimeLinker::LinkStatusCode());
|
2020-10-19 19:01:34 +00:00
|
|
|
}
|
2022-04-06 08:36:00 +00:00
|
|
|
@@ -602,8 +604,9 @@ void PDMFactory::CreateDefaultPDMs() {
|
2020-12-10 19:02:09 +00:00
|
|
|
|
|
|
|
CreateAndStartupPDM<AgnosticDecoderModule>();
|
2020-10-19 19:01:34 +00:00
|
|
|
|
2020-12-10 19:02:09 +00:00
|
|
|
- if (StaticPrefs::media_gmp_decoder_enabled() &&
|
|
|
|
+ if (StaticPrefs::media_gmp_decoder_enabled() && !mFFmpegUsed &&
|
|
|
|
!CreateAndStartupPDM<GMPDecoderModule>()) {
|
2020-10-19 19:01:34 +00:00
|
|
|
+ gUseKeyframeFromContainer = true;
|
2020-12-10 19:02:09 +00:00
|
|
|
mFailureFlags += DecoderDoctorDiagnostics::Flags::GMPPDMFailedToStartup;
|
|
|
|
}
|
|
|
|
}
|
2022-04-06 08:36:00 +00:00
|
|
|
diff -up firefox-99.0/dom/media/platforms/PDMFactory.h.1670333 firefox-99.0/dom/media/platforms/PDMFactory.h
|
|
|
|
--- firefox-99.0/dom/media/platforms/PDMFactory.h.1670333 2022-03-31 01:24:44.000000000 +0200
|
|
|
|
+++ firefox-99.0/dom/media/platforms/PDMFactory.h 2022-04-04 09:58:35.606351546 +0200
|
2021-04-20 07:11:49 +00:00
|
|
|
@@ -121,6 +121,7 @@ class PDMFactory final {
|
2021-03-23 09:29:22 +00:00
|
|
|
RefPtr<PlatformDecoderModule> mNullPDM;
|
2020-10-19 19:01:34 +00:00
|
|
|
|
2020-12-10 19:02:09 +00:00
|
|
|
DecoderDoctorDiagnostics::FlagsSet mFailureFlags;
|
|
|
|
+ bool mFFmpegUsed = false;
|
2021-03-23 09:29:22 +00:00
|
|
|
|
2020-10-19 19:01:34 +00:00
|
|
|
friend class RemoteVideoDecoderParent;
|
2020-12-10 19:02:09 +00:00
|
|
|
static void EnsureInit();
|