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,
int track_id,
18 uint32_t time_scale, uint64_t duration, Codec codec,
19 const std::string& codec_string,
20 const uint8_t* codec_config,
size_t codec_config_size,
21 const std::string& language,
bool is_encrypted)
22 : stream_type_(stream_type),
24 time_scale_(time_scale),
27 codec_string_(codec_string),
29 is_encrypted_(is_encrypted) {
30 if (codec_config_size > 0) {
31 codec_config_.assign(codec_config, codec_config + codec_config_size);
35 StreamInfo::~StreamInfo() {}
38 return base::StringPrintf(
39 "type: %s\n codec_string: %s\n time_scale: %d\n duration: " 40 "%" PRIu64
" (%.1f seconds)\n is_encrypted: %s\n",
41 (stream_type_ == kStreamAudio ?
"Audio" :
"Video"),
42 codec_string_.c_str(),
43 time_scale_, duration_,
44 static_cast<double>(duration_) / time_scale_,
45 is_encrypted_ ?
"true" :
"false");
All the methods that are virtual are virtual for mocking.