mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 02:17:34 +09:00
[vpx] Store VPXDecoder codec as an enum
Use the enum we already have here instead of converting to an int when we pass it around, giving us better type checking.
This commit is contained in:
parent
e7d7e0d2bf
commit
0c88f36323
2 changed files with 5 additions and 4 deletions
|
|
@ -22,7 +22,7 @@ namespace mozilla {
|
||||||
using namespace gfx;
|
using namespace gfx;
|
||||||
using namespace layers;
|
using namespace layers;
|
||||||
|
|
||||||
static int MimeTypeToCodec(const nsACString& aMimeType)
|
static VPXDecoder::Codec MimeTypeToCodec(const nsACString& aMimeType)
|
||||||
{
|
{
|
||||||
if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
|
if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
|
||||||
return VPXDecoder::Codec::VP8;
|
return VPXDecoder::Codec::VP8;
|
||||||
|
|
@ -31,7 +31,7 @@ static int MimeTypeToCodec(const nsACString& aMimeType)
|
||||||
} else if (aMimeType.EqualsLiteral("video/vp9")) {
|
} else if (aMimeType.EqualsLiteral("video/vp9")) {
|
||||||
return VPXDecoder::Codec::VP9;
|
return VPXDecoder::Codec::VP9;
|
||||||
}
|
}
|
||||||
return -1;
|
return VPXDecoder::Codec::Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
VPXDecoder::VPXDecoder(const CreateDecoderParams& aParams)
|
VPXDecoder::VPXDecoder(const CreateDecoderParams& aParams)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,8 @@ public:
|
||||||
|
|
||||||
enum Codec: uint8_t {
|
enum Codec: uint8_t {
|
||||||
VP8 = 1 << 0,
|
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
|
// Return true if aMimeType is a one of the strings used by our demuxers to
|
||||||
|
|
@ -61,7 +62,7 @@ private:
|
||||||
|
|
||||||
const VideoInfo& mInfo;
|
const VideoInfo& mInfo;
|
||||||
|
|
||||||
const int mCodec;
|
const Codec mCodec;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue