Update encoder configuration printing

This commit is contained in:
Patrick Nicolas
2025-10-06 14:09:11 +02:00
parent e4acf2401e
commit cb7e6dabfc
+10 -11
View File
@@ -87,24 +87,23 @@ static void split_bitrate(std::vector<wivrn::encoder_settings> & encoders, uint6
void print_encoders(const std::vector<wivrn::encoder_settings> & encoders) void print_encoders(const std::vector<wivrn::encoder_settings> & encoders)
{ {
int group = -1; int group = -1;
std::stringstream str;
str << "Encoder configuration:";
for (auto & encoder: encoders) for (auto & encoder: encoders)
{ {
if (encoder.group != group) if (encoder.group != group)
{ {
group = encoder.group; group = encoder.group;
U_LOG_I("Group %d", group); str << "\n\t* Group " << group << ":";
} }
else
std::string codec(magic_enum::enum_name(encoder.codec)); str << "\n";
U_LOG_I("\t%s (%s %d-bit)", encoder.encoder_name.c_str(), codec.c_str(), encoder.bit_depth); str << "\n\t\t" << encoder.encoder_name << " (" << magic_enum::enum_name(encoder.codec) << " " << encoder.bit_depth << "-bit)"
U_LOG_I("\tchannels: %s", std::string(magic_enum::enum_name(encoder.channels)).c_str()); << "\n\t\tchannels: " << magic_enum::enum_name(encoder.channels)
U_LOG_I("\tsize:%" PRIu16 "x%" PRIu16 " offset:%" PRIu16 "x%" PRIu16, << "\n\t\tsize: " << encoder.width << "x" << encoder.height << " offset: " << encoder.offset_x << "x" << encoder.offset_y
encoder.width, << "\n\t\tbitrate: " << encoder.bitrate / 1'000'000 << "Mbit/s";
encoder.height,
encoder.offset_x,
encoder.offset_y);
U_LOG_I("\tbitrate: %" PRIu64 "Mbit/s", encoder.bitrate / 1'000'000);
} }
U_LOG_I("%s", str.str().c_str());
} }
static void check_scale(std::string_view encoder_name, video_codec codec, uint16_t width, uint16_t height, std::array<double, 2> & scale) static void check_scale(std::string_view encoder_name, video_codec codec, uint16_t width, uint16_t height, std::array<double, 2> & scale)