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