7 #include "packager/media/base/video_stream_info.h"
9 #include "packager/base/logging.h"
10 #include "packager/base/stl_util.h"
11 #include "packager/base/strings/string_number_conversions.h"
12 #include "packager/base/strings/string_util.h"
13 #include "packager/base/strings/stringprintf.h"
14 #include "packager/media/base/limits.h"
20 std::string VideoCodecToString(Codec codec) {
43 NOTIMPLEMENTED() <<
"Unknown Video Codec: " << codec;
44 return "UnknownCodec";
51 int track_id, uint32_t time_scale, uint64_t duration, Codec codec,
52 const std::string& codec_string,
const uint8_t* codec_config,
53 size_t codec_config_size, uint16_t width, uint16_t height,
54 uint32_t pixel_width, uint32_t pixel_height, int16_t trick_play_rate,
55 uint8_t nalu_length_size,
const std::string& language,
bool is_encrypted)
56 :
StreamInfo(kStreamVideo, track_id, time_scale, duration, codec,
57 codec_string, codec_config, codec_config_size, language,
61 pixel_width_(pixel_width),
62 pixel_height_(pixel_height),
63 trick_play_rate_(trick_play_rate),
64 nalu_length_size_(nalu_length_size) {}
66 VideoStreamInfo::~VideoStreamInfo() {}
69 return codec() != kUnknownCodec && width_ > 0 &&
70 width_ <= limits::kMaxDimension && height_ > 0 &&
71 height_ <= limits::kMaxDimension &&
72 (nalu_length_size_ <= 2 || nalu_length_size_ == 4);
76 return base::StringPrintf(
77 "%s codec: %s\n width: %d\n height: %d\n pixel_aspect_ratio: %d:%d\n "
78 "trick_play_rate: %d\n nalu_length_size: %d\n",
80 width_, height_, pixel_width_, pixel_height_, trick_play_rate_,