зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1407919 - Part6 - Check bit depth in WebMDecoder to determine if we support HDR. r=gerald
MozReview-Commit-ID: Jq569mlINNh --HG-- extra : rebase_source : 57a352d9e621fc9a204f8865784332ec9aab96a5
This commit is contained in:
Родитель
fe306cda12
Коммит
638d7ea11b
|
@ -10,6 +10,7 @@
|
||||||
#include "AOMDecoder.h"
|
#include "AOMDecoder.h"
|
||||||
#endif
|
#endif
|
||||||
#include "MediaContainerType.h"
|
#include "MediaContainerType.h"
|
||||||
|
#include "PDMFactory.h"
|
||||||
#include "VideoUtils.h"
|
#include "VideoUtils.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
@ -41,9 +42,30 @@ WebMDecoder::IsSupportedType(const MediaContainerType& aContainerType)
|
||||||
// Note: Only accept VP8/VP9 in a video container type, not in an audio
|
// Note: Only accept VP8/VP9 in a video container type, not in an audio
|
||||||
// container type.
|
// container type.
|
||||||
|
|
||||||
if (isVideo &&
|
if (isVideo) {
|
||||||
(IsVP8CodecString(codec) || IsVP9CodecString(codec))) {
|
UniquePtr<TrackInfo> trackInfo;
|
||||||
continue;
|
if (IsVP9CodecString(codec)) {
|
||||||
|
trackInfo = CreateTrackInfoWithMIMETypeAndContainerTypeExtraParameters(
|
||||||
|
NS_LITERAL_CSTRING("video/vp9"), aContainerType);
|
||||||
|
} else if (IsVP8CodecString(codec)) {
|
||||||
|
trackInfo = CreateTrackInfoWithMIMETypeAndContainerTypeExtraParameters(
|
||||||
|
NS_LITERAL_CSTRING("video/vp8"), aContainerType);
|
||||||
|
}
|
||||||
|
// If it is vp8 or vp9, check the bit depth.
|
||||||
|
if (trackInfo) {
|
||||||
|
uint8_t profile = 0;
|
||||||
|
uint8_t level = 0;
|
||||||
|
uint8_t bitDepth = 0;
|
||||||
|
if (ExtractVPXCodecDetails(codec, profile, level, bitDepth)) {
|
||||||
|
trackInfo->GetAsVideoInfo()->mBitDepth = bitDepth;
|
||||||
|
}
|
||||||
|
// Verify that we have a PDM that supports this bit depth.
|
||||||
|
RefPtr<PDMFactory> platform = new PDMFactory();
|
||||||
|
if (!platform->Supports(*trackInfo, nullptr)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef MOZ_AV1
|
#ifdef MOZ_AV1
|
||||||
if (isVideo && AOMDecoder::IsSupportedCodec(codec)) {
|
if (isVideo && AOMDecoder::IsSupportedCodec(codec)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче