7 #include "packager/media/base/stream_info.h"
11 #include "packager/base/logging.h"
12 #include "packager/base/strings/stringprintf.h"
17 StreamInfo::StreamInfo(StreamType stream_type,
21 const std::string& codec_string,
22 const std::string& language,
23 const uint8_t* codec_config,
24 size_t codec_config_size,
26 : stream_type_(stream_type),
28 time_scale_(time_scale),
30 codec_string_(codec_string),
32 is_encrypted_(is_encrypted) {
33 if (codec_config_size > 0) {
34 codec_config_.assign(codec_config, codec_config + codec_config_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");