7 #ifndef PACKAGER_MEDIA_BASE_STREAM_INFO_H_ 8 #define PACKAGER_MEDIA_BASE_STREAM_INFO_H_ 14 #include "packager/media/base/encryption_config.h" 30 kCodecH264 = kCodecVideo,
35 kCodecVideoMaxPlusOne,
38 kCodecAAC = kCodecAudio,
52 kCodecAudioMaxPlusOne,
55 kCodecWebVtt = kCodecText,
63 StreamInfo(StreamType stream_type,
int track_id, uint32_t time_scale,
64 uint64_t duration, Codec codec,
const std::string& codec_string,
65 const uint8_t* codec_config,
size_t codec_config_size,
66 const std::string& language,
bool is_encrypted);
75 virtual std::string
ToString()
const;
80 virtual std::unique_ptr<StreamInfo>
Clone()
const = 0;
82 StreamType stream_type()
const {
return stream_type_; }
83 uint32_t track_id()
const {
return track_id_; }
84 uint32_t time_scale()
const {
return time_scale_; }
85 uint64_t duration()
const {
return duration_; }
86 Codec codec()
const {
return codec_; }
87 const std::string& codec_string()
const {
return codec_string_; }
88 const std::vector<uint8_t>& codec_config()
const {
return codec_config_; }
89 const std::string& language()
const {
return language_; }
90 bool is_encrypted()
const {
return is_encrypted_; }
91 bool has_clear_lead()
const {
return has_clear_lead_; }
93 return encryption_config_;
96 void set_duration(uint64_t duration) { duration_ = duration; }
97 void set_codec(Codec codec) { codec_ = codec; }
98 void set_codec_config(
const std::vector<uint8_t>& data) { codec_config_ = data; }
99 void set_codec_string(
const std::string& codec_string) {
100 codec_string_ = codec_string;
102 void set_language(
const std::string& language) { language_ = language; }
103 void set_is_encrypted(
bool is_encrypted) { is_encrypted_ = is_encrypted; }
104 void set_has_clear_lead(
bool has_clear_lead) {
105 has_clear_lead_ = has_clear_lead;
108 encryption_config_ = encryption_config;
113 StreamType stream_type_;
116 uint32_t time_scale_;
120 std::string codec_string_;
121 std::string language_;
127 bool has_clear_lead_ =
false;
131 std::vector<uint8_t> codec_config_;
141 #endif // PACKAGER_MEDIA_BASE_STREAM_INFO_H_
All the methods that are virtual are virtual for mocking.