summaryrefslogtreecommitdiff
path: root/dom/media/platforms/PlatformDecoderModule.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/platforms/PlatformDecoderModule.h')
-rw-r--r--dom/media/platforms/PlatformDecoderModule.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/dom/media/platforms/PlatformDecoderModule.h b/dom/media/platforms/PlatformDecoderModule.h
index 54feb13c7..1507b4492 100644
--- a/dom/media/platforms/PlatformDecoderModule.h
+++ b/dom/media/platforms/PlatformDecoderModule.h
@@ -125,9 +125,11 @@ public:
virtual bool Supports(const TrackInfo& aTrackInfo,
DecoderDoctorDiagnostics* aDiagnostics) const
{
- // By default, fall back to SupportsMimeType with just the MIME string.
- // (So PDMs do not need to override this method -- yet.)
- return SupportsMimeType(aTrackInfo.mMimeType, aDiagnostics);
+ if (!SupportsMimeType(aTrackInfo.mMimeType, aDiagnostics)) {
+ return false;
+ }
+ const auto videoInfo = aTrackInfo.GetAsVideoInfo();
+ return !videoInfo || SupportsBitDepth(videoInfo->mBitDepth, aDiagnostics);
}
enum class ConversionRequired : uint8_t {
@@ -149,6 +151,15 @@ protected:
friend class PDMFactory;
friend class dom::RemoteDecoderModule;
+ // Indicates if the PlatformDecoderModule supports decoding of aBitDepth.
+ // Should override this method when the platform can support bitDepth != 8.
+ virtual bool SupportsBitDepth(const uint8_t aBitDepth,
+ DecoderDoctorDiagnostics* aDiagnostics) const
+ {
+ return aBitDepth == 8;
+ }
+
+
// Creates a Video decoder. The layers backend is passed in so that
// decoders can determine whether hardware accelerated decoding can be used.
// Asynchronous decoding of video should be done in runnables dispatched