7 #include "packager/media/base/stream_info.h"
11 #include "packager/base/logging.h"
12 #include "packager/base/strings/stringprintf.h"
14 namespace edash_packager {
17 StreamInfo::StreamInfo(StreamType stream_type,
21 const std::string& codec_string,
22 const std::string& language,
23 const uint8_t* extra_data,
24 size_t extra_data_size,
26 : stream_type_(stream_type),
28 time_scale_(time_scale),
30 codec_string_(codec_string),
32 is_encrypted_(is_encrypted) {
33 if (extra_data_size > 0) {
34 extra_data_.assign(extra_data, extra_data + extra_data_size);
38 StreamInfo::~StreamInfo() {}
41 return base::StringPrintf(
42 "type: %s\n codec_string: %s\n time_scale: %d\n duration: "
43 "%" PRIu64
" (%.1f seconds)\n is_encrypted: %s\n",
44 (stream_type_ == kStreamAudio ?
"Audio" :
"Video"),
45 codec_string_.c_str(),
46 time_scale_, duration_,
47 static_cast<double>(duration_) / time_scale_,
48 is_encrypted_ ?
"true" :
"false");