Shaka Packager SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
webm_video_client.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef MEDIA_FORMATS_WEBM_WEBM_VIDEO_CLIENT_H_
6 #define MEDIA_FORMATS_WEBM_WEBM_VIDEO_CLIENT_H_
7 
8 #include <memory>
9 #include <string>
10 #include <vector>
11 
12 #include "packager/media/base/video_stream_info.h"
13 #include "packager/media/codecs/vp_codec_configuration_record.h"
14 #include "packager/media/formats/webm/webm_parser.h"
15 
16 namespace shaka {
17 namespace media {
18 class VideoDecoderConfig;
19 
22  public:
24  ~WebMVideoClient() override;
25 
27  void Reset();
28 
35  std::shared_ptr<VideoStreamInfo> GetVideoStreamInfo(
36  int64_t track_num,
37  const std::string& codec_id,
38  bool is_encrypted);
39 
43  const std::vector<uint8_t>& codec_private);
44 
45  private:
46  // WebMParserClient implementation.
47  WebMParserClient* OnListStart(int id) override;
48  bool OnListEnd(int id) override;
49  bool OnUInt(int id, int64_t val) override;
50  bool OnBinary(int id, const uint8_t* data, int size) override;
51  bool OnFloat(int id, double val) override;
52 
53  int64_t pixel_width_;
54  int64_t pixel_height_;
55  int64_t crop_bottom_;
56  int64_t crop_top_;
57  int64_t crop_left_;
58  int64_t crop_right_;
59  int64_t display_width_;
60  int64_t display_height_;
61  int64_t display_unit_;
62  int64_t alpha_mode_;
63 
64  VPCodecConfigurationRecord vp_config_;
65  int64_t chroma_subsampling_horz_;
66  int64_t chroma_subsampling_vert_;
67  int64_t chroma_siting_horz_;
68  int64_t chroma_siting_vert_;
69 
70  DISALLOW_COPY_AND_ASSIGN(WebMVideoClient);
71 };
72 
73 } // namespace media
74 } // namespace shaka
75 
76 #endif // MEDIA_FORMATS_WEBM_WEBM_VIDEO_CLIENT_H_
void Reset()
Reset this object's state so it can process a new video track element.
Class for parsing or writing VP codec configuration record.
std::shared_ptr< VideoStreamInfo > GetVideoStreamInfo(int64_t track_num, const std::string &codec_id, bool is_encrypted)
Helper class used to parse a Video element inside a TrackEntry element.
const VPCodecConfigurationRecord & GetVpCodecConfig(const std::vector< uint8_t > &codec_private)