mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
Issue #1820 - Part 8: Check bit depth in PDM::Supports.
This commit is contained in:
parent
c8637cc239
commit
009fb3146f
3 changed files with 38 additions and 4 deletions
|
|
@ -129,9 +129,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 {
|
||||
|
|
@ -153,6 +155,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue