7 #ifndef PACKAGER_MEDIA_BASE_VIDEO_STREAM_INFO_H_
8 #define PACKAGER_MEDIA_BASE_VIDEO_STREAM_INFO_H_
10 #include <packager/media/base/stream_info.h>
15 enum class H26xStreamFormat {
18 kNalUnitStreamWithParameterSetNalus,
19 kNalUnitStreamWithoutParameterSetNalus,
34 H26xStreamFormat h26x_stream_format,
35 const std::string& codec_string,
36 const uint8_t* codec_config,
37 size_t codec_config_size,
42 uint8_t color_primaries,
43 uint8_t matrix_coefficients,
44 uint8_t transfer_characteristics,
45 uint32_t trick_play_factor,
46 uint8_t nalu_length_size,
47 const std::string& language,
55 std::string
ToString()
const override;
56 std::unique_ptr<StreamInfo>
Clone()
const override;
59 const std::string supplemental_codec()
const {
return supplemental_codec_; }
60 FourCC compatible_brand()
const {
return compatible_brand_; }
61 const std::vector<uint8_t>& extra_config()
const {
return extra_config_; }
62 H26xStreamFormat h26x_stream_format()
const {
return h26x_stream_format_; }
63 uint32_t width()
const {
return width_; }
64 uint32_t height()
const {
return height_; }
71 uint8_t transfer_characteristics()
const {
return transfer_characteristics_; }
72 uint8_t color_primaries()
const {
return color_primaries_; }
73 uint8_t matrix_coefficients()
const {
return matrix_coefficients_; }
74 uint8_t nalu_length_size()
const {
return nalu_length_size_; }
75 uint32_t trick_play_factor()
const {
return trick_play_factor_; }
76 uint32_t playback_rate()
const {
return playback_rate_; }
77 const std::vector<uint8_t>& eme_init_data()
const {
return eme_init_data_; }
78 const std::vector<uint8_t>& colr_data()
const {
return colr_data_; }
80 void set_supplemental_codec(
const std::string supplemental_codec) {
81 supplemental_codec_ = supplemental_codec;
84 void set_compatible_brand(
const FourCC compatible_brand) {
85 compatible_brand_ = compatible_brand;
88 void set_extra_config(
const std::vector<uint8_t>& extra_config) {
89 extra_config_ = extra_config;
91 void set_width(uint32_t width) { width_ = width; }
92 void set_height(uint32_t height) { height_ = height; }
95 void set_transfer_characteristics(uint8_t transfer_characteristics) {
96 transfer_characteristics_ = transfer_characteristics;
98 void set_color_primaries(uint8_t color_primaries) {
99 color_primaries_ = color_primaries;
101 void set_matrix_coefficients(uint8_t matrix_coefficients) {
102 matrix_coefficients_ = matrix_coefficients;
104 void set_trick_play_factor(uint32_t trick_play_factor) {
105 trick_play_factor_ = trick_play_factor;
107 void set_playback_rate(uint32_t playback_rate) {
108 playback_rate_ = playback_rate;
110 void set_eme_init_data(
const uint8_t* eme_init_data,
111 size_t eme_init_data_size) {
112 eme_init_data_.assign(eme_init_data, eme_init_data + eme_init_data_size);
114 void set_colr_data(
const uint8_t* colr_data,
size_t colr_data_size) {
115 colr_data_.assign(colr_data, colr_data + colr_data_size);
121 std::string supplemental_codec_ =
"";
122 FourCC compatible_brand_ = FOURCC_NULL;
123 std::vector<uint8_t> extra_config_;
124 H26xStreamFormat h26x_stream_format_;
130 uint32_t pixel_width_;
131 uint32_t pixel_height_;
132 uint8_t transfer_characteristics_ = 0;
133 uint8_t color_primaries_ = 0;
134 uint8_t matrix_coefficients_ = 0;
135 uint32_t trick_play_factor_ = 0;
148 uint32_t playback_rate_ = 0;
153 uint8_t nalu_length_size_;
157 std::vector<uint8_t> eme_init_data_;
160 std::vector<uint8_t> colr_data_;
All the methods that are virtual are virtual for mocking.