Shaka Packager SDK
vp8_parser.h
1 // Copyright 2015 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef PACKAGER_MEDIA_CODECS_VP8_PARSER_H_
8 #define PACKAGER_MEDIA_CODECS_VP8_PARSER_H_
9 
10 #include <stdint.h>
11 #include <stdlib.h>
12 
13 #include "packager/base/macros.h"
14 #include "packager/media/codecs/vpx_parser.h"
15 
16 namespace shaka {
17 namespace media {
18 
21 class VP8Parser : public VPxParser {
22  public:
23  VP8Parser();
24  ~VP8Parser() override;
25 
32  bool Parse(const uint8_t* data,
33  size_t data_size,
34  std::vector<VPxFrameInfo>* vpx_frames) override;
35 
41  static bool IsKeyframe(const uint8_t* data, size_t data_size);
42 
43  private:
44  // Keep track of the current width and height. Note that they may change from
45  // frame to frame.
46  uint32_t width_;
47  uint32_t height_;
48 
49  DISALLOW_COPY_AND_ASSIGN(VP8Parser);
50 };
51 
52 } // namespace media
53 } // namespace shaka
54 
55 #endif // PACKAGER_MEDIA_CODECS_VP8_PARSER_H_
shaka::media::VPxParser
Definition: vpx_parser.h:27
shaka
All the methods that are virtual are virtual for mocking.
Definition: gflags_hex_bytes.cc:11
shaka::media::VP8Parser
Definition: vp8_parser.h:21
shaka::media::VP8Parser::Parse
bool Parse(const uint8_t *data, size_t data_size, std::vector< VPxFrameInfo > *vpx_frames) override
Definition: vp8_parser.cc:100
shaka::media::VP8Parser::IsKeyframe
static bool IsKeyframe(const uint8_t *data, size_t data_size)
Definition: vp8_parser.cc:179