diff options
author | trav90 <travawine@palemoon.org> | 2018-10-08 21:14:24 -0500 |
---|---|---|
committer | trav90 <travawine@palemoon.org> | 2018-10-08 21:14:24 -0500 |
commit | 55c6aa422da84f581c3bbb0d2c0fa9b282a9d669 (patch) | |
tree | 069b71cf5291b89eef87b8f43f1ed9b0da57fb7b /dom/media/platforms/agnostic/VPXDecoder.h | |
parent | 2a00bf1262c48b5f90b8ff2ed81ef4b0bb97e930 (diff) | |
download | UXP-55c6aa422da84f581c3bbb0d2c0fa9b282a9d669.tar UXP-55c6aa422da84f581c3bbb0d2c0fa9b282a9d669.tar.gz UXP-55c6aa422da84f581c3bbb0d2c0fa9b282a9d669.tar.lz UXP-55c6aa422da84f581c3bbb0d2c0fa9b282a9d669.tar.xz UXP-55c6aa422da84f581c3bbb0d2c0fa9b282a9d669.zip |
Implement keyframe and framesize VPXDecoder helpers
Encapsulate code from WebMDemuxer to query keyframe and frame resolution inside VPXDecoder, so we have a clean wrapper for all the libvpx functions we use.
Diffstat (limited to 'dom/media/platforms/agnostic/VPXDecoder.h')
-rw-r--r-- | dom/media/platforms/agnostic/VPXDecoder.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dom/media/platforms/agnostic/VPXDecoder.h b/dom/media/platforms/agnostic/VPXDecoder.h index 4d57ebf94..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 @@ -47,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); |