7 #include "packager/media/base/stream_info.h" 11 #include "packager/base/logging.h" 12 #include "packager/base/strings/stringprintf.h" 17 std::string StreamTypeToString(StreamType type) {
29 NOTREACHED() <<
"Unhandled StreamType with value " <<
static_cast<int>(type);
33 StreamInfo::StreamInfo(StreamType stream_type,
38 const std::string& codec_string,
39 const uint8_t* codec_config,
40 size_t codec_config_size,
41 const std::string& language,
43 : stream_type_(stream_type),
45 time_scale_(time_scale),
48 codec_string_(codec_string),
50 is_encrypted_(is_encrypted) {
51 if (codec_config_size > 0) {
52 codec_config_.assign(codec_config, codec_config + codec_config_size);
56 StreamInfo::~StreamInfo() {}
59 return base::StringPrintf(
60 "type: %s\n codec_string: %s\n time_scale: %d\n duration: " 61 "%" PRIu64
" (%.1f seconds)\n is_encrypted: %s\n",
62 (stream_type_ == kStreamAudio ?
"Audio" :
"Video"), codec_string_.c_str(),
63 time_scale_, duration_,
static_cast<double>(duration_) / time_scale_,
64 is_encrypted_ ?
"true" :
"false");
All the methods that are virtual are virtual for mocking.