diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-10-10 06:37:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 06:37:08 +0200 |
commit | ea5b5766a92bc13fc7eb9dc484e133a7a0638d50 (patch) | |
tree | a986c0e98d6c437ee1da1cc0ed0e318cf2132942 /dom/media/platforms/agnostic/VPXDecoder.h | |
parent | 237f05bcdc3e5e1316b5454a43ffaecd4ff12577 (diff) | |
parent | 81c39ba87667566a83febdc8c22e300ea8313897 (diff) | |
download | UXP-ea5b5766a92bc13fc7eb9dc484e133a7a0638d50.tar UXP-ea5b5766a92bc13fc7eb9dc484e133a7a0638d50.tar.gz UXP-ea5b5766a92bc13fc7eb9dc484e133a7a0638d50.tar.lz UXP-ea5b5766a92bc13fc7eb9dc484e133a7a0638d50.tar.xz UXP-ea5b5766a92bc13fc7eb9dc484e133a7a0638d50.zip |
Merge pull request #830 from trav90/media-work
Several WebM/VPX fixes
Diffstat (limited to 'dom/media/platforms/agnostic/VPXDecoder.h')
-rw-r--r-- | dom/media/platforms/agnostic/VPXDecoder.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/dom/media/platforms/agnostic/VPXDecoder.h b/dom/media/platforms/agnostic/VPXDecoder.h index d420ec069..4e8d83617 100644 --- a/dom/media/platforms/agnostic/VPXDecoder.h +++ b/dom/media/platforms/agnostic/VPXDecoder.h @@ -7,6 +7,7 @@ #define VPXDecoder_h_ #include "PlatformDecoderModule.h" +#include "mozilla/Span.h" #include <stdint.h> #define VPX_DONT_DEFINE_STDINT_TYPES @@ -36,7 +37,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 @@ -46,6 +48,12 @@ public: static bool IsVP8(const nsACString& aMimeType); static bool IsVP9(const nsACString& aMimeType); + // Return true if a sample is a keyframe for the specified codec. + static bool IsKeyframe(Span<const uint8_t> aBuffer, Codec aCodec); + + // Return the frame dimensions for a sample for the specified codec. + static nsIntSize GetFrameSize(Span<const uint8_t> aBuffer, Codec aCodec); + private: void ProcessDecode(MediaRawData* aSample); MediaResult DoDecode(MediaRawData* aSample); @@ -61,7 +69,7 @@ private: const VideoInfo& mInfo; - const int mCodec; + const Codec mCodec; }; } // namespace mozilla |