Backed out 2 changesets (bug 1846546) for causing BUG 1849396. CLOSED TREE

Backed out changeset aac1f1d71d52 (bug 1846546)
Backed out changeset 0ca91e7b51ff (bug 1846546)
This commit is contained in:
Cristian Tuns 2023-08-21 09:44:37 -04:00
parent db575a9e75
commit 06a74806cb
6 changed files with 12 additions and 72 deletions

View file

@ -377,13 +377,11 @@ void MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData) {
switch (aData.mTrack) {
case TrackInfo::kAudioTrack: {
bool lowLatency = ownerData.GetCurrentInfo()->GetAsAudioInfo()->mIsLive;
p = platform->CreateDecoder(
{*ownerData.GetCurrentInfo()->GetAsAudioInfo(), mOwner->mCrashHelper,
CreateDecoderParams::UseNullDecoder(ownerData.mIsNullDecode),
TrackInfo::kAudioTrack, std::move(onWaitingForKeyEvent),
mOwner->mMediaEngineId, mOwner->mTrackingId,
OptionSet(lowLatency ? Option::LowLatency : Option::Default)});
mOwner->mMediaEngineId, mOwner->mTrackingId});
break;
}
@ -392,7 +390,7 @@ void MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData) {
// decoding, so specify LAYERS_NONE if we want to forcibly disable it.
using Option = CreateDecoderParams::Option;
using OptionSet = CreateDecoderParams::OptionSet;
bool lowLatency = ownerData.GetCurrentInfo()->GetAsVideoInfo()->mIsLive;
p = platform->CreateDecoder(
{*ownerData.GetCurrentInfo()->GetAsVideoInfo(),
mOwner->mKnowsCompositor, mOwner->GetImageContainer(),
@ -403,7 +401,6 @@ void MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData) {
OptionSet(ownerData.mHardwareDecodingDisabled
? Option::HardwareDecoderNotAllowed
: Option::Default),
OptionSet(lowLatency ? Option::LowLatency : Option::Default),
mOwner->mMediaEngineId, mOwner->mTrackingId});
break;
}

View file

@ -283,10 +283,6 @@ class TrackInfo {
// rendered directly by non-gecko components.
bool mIsRenderedExternally;
// True if the track represent live media
// This allows configuring decoders in low-latency mode.
bool mIsLive = false;
virtual AudioInfo* GetAsAudioInfo() { return nullptr; }
virtual VideoInfo* GetAsVideoInfo() { return nullptr; }
virtual TextInfo* GetAsTextInfo() { return nullptr; }

View file

@ -8,7 +8,6 @@
#include "DecoderData.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/EndianUtils.h"
#include "mozilla/StaticPrefs_media.h"
#include "mozilla/Telemetry.h"
#include "VideoUtils.h"
#include "MP4Metadata.h"
@ -266,12 +265,8 @@ MediaResult MP4AudioInfo::Update(const Mp4parseTrackInfo* aTrack,
if (aTrack->duration > TimeUnit::MaxTicks()) {
mDuration = TimeUnit::FromInfinity();
} else {
if (aTrack->duration) {
mDuration =
TimeUnit(AssertedCast<int64_t>(aTrack->duration), aTrack->time_scale);
} else {
mIsLive = true;
}
mDuration =
TimeUnit(AssertedCast<int64_t>(aTrack->duration), aTrack->time_scale);
}
mMediaTime = TimeUnit(aTrack->media_time, aTrack->time_scale);
mTrackId = aTrack->track_id;
@ -338,12 +333,8 @@ MediaResult MP4VideoInfo::Update(const Mp4parseTrackInfo* track,
if (track->duration > TimeUnit::MaxTicks()) {
mDuration = TimeUnit::FromInfinity();
} else {
if (track->duration > 0) {
mDuration =
TimeUnit(AssertedCast<int64_t>(track->duration), track->time_scale);
} else {
mIsLive = true;
}
mDuration =
TimeUnit(AssertedCast<int64_t>(track->duration), track->time_scale);
}
mMediaTime = TimeUnit(track->media_time, track->time_scale);
mDisplay.width = AssertedCast<int32_t>(video->display_width);
@ -354,7 +345,6 @@ MediaResult MP4VideoInfo::Update(const Mp4parseTrackInfo* track,
Mp4parseByteData extraData = video->sample_info[0].extra_data;
// If length is 0 we append nothing
mExtraData->AppendElements(extraData.data, extraData.length);
mIsLive |= StaticPrefs::media_low_latency_decoding_force_enabled();
return NS_OK;
}

View file

@ -288,7 +288,7 @@ MediaResult WMFVideoMFTManager::InitInternal() {
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
WMFDecoderModule::GetNumDecoderThreads());
bool lowLatency = StaticPrefs::media_wmf_low_latency_enabled();
if (mLowLatency && lowLatency) {
if (mLowLatency || lowLatency) {
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
if (SUCCEEDED(hr)) {
LOG("Enabling Low Latency Mode");

View file

@ -17,7 +17,6 @@
#include "gfxUtils.h"
#include "mozilla/EndianUtils.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/StaticPrefs_media.h"
#include "MediaDataDemuxer.h"
#include "nsAutoRef.h"
#include "NesteggPacketHolder.h"
@ -382,28 +381,9 @@ nsresult WebMDemuxer::ReadMetadata() {
uint64_t duration = 0;
r = nestegg_duration(context, &duration);
if (!r) {
// It's technically possible to have duration be > INT64_MAX here.
// When that's the case, use a lower resolution TimeUnit
if (duration <= std::numeric_limits<int64_t>::max()) {
mInfo.mVideo.mDuration =
TimeUnit::FromNanoseconds(AssertedCast<int64_t>(duration));
} else {
mInfo.mVideo.mDuration =
TimeUnit(AssertedCast<int64_t>(duration / 1000), USECS_PER_S);
}
} else {
mInfo.mVideo.mDuration = TimeUnit::FromInfinity();
mInfo.mVideo.mIsLive = true;
mInfo.mVideo.mDuration = TimeUnit::FromNanoseconds(duration);
}
mInfo.mVideo.mIsLive |=
StaticPrefs::media_low_latency_decoding_force_enabled();
WEBM_DEBUG("WebM video track duration: %s\n",
mInfo.mVideo.mDuration.IsValid()
? mInfo.mVideo.mDuration.ToString().get()
: "live");
WEBM_DEBUG("stream duration: %lf\n", mInfo.mVideo.mDuration.ToSeconds());
mInfo.mVideo.mCrypto = GetTrackCrypto(TrackInfo::kVideoTrack, track);
if (mInfo.mVideo.mCrypto.IsEncrypted()) {
MOZ_ASSERT(mInfo.mVideo.mCrypto.mCryptoScheme == CryptoScheme::Cenc,
@ -488,27 +468,10 @@ nsresult WebMDemuxer::ReadMetadata() {
uint64_t duration = 0;
r = nestegg_duration(context, &duration);
if (!r) {
// It's technically possible to have duration be > INT64_MAX here.
// When that's the case, use a lower resolution TimeUnit
if (duration <= std::numeric_limits<int64_t>::max()) {
mInfo.mAudio.mDuration =
TimeUnit::FromNanoseconds(AssertedCast<int64_t>(duration));
} else {
mInfo.mAudio.mDuration =
TimeUnit(AssertedCast<int64_t>(duration / 1000), USECS_PER_S);
}
} else {
mInfo.mAudio.mDuration = TimeUnit::FromInfinity();
mInfo.mAudio.mIsLive = true;
mInfo.mAudio.mDuration = TimeUnit::FromNanoseconds(duration);
WEBM_DEBUG("audio track duration: %lf",
mInfo.mAudio.mDuration.ToSeconds());
}
mInfo.mAudio.mIsLive |=
StaticPrefs::media_low_latency_decoding_force_enabled();
WEBM_DEBUG("WebM audio track duration: %s\n",
mInfo.mAudio.mDuration.IsValid()
? mInfo.mAudio.mDuration.ToString().get()
: "live");
mInfo.mAudio.mCrypto = GetTrackCrypto(TrackInfo::kAudioTrack, track);
if (mInfo.mAudio.mCrypto.IsEncrypted()) {
MOZ_ASSERT(mInfo.mAudio.mCrypto.mCryptoScheme == CryptoScheme::Cenc,

View file

@ -10117,12 +10117,6 @@
value: false
mirror: always
# Configure all decoders to use low-latency mode.
- name: media.low-latency-decoding.force-enabled
type: RelaxedAtomicBool
value: false
mirror: always
#ifdef MOZ_WMF
- name: media.wmf.enabled