Shaka Packager SDK
Loading...
Searching...
No Matches
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 PACKAGER_MEDIA_FORMATS_WEBM_WEBM_VIDEO_CLIENT_H_
6#define PACKAGER_MEDIA_FORMATS_WEBM_WEBM_VIDEO_CLIENT_H_
7
8#include <cstdint>
9#include <memory>
10#include <string>
11#include <vector>
12
13#include <packager/macros/classes.h>
14#include <packager/media/base/video_stream_info.h>
15#include <packager/media/codecs/vp_codec_configuration_record.h>
16#include <packager/media/formats/webm/webm_parser.h>
17
18namespace shaka {
19namespace media {
20class VideoDecoderConfig;
21
24 public:
26 ~WebMVideoClient() override;
27
29 void Reset();
30
37 std::shared_ptr<VideoStreamInfo> GetVideoStreamInfo(
38 int64_t track_num,
39 const std::string& codec_id,
40 const std::vector<uint8_t>& codec_private,
41 bool is_encrypted);
42
46 const std::vector<uint8_t>& codec_private);
47
49 bool HasColorInfo() const;
50
52 std::vector<uint8_t> GenerateColrBoxData() const;
53
54 private:
55 friend class WebMVideoClientTest; // For testing
56
57 // WebMParserClient implementation.
58 WebMParserClient* OnListStart(int id) override;
59 bool OnListEnd(int id) override;
60 bool OnUInt(int id, int64_t val) override;
61 bool OnBinary(int id, const uint8_t* data, int size) override;
62 bool OnFloat(int id, double val) override;
63
64 int64_t pixel_width_ = -1;
65 int64_t pixel_height_ = -1;
66 int64_t crop_bottom_ = -1;
67 int64_t crop_top_ = -1;
68 int64_t crop_left_ = -1;
69 int64_t crop_right_ = -1;
70 int64_t display_width_ = -1;
71 int64_t display_height_ = -1;
72 int64_t display_unit_ = -1;
73 int64_t alpha_mode_ = -1;
74
75 int64_t matrix_coefficients_ = -1;
76 int64_t bits_per_channel_ = -1;
77 int64_t chroma_subsampling_horz_ = -1;
78 int64_t chroma_subsampling_vert_ = -1;
79 int64_t chroma_siting_horz_ = -1;
80 int64_t chroma_siting_vert_ = -1;
81 int64_t color_range_ = -1;
82 int64_t transfer_characteristics_ = -1;
83 int64_t color_primaries_ = -1;
84
85 DISALLOW_COPY_AND_ASSIGN(WebMVideoClient);
86};
87
88} // namespace media
89} // namespace shaka
90
91#endif // PACKAGER_MEDIA_FORMATS_WEBM_WEBM_VIDEO_CLIENT_H_
Class for parsing or writing VP codec configuration record.
Helper class used to parse a Video element inside a TrackEntry element.
bool HasColorInfo() const
Check if color information is available.
std::vector< uint8_t > GenerateColrBoxData() const
Generate MP4 colr box data from color information.
std::shared_ptr< VideoStreamInfo > GetVideoStreamInfo(int64_t track_num, const std::string &codec_id, const std::vector< uint8_t > &codec_private, bool is_encrypted)
VPCodecConfigurationRecord GetVpCodecConfig(const std::vector< uint8_t > &codec_private)
void Reset()
Reset this object's state so it can process a new video track element.
All the methods that are virtual are virtual for mocking.