Bug 1221991 - [1.3] Make SupportsMimeType a const function. r=jya

This commit is contained in:
Eugen Sawin 2015-11-04 16:01:51 +01:00
parent 74d8258add
commit 81ff3f75e8
17 changed files with 21 additions and 19 deletions

View File

@ -227,7 +227,7 @@ PDMFactory::CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
}
bool
PDMFactory::SupportsMimeType(const nsACString& aMimeType)
PDMFactory::SupportsMimeType(const nsACString& aMimeType) const
{
if (mEMEPDM) {
return mEMEPDM->SupportsMimeType(aMimeType);
@ -305,7 +305,7 @@ PDMFactory::StartupPDM(PlatformDecoderModule* aPDM)
}
already_AddRefed<PlatformDecoderModule>
PDMFactory::GetDecoder(const nsACString& aMimeType)
PDMFactory::GetDecoder(const nsACString& aMimeType) const
{
RefPtr<PlatformDecoderModule> pdm;
for (auto& current : mCurrentPDMs) {

View File

@ -35,7 +35,7 @@ public:
layers::LayersBackend aLayersBackend = layers::LayersBackend::LAYERS_NONE,
layers::ImageContainer* aImageContainer = nullptr);
bool SupportsMimeType(const nsACString& aMimeType);
bool SupportsMimeType(const nsACString& aMimeType) const;
#ifdef MOZ_EME
// Creates a PlatformDecoderModule that uses a CDMProxy to decrypt or
@ -52,7 +52,9 @@ private:
// Startup the provided PDM and add it to our list if successful.
bool StartupPDM(PlatformDecoderModule* aPDM);
// Returns the first PDM in our list supporting the mimetype.
already_AddRefed<PlatformDecoderModule> GetDecoder(const nsACString& aMimeType);
already_AddRefed<PlatformDecoderModule>
GetDecoder(const nsACString& aMimeType) const;
already_AddRefed<MediaDataDecoder>
CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
const TrackInfo& aConfig,

View File

@ -12,7 +12,7 @@
namespace mozilla {
bool
AgnosticDecoderModule::SupportsMimeType(const nsACString& aMimeType)
AgnosticDecoderModule::SupportsMimeType(const nsACString& aMimeType) const
{
return VPXDecoder::IsVPX(aMimeType) ||
OpusDataDecoder::IsOpus(aMimeType) ||

View File

@ -10,7 +10,7 @@ public:
AgnosticDecoderModule() = default;
virtual ~AgnosticDecoderModule() = default;
bool SupportsMimeType(const nsACString& aMimeType) override;
bool SupportsMimeType(const nsACString& aMimeType) const override;
ConversionRequired
DecoderNeedsConversion(const TrackInfo& aConfig) const override

View File

@ -246,7 +246,7 @@ public:
}
bool
SupportsMimeType(const nsACString& aMimeType) override
SupportsMimeType(const nsACString& aMimeType) const override
{
return true;
}

View File

@ -303,7 +303,7 @@ EMEDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
}
bool
EMEDecoderModule::SupportsMimeType(const nsACString& aMimeType)
EMEDecoderModule::SupportsMimeType(const nsACString& aMimeType) const
{
Maybe<nsCString> gmp;
gmp.emplace(NS_ConvertUTF16toUTF8(mProxy->KeySystem()));

View File

@ -45,7 +45,7 @@ protected:
DecoderNeedsConversion(const TrackInfo& aConfig) const override;
bool
SupportsMimeType(const nsACString& aMimeType) override;
SupportsMimeType(const nsACString& aMimeType) const override;
private:
RefPtr<CDMProxy> mProxy;

View File

@ -228,7 +228,7 @@ GMPDecoderModule::SupportsMimeType(const nsACString& aMimeType,
}
bool
GMPDecoderModule::SupportsMimeType(const nsACString& aMimeType)
GMPDecoderModule::SupportsMimeType(const nsACString& aMimeType) const
{
return SupportsMimeType(aMimeType, PreferredGMP(aMimeType));
}

View File

@ -36,7 +36,7 @@ public:
DecoderNeedsConversion(const TrackInfo& aConfig) const override;
bool
SupportsMimeType(const nsACString& aMimeType) override;
SupportsMimeType(const nsACString& aMimeType) const override;
// Main thread only.
static void Init();

View File

@ -36,7 +36,7 @@ public:
AndroidDecoderModule() {}
virtual ~AndroidDecoderModule() {}
bool SupportsMimeType(const nsACString& aMimeType) override;
bool SupportsMimeType(const nsACString& aMimeType) const override;
ConversionRequired
DecoderNeedsConversion(const TrackInfo& aConfig) const override;

View File

@ -117,7 +117,7 @@ AppleDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig,
}
bool
AppleDecoderModule::SupportsMimeType(const nsACString& aMimeType)
AppleDecoderModule::SupportsMimeType(const nsACString& aMimeType) const
{
return (sIsCoreMediaAvailable &&
(aMimeType.EqualsLiteral("audio/mpeg") ||

View File

@ -32,7 +32,7 @@ public:
FlushableTaskQueue* aAudioTaskQueue,
MediaDataDecoderCallback* aCallback) override;
bool SupportsMimeType(const nsACString& aMimeType) override;
bool SupportsMimeType(const nsACString& aMimeType) const override;
ConversionRequired
DecoderNeedsConversion(const TrackInfo& aConfig) const override;

View File

@ -61,7 +61,7 @@ public:
return decoder.forget();
}
bool SupportsMimeType(const nsACString& aMimeType) override
bool SupportsMimeType(const nsACString& aMimeType) const override
{
AVCodecID audioCodec = FFmpegAudioDecoder<V>::GetCodecId(aMimeType);
AVCodecID videoCodec = FFmpegH264Decoder<V>::GetCodecId(aMimeType);

View File

@ -61,7 +61,7 @@ GonkDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
}
bool
GonkDecoderModule::SupportsMimeType(const nsACString& aMimeType)
GonkDecoderModule::SupportsMimeType(const nsACString& aMimeType) const
{
return aMimeType.EqualsLiteral("audio/mp4a-latm") ||
aMimeType.EqualsLiteral("audio/3gpp") ||

View File

@ -35,7 +35,7 @@ public:
ConversionRequired
DecoderNeedsConversion(const TrackInfo& aConfig) const override;
bool SupportsMimeType(const nsACString& aMimeType) override;
bool SupportsMimeType(const nsACString& aMimeType) const override;
};

View File

@ -164,7 +164,7 @@ CanCreateWMFDecoder()
}
bool
WMFDecoderModule::SupportsMimeType(const nsACString& aMimeType)
WMFDecoderModule::SupportsMimeType(const nsACString& aMimeType) const
{
if ((aMimeType.EqualsLiteral("audio/mp4a-latm") ||
aMimeType.EqualsLiteral("audio/mp4")) &&

View File

@ -31,7 +31,7 @@ public:
FlushableTaskQueue* aAudioTaskQueue,
MediaDataDecoderCallback* aCallback) override;
bool SupportsMimeType(const nsACString& aMimeType) override;
bool SupportsMimeType(const nsACString& aMimeType) const override;
ConversionRequired
DecoderNeedsConversion(const TrackInfo& aConfig) const override;