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"
16 namespace edash_packager {
20 std::string VideoCodecToString(VideoCodec video_codec) {
21 switch (video_codec) {
37 NOTIMPLEMENTED() <<
"Unknown Video Codec: " << video_codec;
38 return "UnknownVideoCodec";
48 const std::string& codec_string,
49 const std::string& language,
53 uint32_t pixel_height,
54 int16_t trick_play_rate,
55 uint8_t nalu_length_size,
56 const uint8_t* extra_data,
57 size_t extra_data_size,
71 pixel_width_(pixel_width),
72 pixel_height_(pixel_height),
73 trick_play_rate_(trick_play_rate),
74 nalu_length_size_(nalu_length_size) {
77 VideoStreamInfo::~VideoStreamInfo() {}
80 return codec_ != kUnknownVideoCodec &&
81 width_ > 0 && width_ <= limits::kMaxDimension &&
82 height_ > 0 && height_ <= limits::kMaxDimension &&
83 (nalu_length_size_ <= 2 || nalu_length_size_ == 4);
87 return base::StringPrintf(
88 "%s codec: %s\n width: %d\n height: %d\n pixel aspect ratio: %d:%d\n "
89 "trick_play_rate: %d\n nalu_length_size: %d\n",
91 width_, height_, pixel_width_, pixel_height_, trick_play_rate_,
97 uint8_t compatible_profiles,
105 const uint8_t bytes[] = {profile, compatible_profiles, level};
107 base::StringToLowerASCII(base::HexEncode(bytes, arraysize(bytes)));
110 NOTIMPLEMENTED() <<
"Unknown Codec: " << codec;