7 #ifndef MEDIA_BASE_STREAM_INFO_H_
8 #define MEDIA_BASE_STREAM_INFO_H_
13 #include "packager/media/base/encryption_config.h"
29 kCodecH264 = kCodecVideo,
34 kCodecVideoMaxPlusOne,
37 kCodecAAC = kCodecAudio,
50 kCodecAudioMaxPlusOne,
53 kCodecWebVtt = kCodecText,
61 StreamInfo(StreamType stream_type,
int track_id, uint32_t time_scale,
62 uint64_t duration, Codec codec,
const std::string& codec_string,
63 const uint8_t* codec_config,
size_t codec_config_size,
64 const std::string& language,
bool is_encrypted);
73 virtual std::string
ToString()
const;
75 StreamType stream_type()
const {
return stream_type_; }
76 uint32_t track_id()
const {
return track_id_; }
77 uint32_t time_scale()
const {
return time_scale_; }
78 uint64_t duration()
const {
return duration_; }
79 Codec codec()
const {
return codec_; }
80 const std::string& codec_string()
const {
return codec_string_; }
81 const std::vector<uint8_t>& codec_config()
const {
return codec_config_; }
82 const std::string& language()
const {
return language_; }
83 bool is_encrypted()
const {
return is_encrypted_; }
84 bool has_clear_lead()
const {
return has_clear_lead_; }
86 return encryption_config_;
89 void set_duration(uint64_t duration) { duration_ = duration; }
90 void set_codec(Codec codec) { codec_ = codec; }
91 void set_codec_config(
const std::vector<uint8_t>& data) { codec_config_ = data; }
92 void set_codec_string(
const std::string& codec_string) {
93 codec_string_ = codec_string;
95 void set_language(
const std::string& language) { language_ = language; }
96 void set_is_encrypted(
bool is_encrypted) { is_encrypted_ = is_encrypted; }
97 void set_has_clear_lead(
bool has_clear_lead) {
98 has_clear_lead_ = has_clear_lead;
101 encryption_config_ = encryption_config;
106 StreamType stream_type_;
109 uint32_t time_scale_;
113 std::string codec_string_;
114 std::string language_;
120 bool has_clear_lead_ =
false;
124 std::vector<uint8_t> codec_config_;
134 #endif // MEDIA_BASE_STREAM_INFO_H_