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,
63 kCodecAudioMaxPlusOne,
66 kCodecWebVtt = kCodecText,
80 const std::string& codec_string,
81 const uint8_t* codec_config,
82 size_t codec_config_size,
83 const std::string& language,
93 virtual std::string
ToString()
const;
98 virtual std::unique_ptr<StreamInfo>
Clone()
const = 0;
100 StreamType stream_type()
const {
return stream_type_; }
101 uint32_t track_id()
const {
return track_id_; }
102 int32_t time_scale()
const {
return time_scale_; }
103 int64_t duration()
const {
return duration_; }
104 Codec codec()
const {
return codec_; }
105 const std::string& codec_string()
const {
return codec_string_; }
106 const std::vector<uint8_t>& codec_config()
const {
return codec_config_; }
107 const std::string& language()
const {
return language_; }
108 bool is_encrypted()
const {
return is_encrypted_; }
109 bool has_clear_lead()
const {
return has_clear_lead_; }
110 const EncryptionConfig& encryption_config()
const {
111 return encryption_config_;
114 void set_duration(int64_t duration) { duration_ = duration; }
115 void set_codec(Codec codec) { codec_ = codec; }
116 void set_codec_config(
const std::vector<uint8_t>& data) {
117 codec_config_ = data;
119 void set_codec_string(
const std::string& codec_string) {
120 codec_string_ = codec_string;
122 void set_language(
const std::string& language) { language_ = language; }
123 void set_is_encrypted(
bool is_encrypted) { is_encrypted_ = is_encrypted; }
124 void set_has_clear_lead(
bool has_clear_lead) {
125 has_clear_lead_ = has_clear_lead;
127 void set_encryption_config(
const EncryptionConfig& encryption_config) {
128 encryption_config_ = encryption_config;
133 StreamType stream_type_;
140 std::string codec_string_;
141 std::string language_;
147 bool has_clear_lead_ =
false;
148 EncryptionConfig encryption_config_;
151 std::vector<uint8_t> codec_config_;
All the methods that are virtual are virtual for mocking.