forked from mirrors/gecko-dev
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:
parent
db575a9e75
commit
06a74806cb
6 changed files with 12 additions and 72 deletions
|
|
@ -377,13 +377,11 @@ void MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData) {
|
||||||
|
|
||||||
switch (aData.mTrack) {
|
switch (aData.mTrack) {
|
||||||
case TrackInfo::kAudioTrack: {
|
case TrackInfo::kAudioTrack: {
|
||||||
bool lowLatency = ownerData.GetCurrentInfo()->GetAsAudioInfo()->mIsLive;
|
|
||||||
p = platform->CreateDecoder(
|
p = platform->CreateDecoder(
|
||||||
{*ownerData.GetCurrentInfo()->GetAsAudioInfo(), mOwner->mCrashHelper,
|
{*ownerData.GetCurrentInfo()->GetAsAudioInfo(), mOwner->mCrashHelper,
|
||||||
CreateDecoderParams::UseNullDecoder(ownerData.mIsNullDecode),
|
CreateDecoderParams::UseNullDecoder(ownerData.mIsNullDecode),
|
||||||
TrackInfo::kAudioTrack, std::move(onWaitingForKeyEvent),
|
TrackInfo::kAudioTrack, std::move(onWaitingForKeyEvent),
|
||||||
mOwner->mMediaEngineId, mOwner->mTrackingId,
|
mOwner->mMediaEngineId, mOwner->mTrackingId});
|
||||||
OptionSet(lowLatency ? Option::LowLatency : Option::Default)});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -392,7 +390,7 @@ void MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData) {
|
||||||
// decoding, so specify LAYERS_NONE if we want to forcibly disable it.
|
// decoding, so specify LAYERS_NONE if we want to forcibly disable it.
|
||||||
using Option = CreateDecoderParams::Option;
|
using Option = CreateDecoderParams::Option;
|
||||||
using OptionSet = CreateDecoderParams::OptionSet;
|
using OptionSet = CreateDecoderParams::OptionSet;
|
||||||
bool lowLatency = ownerData.GetCurrentInfo()->GetAsVideoInfo()->mIsLive;
|
|
||||||
p = platform->CreateDecoder(
|
p = platform->CreateDecoder(
|
||||||
{*ownerData.GetCurrentInfo()->GetAsVideoInfo(),
|
{*ownerData.GetCurrentInfo()->GetAsVideoInfo(),
|
||||||
mOwner->mKnowsCompositor, mOwner->GetImageContainer(),
|
mOwner->mKnowsCompositor, mOwner->GetImageContainer(),
|
||||||
|
|
@ -403,7 +401,6 @@ void MediaFormatReader::DecoderFactory::DoCreateDecoder(Data& aData) {
|
||||||
OptionSet(ownerData.mHardwareDecodingDisabled
|
OptionSet(ownerData.mHardwareDecodingDisabled
|
||||||
? Option::HardwareDecoderNotAllowed
|
? Option::HardwareDecoderNotAllowed
|
||||||
: Option::Default),
|
: Option::Default),
|
||||||
OptionSet(lowLatency ? Option::LowLatency : Option::Default),
|
|
||||||
mOwner->mMediaEngineId, mOwner->mTrackingId});
|
mOwner->mMediaEngineId, mOwner->mTrackingId});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,10 +283,6 @@ class TrackInfo {
|
||||||
// rendered directly by non-gecko components.
|
// rendered directly by non-gecko components.
|
||||||
bool mIsRenderedExternally;
|
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 AudioInfo* GetAsAudioInfo() { return nullptr; }
|
||||||
virtual VideoInfo* GetAsVideoInfo() { return nullptr; }
|
virtual VideoInfo* GetAsVideoInfo() { return nullptr; }
|
||||||
virtual TextInfo* GetAsTextInfo() { return nullptr; }
|
virtual TextInfo* GetAsTextInfo() { return nullptr; }
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
#include "DecoderData.h"
|
#include "DecoderData.h"
|
||||||
#include "mozilla/ArrayUtils.h"
|
#include "mozilla/ArrayUtils.h"
|
||||||
#include "mozilla/EndianUtils.h"
|
#include "mozilla/EndianUtils.h"
|
||||||
#include "mozilla/StaticPrefs_media.h"
|
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "VideoUtils.h"
|
#include "VideoUtils.h"
|
||||||
#include "MP4Metadata.h"
|
#include "MP4Metadata.h"
|
||||||
|
|
@ -266,12 +265,8 @@ MediaResult MP4AudioInfo::Update(const Mp4parseTrackInfo* aTrack,
|
||||||
if (aTrack->duration > TimeUnit::MaxTicks()) {
|
if (aTrack->duration > TimeUnit::MaxTicks()) {
|
||||||
mDuration = TimeUnit::FromInfinity();
|
mDuration = TimeUnit::FromInfinity();
|
||||||
} else {
|
} else {
|
||||||
if (aTrack->duration) {
|
|
||||||
mDuration =
|
mDuration =
|
||||||
TimeUnit(AssertedCast<int64_t>(aTrack->duration), aTrack->time_scale);
|
TimeUnit(AssertedCast<int64_t>(aTrack->duration), aTrack->time_scale);
|
||||||
} else {
|
|
||||||
mIsLive = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mMediaTime = TimeUnit(aTrack->media_time, aTrack->time_scale);
|
mMediaTime = TimeUnit(aTrack->media_time, aTrack->time_scale);
|
||||||
mTrackId = aTrack->track_id;
|
mTrackId = aTrack->track_id;
|
||||||
|
|
@ -338,12 +333,8 @@ MediaResult MP4VideoInfo::Update(const Mp4parseTrackInfo* track,
|
||||||
if (track->duration > TimeUnit::MaxTicks()) {
|
if (track->duration > TimeUnit::MaxTicks()) {
|
||||||
mDuration = TimeUnit::FromInfinity();
|
mDuration = TimeUnit::FromInfinity();
|
||||||
} else {
|
} else {
|
||||||
if (track->duration > 0) {
|
|
||||||
mDuration =
|
mDuration =
|
||||||
TimeUnit(AssertedCast<int64_t>(track->duration), track->time_scale);
|
TimeUnit(AssertedCast<int64_t>(track->duration), track->time_scale);
|
||||||
} else {
|
|
||||||
mIsLive = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mMediaTime = TimeUnit(track->media_time, track->time_scale);
|
mMediaTime = TimeUnit(track->media_time, track->time_scale);
|
||||||
mDisplay.width = AssertedCast<int32_t>(video->display_width);
|
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;
|
Mp4parseByteData extraData = video->sample_info[0].extra_data;
|
||||||
// If length is 0 we append nothing
|
// If length is 0 we append nothing
|
||||||
mExtraData->AppendElements(extraData.data, extraData.length);
|
mExtraData->AppendElements(extraData.data, extraData.length);
|
||||||
mIsLive |= StaticPrefs::media_low_latency_decoding_force_enabled();
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ MediaResult WMFVideoMFTManager::InitInternal() {
|
||||||
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
|
attr->SetUINT32(CODECAPI_AVDecNumWorkerThreads,
|
||||||
WMFDecoderModule::GetNumDecoderThreads());
|
WMFDecoderModule::GetNumDecoderThreads());
|
||||||
bool lowLatency = StaticPrefs::media_wmf_low_latency_enabled();
|
bool lowLatency = StaticPrefs::media_wmf_low_latency_enabled();
|
||||||
if (mLowLatency && lowLatency) {
|
if (mLowLatency || lowLatency) {
|
||||||
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
|
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
LOG("Enabling Low Latency Mode");
|
LOG("Enabling Low Latency Mode");
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
#include "gfxUtils.h"
|
#include "gfxUtils.h"
|
||||||
#include "mozilla/EndianUtils.h"
|
#include "mozilla/EndianUtils.h"
|
||||||
#include "mozilla/SharedThreadPool.h"
|
#include "mozilla/SharedThreadPool.h"
|
||||||
#include "mozilla/StaticPrefs_media.h"
|
|
||||||
#include "MediaDataDemuxer.h"
|
#include "MediaDataDemuxer.h"
|
||||||
#include "nsAutoRef.h"
|
#include "nsAutoRef.h"
|
||||||
#include "NesteggPacketHolder.h"
|
#include "NesteggPacketHolder.h"
|
||||||
|
|
@ -382,28 +381,9 @@ nsresult WebMDemuxer::ReadMetadata() {
|
||||||
uint64_t duration = 0;
|
uint64_t duration = 0;
|
||||||
r = nestegg_duration(context, &duration);
|
r = nestegg_duration(context, &duration);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
// It's technically possible to have duration be > INT64_MAX here.
|
mInfo.mVideo.mDuration = TimeUnit::FromNanoseconds(duration);
|
||||||
// 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 {
|
WEBM_DEBUG("stream duration: %lf\n", mInfo.mVideo.mDuration.ToSeconds());
|
||||||
mInfo.mVideo.mDuration = TimeUnit::FromInfinity();
|
|
||||||
mInfo.mVideo.mIsLive = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
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");
|
|
||||||
|
|
||||||
mInfo.mVideo.mCrypto = GetTrackCrypto(TrackInfo::kVideoTrack, track);
|
mInfo.mVideo.mCrypto = GetTrackCrypto(TrackInfo::kVideoTrack, track);
|
||||||
if (mInfo.mVideo.mCrypto.IsEncrypted()) {
|
if (mInfo.mVideo.mCrypto.IsEncrypted()) {
|
||||||
MOZ_ASSERT(mInfo.mVideo.mCrypto.mCryptoScheme == CryptoScheme::Cenc,
|
MOZ_ASSERT(mInfo.mVideo.mCrypto.mCryptoScheme == CryptoScheme::Cenc,
|
||||||
|
|
@ -488,27 +468,10 @@ nsresult WebMDemuxer::ReadMetadata() {
|
||||||
uint64_t duration = 0;
|
uint64_t duration = 0;
|
||||||
r = nestegg_duration(context, &duration);
|
r = nestegg_duration(context, &duration);
|
||||||
if (!r) {
|
if (!r) {
|
||||||
// It's technically possible to have duration be > INT64_MAX here.
|
mInfo.mAudio.mDuration = TimeUnit::FromNanoseconds(duration);
|
||||||
// When that's the case, use a lower resolution TimeUnit
|
WEBM_DEBUG("audio track duration: %lf",
|
||||||
if (duration <= std::numeric_limits<int64_t>::max()) {
|
mInfo.mAudio.mDuration.ToSeconds());
|
||||||
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.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);
|
mInfo.mAudio.mCrypto = GetTrackCrypto(TrackInfo::kAudioTrack, track);
|
||||||
if (mInfo.mAudio.mCrypto.IsEncrypted()) {
|
if (mInfo.mAudio.mCrypto.IsEncrypted()) {
|
||||||
MOZ_ASSERT(mInfo.mAudio.mCrypto.mCryptoScheme == CryptoScheme::Cenc,
|
MOZ_ASSERT(mInfo.mAudio.mCrypto.mCryptoScheme == CryptoScheme::Cenc,
|
||||||
|
|
|
||||||
|
|
@ -10117,12 +10117,6 @@
|
||||||
value: false
|
value: false
|
||||||
mirror: always
|
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
|
#ifdef MOZ_WMF
|
||||||
|
|
||||||
- name: media.wmf.enabled
|
- name: media.wmf.enabled
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue