DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
vp9_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 MEDIA_FILTERS_VP9_PARSER_H_
8 #define MEDIA_FILTERS_VP9_PARSER_H_
9 
10 #include <stdint.h>
11 #include <stdlib.h>
12 
13 #include "packager/base/macros.h"
14 #include "packager/base/memory/scoped_ptr.h"
15 #include "packager/media/filters/vp_codec_configuration.h"
16 
17 namespace edash_packager {
18 namespace media {
19 
20 struct VPxFrameInfo {
21  size_t frame_size;
22  size_t uncompressed_header_size;
23  bool is_key_frame;
24  uint32_t width;
25  uint32_t height;
26 };
27 
29 class VP9Parser {
30  public:
31  VP9Parser();
32  ~VP9Parser();
33 
40  bool Parse(const uint8_t* data,
41  size_t data_size,
42  std::vector<VPxFrameInfo>* vpx_frames);
43 
46  const VPCodecConfiguration& codec_config() { return codec_config_; }
47 
48  private:
49  // Keep track of the current width and height. Note that they may change from
50  // frame to frame.
51  uint32_t width_;
52  uint32_t height_;
53 
54  VPCodecConfiguration codec_config_;
55 
56  DISALLOW_COPY_AND_ASSIGN(VP9Parser);
57 };
58 
59 } // namespace media
60 } // namespace edash_packager
61 
62 #endif // MEDIA_FILTERS_VP9_PARSER_H_
bool Parse(const uint8_t *data, size_t data_size, std::vector< VPxFrameInfo > *vpx_frames)
Definition: vp9_parser.cc:429
Class to parse a vp9 bit stream.
Definition: vp9_parser.h:29
const VPCodecConfiguration & codec_config()
Definition: vp9_parser.h:46
Class for parsing or writing VP codec configuration data.