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) {
32 NOTIMPLEMENTED() <<
"Unknown Video Codec: " << codec;
33 return "UnknownCodec";
43 H26xStreamFormat h26x_stream_format,
44 const std::string& codec_string,
45 const uint8_t* codec_config,
46 size_t codec_config_size,
50 uint32_t pixel_height,
51 int16_t trick_play_rate,
52 uint8_t nalu_length_size,
53 const std::string& language,
65 h26x_stream_format_(h26x_stream_format),
68 pixel_width_(pixel_width),
69 pixel_height_(pixel_height),
70 trick_play_rate_(trick_play_rate),
71 nalu_length_size_(nalu_length_size) {}
73 VideoStreamInfo::~VideoStreamInfo() {}
76 return codec() != kUnknownCodec && width_ > 0 &&
77 width_ <= limits::kMaxDimension && height_ > 0 &&
78 height_ <= limits::kMaxDimension &&
79 (nalu_length_size_ <= 2 || nalu_length_size_ == 4);
83 return base::StringPrintf(
84 "%s codec: %s\n width: %d\n height: %d\n pixel_aspect_ratio: %d:%d\n "
85 "trick_play_rate: %d\n nalu_length_size: %d\n",
87 width_, height_, pixel_width_, pixel_height_, trick_play_rate_,