зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1695358 - remove unused DecoderDoctorDiagnostics parameter for 'PDMFactory::SupportsMimeType().' r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D106675
This commit is contained in:
Родитель
3999a44ae4
Коммит
a9da536a9a
|
@ -13,8 +13,7 @@ namespace mozilla {
|
|||
/* static */
|
||||
bool ADTSDecoder::IsEnabled() {
|
||||
RefPtr<PDMFactory> platform = new PDMFactory();
|
||||
return platform->SupportsMimeType("audio/mp4a-latm"_ns,
|
||||
/* DecoderDoctorDiagnostics* */ nullptr);
|
||||
return platform->SupportsMimeType("audio/mp4a-latm"_ns);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -1153,8 +1153,7 @@ void MediaFormatReader::OnDemuxerInitDone(const MediaResult& aResult) {
|
|||
UniquePtr<TrackInfo> videoInfo = mVideo.mTrackDemuxer->GetInfo();
|
||||
videoActive = videoInfo && videoInfo->IsValid();
|
||||
if (videoActive) {
|
||||
if (platform &&
|
||||
!platform->SupportsMimeType(videoInfo->mMimeType, nullptr)) {
|
||||
if (platform && !platform->SupportsMimeType(videoInfo->mMimeType)) {
|
||||
// We have no decoder for this track. Error.
|
||||
mMetadataPromise.Reject(NS_ERROR_DOM_MEDIA_METADATA_ERR, __func__);
|
||||
return;
|
||||
|
@ -1183,9 +1182,9 @@ void MediaFormatReader::OnDemuxerInitDone(const MediaResult& aResult) {
|
|||
|
||||
UniquePtr<TrackInfo> audioInfo = mAudio.mTrackDemuxer->GetInfo();
|
||||
// We actively ignore audio tracks that we know we can't play.
|
||||
audioActive = audioInfo && audioInfo->IsValid() &&
|
||||
(!platform ||
|
||||
platform->SupportsMimeType(audioInfo->mMimeType, nullptr));
|
||||
audioActive =
|
||||
audioInfo && audioInfo->IsValid() &&
|
||||
(!platform || platform->SupportsMimeType(audioInfo->mMimeType));
|
||||
|
||||
if (audioActive) {
|
||||
mInfo.mAudio = *audioInfo->GetAsAudioInfo();
|
||||
|
|
|
@ -13,8 +13,7 @@ namespace mozilla {
|
|||
/* static */
|
||||
bool MP3Decoder::IsEnabled() {
|
||||
RefPtr<PDMFactory> platform = new PDMFactory();
|
||||
return platform->SupportsMimeType("audio/mpeg"_ns,
|
||||
/* DecoderDoctorDiagnostics* */ nullptr);
|
||||
return platform->SupportsMimeType("audio/mpeg"_ns);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -399,13 +399,12 @@ PDMFactory::CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
|
|||
return aPDM->AsyncCreateDecoder(aParams);
|
||||
}
|
||||
|
||||
bool PDMFactory::SupportsMimeType(
|
||||
const nsACString& aMimeType, DecoderDoctorDiagnostics* aDiagnostics) const {
|
||||
bool PDMFactory::SupportsMimeType(const nsACString& aMimeType) const {
|
||||
UniquePtr<TrackInfo> trackInfo = CreateTrackInfoWithMIMEType(aMimeType);
|
||||
if (!trackInfo) {
|
||||
return false;
|
||||
}
|
||||
return Supports(SupportDecoderParams(*trackInfo), aDiagnostics);
|
||||
return Supports(SupportDecoderParams(*trackInfo), nullptr);
|
||||
}
|
||||
|
||||
bool PDMFactory::Supports(const SupportDecoderParams& aParams,
|
||||
|
@ -665,38 +664,38 @@ PDMFactory::MediaCodecsSupported PDMFactory::Supported(bool aForceRefresh) {
|
|||
// available.
|
||||
// This logic will have to be revisited if a PDM supporting either codec
|
||||
// will be added in addition to the WMF and FFmpeg PDM (such as OpenH264)
|
||||
if (pdm->SupportsMimeType("video/avc"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("video/avc"_ns)) {
|
||||
supported += MediaCodecs::H264;
|
||||
}
|
||||
if (pdm->SupportsMimeType("video/vp9"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("video/vp9"_ns)) {
|
||||
supported += MediaCodecs::VP9;
|
||||
}
|
||||
if (pdm->SupportsMimeType("video/vp8"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("video/vp8"_ns)) {
|
||||
supported += MediaCodecs::VP8;
|
||||
}
|
||||
if (pdm->SupportsMimeType("video/av1"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("video/av1"_ns)) {
|
||||
supported += MediaCodecs::AV1;
|
||||
}
|
||||
if (pdm->SupportsMimeType("video/theora"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("video/theora"_ns)) {
|
||||
supported += MediaCodecs::Theora;
|
||||
}
|
||||
if (pdm->SupportsMimeType("audio/mp4a-latm"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("audio/mp4a-latm"_ns)) {
|
||||
supported += MediaCodecs::AAC;
|
||||
}
|
||||
// MP3 can be either decoded by ffvpx or WMF/FFmpeg
|
||||
if (pdm->SupportsMimeType("audio/mpeg"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("audio/mpeg"_ns)) {
|
||||
supported += MediaCodecs::MP3;
|
||||
}
|
||||
if (pdm->SupportsMimeType("audio/opus"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("audio/opus"_ns)) {
|
||||
supported += MediaCodecs::Opus;
|
||||
}
|
||||
if (pdm->SupportsMimeType("audio/vorbis"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("audio/vorbis"_ns)) {
|
||||
supported += MediaCodecs::Vorbis;
|
||||
}
|
||||
if (pdm->SupportsMimeType("audio/flac"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("audio/flac"_ns)) {
|
||||
supported += MediaCodecs::Flac;
|
||||
}
|
||||
if (pdm->SupportsMimeType("audio/x-wav"_ns, nullptr)) {
|
||||
if (pdm->SupportsMimeType("audio/x-wav"_ns)) {
|
||||
supported += MediaCodecs::Wave;
|
||||
}
|
||||
return supported;
|
||||
|
|
|
@ -44,8 +44,7 @@ class PDMFactory final {
|
|||
RefPtr<PDMCreateDecoderPromise> CreateDecoder(
|
||||
const CreateDecoderParams& aParams);
|
||||
|
||||
bool SupportsMimeType(const nsACString& aMimeType,
|
||||
DecoderDoctorDiagnostics* aDiagnostics) const;
|
||||
bool SupportsMimeType(const nsACString& aMimeType) const;
|
||||
bool Supports(const SupportDecoderParams& aParams,
|
||||
DecoderDoctorDiagnostics* aDiagnostics) const;
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ void MediaDecodeTask::OnInitDemuxerCompleted() {
|
|||
UniquePtr<TrackInfo> audioInfo = mTrackDemuxer->GetInfo();
|
||||
// We actively ignore audio tracks that we know we can't play.
|
||||
if (audioInfo && audioInfo->IsValid() &&
|
||||
platform->SupportsMimeType(audioInfo->mMimeType, nullptr)) {
|
||||
platform->SupportsMimeType(audioInfo->mMimeType)) {
|
||||
mMediaInfo.mAudio = *audioInfo->GetAsAudioInfo();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ WebrtcVideoDecoder* MediaDataCodec::CreateDecoder(
|
|||
return nullptr;
|
||||
}
|
||||
RefPtr<PDMFactory> pdm = new PDMFactory();
|
||||
if (!pdm->SupportsMimeType(codec, nullptr /* dddoctor */)) {
|
||||
if (!pdm->SupportsMimeType(codec)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче