зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1358662 - Store VPXDecoder codec as an enum. r=jya
Use the enum we already have here instead of converting to an int when we pass it around, giving us better type checking. MozReview-Commit-ID: Gj4xmtQnzw2 --HG-- extra : rebase_source : 95f582e655f1a942dfb68cbba588c44afbb8a38f
This commit is contained in:
Родитель
afff134a91
Коммит
83de6e82b7
|
@ -22,7 +22,7 @@ namespace mozilla {
|
|||
using namespace gfx;
|
||||
using namespace layers;
|
||||
|
||||
static int MimeTypeToCodec(const nsACString& aMimeType)
|
||||
static VPXDecoder::Codec MimeTypeToCodec(const nsACString& aMimeType)
|
||||
{
|
||||
if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
|
||||
return VPXDecoder::Codec::VP8;
|
||||
|
@ -31,13 +31,13 @@ static int MimeTypeToCodec(const nsACString& aMimeType)
|
|||
} else if (aMimeType.EqualsLiteral("video/vp9")) {
|
||||
return VPXDecoder::Codec::VP9;
|
||||
}
|
||||
return -1;
|
||||
return VPXDecoder::Codec::Unknown;
|
||||
}
|
||||
|
||||
static nsresult
|
||||
InitContext(vpx_codec_ctx_t* aCtx,
|
||||
const VideoInfo& aInfo,
|
||||
const int aCodec)
|
||||
const VPXDecoder::Codec aCodec)
|
||||
{
|
||||
int decode_threads = 2;
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@ public:
|
|||
enum Codec: uint8_t
|
||||
{
|
||||
VP8 = 1 << 0,
|
||||
VP9 = 1 << 1
|
||||
VP9 = 1 << 1,
|
||||
Unknown = 1 << 7,
|
||||
};
|
||||
|
||||
// Return true if aMimeType is a one of the strings used by our demuxers to
|
||||
|
@ -60,7 +61,7 @@ private:
|
|||
|
||||
const VideoInfo& mInfo;
|
||||
|
||||
const int mCodec;
|
||||
const Codec mCodec;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче