Shaka Packager SDK
vpx_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_VPX_PARSER_H_
8 #define PACKAGER_MEDIA_CODECS_VPX_PARSER_H_
9 
10 #include <stdint.h>
11 #include <stdlib.h>
12 
13 #include "packager/base/macros.h"
14 #include "packager/media/codecs/vp_codec_configuration_record.h"
15 
16 namespace shaka {
17 namespace media {
18 
19 struct VPxFrameInfo {
20  size_t frame_size;
21  size_t uncompressed_header_size;
22  bool is_keyframe;
23  uint32_t width;
24  uint32_t height;
25 };
26 
27 class VPxParser {
28  public:
29  VPxParser() {}
30  virtual ~VPxParser() {}
31 
38  virtual bool Parse(const uint8_t* data,
39  size_t data_size,
40  std::vector<VPxFrameInfo>* vpx_frames) = 0;
41 
45  return codec_config_;
46  }
47 
48  protected:
49  VPCodecConfigurationRecord* writable_codec_config() { return &codec_config_; }
50 
51  private:
52  VPCodecConfigurationRecord codec_config_;
53 
54  DISALLOW_COPY_AND_ASSIGN(VPxParser);
55 };
56 
57 } // namespace media
58 } // namespace shaka
59 
60 #endif // PACKAGER_MEDIA_CODECS_VPX_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::VPCodecConfigurationRecord
Class for parsing or writing VP codec configuration record.
Definition: vp_codec_configuration_record.h:153
shaka::media::VPxParser::Parse
virtual bool Parse(const uint8_t *data, size_t data_size, std::vector< VPxFrameInfo > *vpx_frames)=0
shaka::media::VPxFrameInfo
Definition: vpx_parser.h:19
shaka::media::VPxParser::codec_config
const VPCodecConfigurationRecord & codec_config() const
Definition: vpx_parser.h:44