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,
57 kCodecAudioMaxPlusOne,
60 kCodecWebVtt = kCodecText,
74 const std::string& codec_string,
75 const uint8_t* codec_config,
76 size_t codec_config_size,
77 const std::string& language,
87 virtual std::string
ToString()
const;
92 virtual std::unique_ptr<StreamInfo>
Clone()
const = 0;
94 StreamType stream_type()
const {
return stream_type_; }
95 uint32_t track_id()
const {
return track_id_; }
96 uint32_t time_scale()
const {
return time_scale_; }
97 uint64_t duration()
const {
return duration_; }
98 Codec codec()
const {
return codec_; }
99 const std::string& codec_string()
const {
return codec_string_; }
100 const std::vector<uint8_t>& codec_config()
const {
return codec_config_; }
101 const std::string& language()
const {
return language_; }
102 bool is_encrypted()
const {
return is_encrypted_; }
103 bool has_clear_lead()
const {
return has_clear_lead_; }
105 return encryption_config_;
108 void set_duration(uint64_t duration) { duration_ = duration; }
109 void set_codec(Codec codec) { codec_ = codec; }
110 void set_codec_config(
const std::vector<uint8_t>& data) {
111 codec_config_ = data;
113 void set_codec_string(
const std::string& codec_string) {
114 codec_string_ = codec_string;
116 void set_language(
const std::string& language) { language_ = language; }
117 void set_is_encrypted(
bool is_encrypted) { is_encrypted_ = is_encrypted; }
118 void set_has_clear_lead(
bool has_clear_lead) {
119 has_clear_lead_ = has_clear_lead;
122 encryption_config_ = encryption_config;
127 StreamType stream_type_;
130 uint32_t time_scale_;
134 std::string codec_string_;
135 std::string language_;
141 bool has_clear_lead_ =
false;
145 std::vector<uint8_t> codec_config_;
155 #endif // PACKAGER_MEDIA_BASE_STREAM_INFO_H_