7 #include <packager/media/base/video_stream_info.h>
9 #include <absl/log/log.h>
10 #include <absl/strings/str_format.h>
12 #include <packager/macros/logging.h>
13 #include <packager/media/base/limits.h>
19 std::string VideoCodecToString(Codec codec) {
27 case kCodecH265DolbyVision:
28 return "H265 Dolby Vision";
34 NOTIMPLEMENTED() <<
"Unknown Video Codec: " << codec;
35 return "UnknownCodec";
41 VideoStreamInfo::VideoStreamInfo(
int track_id,
45 H26xStreamFormat h26x_stream_format,
46 const std::string& codec_string,
47 const uint8_t* codec_config,
48 size_t codec_config_size,
52 uint32_t pixel_height,
53 uint8_t color_primaries,
54 uint8_t matrix_coefficients,
55 uint8_t transfer_characteristics,
56 uint32_t trick_play_factor,
57 uint8_t nalu_length_size,
58 const std::string& language,
70 h26x_stream_format_(h26x_stream_format),
73 pixel_width_(pixel_width),
74 pixel_height_(pixel_height),
75 transfer_characteristics_(transfer_characteristics),
76 color_primaries_(color_primaries),
77 matrix_coefficients_(matrix_coefficients),
78 trick_play_factor_(trick_play_factor),
79 nalu_length_size_(nalu_length_size) {}
81 VideoStreamInfo::~VideoStreamInfo() {}
84 return codec() != kUnknownCodec && width_ > 0 &&
85 width_ <= limits::kMaxDimension && height_ > 0 &&
86 height_ <= limits::kMaxDimension &&
87 (nalu_length_size_ <= 2 || nalu_length_size_ == 4);
91 return absl::StrFormat(
92 "%s codec: %s\n width: %d\n height: %d\n pixel_aspect_ratio: %d:%d\n "
93 "trick_play_factor: %d\n nalu_length_size: %d\n",
95 width_, height_, pixel_width_, pixel_height_, trick_play_factor_,
All the methods that are virtual are virtual for mocking.