7 #ifndef PACKAGER_MEDIA_BASE_STREAM_INFO_H_ 8 #define PACKAGER_MEDIA_BASE_STREAM_INFO_H_ 14 #include "packager/media/base/encryption_config.h" 26 std::string StreamTypeToString(StreamType type);
32 kCodecAV1 = kCodecVideo,
35 kCodecH265DolbyVision,
38 kCodecVideoMaxPlusOne,
41 kCodecAAC = kCodecAudio,
55 kCodecAudioMaxPlusOne,
58 kCodecWebVtt = kCodecText,
71 const std::string& codec_string,
72 const uint8_t* codec_config,
73 size_t codec_config_size,
74 const std::string& language,
84 virtual std::string
ToString()
const;
89 virtual std::unique_ptr<StreamInfo>
Clone()
const = 0;
91 StreamType stream_type()
const {
return stream_type_; }
92 uint32_t track_id()
const {
return track_id_; }
93 uint32_t time_scale()
const {
return time_scale_; }
94 uint64_t duration()
const {
return duration_; }
95 Codec codec()
const {
return codec_; }
96 const std::string& codec_string()
const {
return codec_string_; }
97 const std::vector<uint8_t>& codec_config()
const {
return codec_config_; }
98 const std::string& language()
const {
return language_; }
99 bool is_encrypted()
const {
return is_encrypted_; }
100 bool has_clear_lead()
const {
return has_clear_lead_; }
102 return encryption_config_;
105 void set_duration(uint64_t duration) { duration_ = duration; }
106 void set_codec(Codec codec) { codec_ = codec; }
107 void set_codec_config(
const std::vector<uint8_t>& data) {
108 codec_config_ = data;
110 void set_codec_string(
const std::string& codec_string) {
111 codec_string_ = codec_string;
113 void set_language(
const std::string& language) { language_ = language; }
114 void set_is_encrypted(
bool is_encrypted) { is_encrypted_ = is_encrypted; }
115 void set_has_clear_lead(
bool has_clear_lead) {
116 has_clear_lead_ = has_clear_lead;
119 encryption_config_ = encryption_config;
124 StreamType stream_type_;
127 uint32_t time_scale_;
131 std::string codec_string_;
132 std::string language_;
138 bool has_clear_lead_ =
false;
142 std::vector<uint8_t> codec_config_;
152 #endif // PACKAGER_MEDIA_BASE_STREAM_INFO_H_
All the methods that are virtual are virtual for mocking.