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,
37 kCodecVideoMaxPlusOne,
40 kCodecAAC = kCodecAudio,
54 kCodecAudioMaxPlusOne,
57 kCodecWebVtt = kCodecText,
70 const std::string& codec_string,
71 const uint8_t* codec_config,
72 size_t codec_config_size,
73 const std::string& language,
83 virtual std::string
ToString()
const;
88 virtual std::unique_ptr<StreamInfo>
Clone()
const = 0;
90 StreamType stream_type()
const {
return stream_type_; }
91 uint32_t track_id()
const {
return track_id_; }
92 uint32_t time_scale()
const {
return time_scale_; }
93 uint64_t duration()
const {
return duration_; }
94 Codec codec()
const {
return codec_; }
95 const std::string& codec_string()
const {
return codec_string_; }
96 const std::vector<uint8_t>& codec_config()
const {
return codec_config_; }
97 const std::string& language()
const {
return language_; }
98 bool is_encrypted()
const {
return is_encrypted_; }
99 bool has_clear_lead()
const {
return has_clear_lead_; }
101 return encryption_config_;
104 void set_duration(uint64_t duration) { duration_ = duration; }
105 void set_codec(Codec codec) { codec_ = codec; }
106 void set_codec_config(
const std::vector<uint8_t>& data) {
107 codec_config_ = data;
109 void set_codec_string(
const std::string& codec_string) {
110 codec_string_ = codec_string;
112 void set_language(
const std::string& language) { language_ = language; }
113 void set_is_encrypted(
bool is_encrypted) { is_encrypted_ = is_encrypted; }
114 void set_has_clear_lead(
bool has_clear_lead) {
115 has_clear_lead_ = has_clear_lead;
118 encryption_config_ = encryption_config;
123 StreamType stream_type_;
126 uint32_t time_scale_;
130 std::string codec_string_;
131 std::string language_;
137 bool has_clear_lead_ =
false;
141 std::vector<uint8_t> codec_config_;
151 #endif // PACKAGER_MEDIA_BASE_STREAM_INFO_H_
All the methods that are virtual are virtual for mocking.