clang-format: Apply formatting

Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
This commit is contained in:
jp9000 2019-06-22 22:13:45 -07:00
commit f53df7da64
567 changed files with 34068 additions and 32903 deletions

View file

@ -15,7 +15,7 @@
#include "ui_AutoConfigTestPage.h"
#define wiz reinterpret_cast<AutoConfig*>(wizard())
#define wiz reinterpret_cast<AutoConfig *>(wizard())
using namespace std;
@ -31,17 +31,14 @@ class TestMode {
gs_eparam_t *randomvals[3] = {
gs_effect_get_param_by_name(solid, "randomvals1"),
gs_effect_get_param_by_name(solid, "randomvals2"),
gs_effect_get_param_by_name(solid, "randomvals3")
};
gs_effect_get_param_by_name(solid, "randomvals3")};
struct vec4 r;
for (int i = 0; i < 3; i++) {
vec4_set(&r,
rand_float(true) * 100.0f,
rand_float(true) * 100.0f,
rand_float(true) * 50000.0f + 10000.0f,
0.0f);
vec4_set(&r, rand_float(true) * 100.0f,
rand_float(true) * 100.0f,
rand_float(true) * 50000.0f + 10000.0f, 0.0f);
gs_effect_set_vec4(randomvals[i], &r);
}
@ -86,37 +83,37 @@ public:
/* ------------------------------------------------------------------------- */
#define TEST_STR(x) "Basic.AutoConfig.TestPage." x
#define SUBTITLE_TESTING TEST_STR("Subtitle.Testing")
#define SUBTITLE_COMPLETE TEST_STR("Subtitle.Complete")
#define TEST_BW TEST_STR("TestingBandwidth")
#define TEST_BW_CONNECTING TEST_STR("TestingBandwidth.Connecting")
#define TEST_BW_CONNECT_FAIL TEST_STR("TestingBandwidth.ConnectFailed")
#define TEST_BW_SERVER TEST_STR("TestingBandwidth.Server")
#define TEST_RES TEST_STR("TestingRes")
#define TEST_RES_VAL TEST_STR("TestingRes.Resolution")
#define TEST_RES_FAIL TEST_STR("TestingRes.Fail")
#define TEST_SE TEST_STR("TestingStreamEncoder")
#define TEST_RE TEST_STR("TestingRecordingEncoder")
#define TEST_RESULT_SE TEST_STR("Result.StreamingEncoder")
#define TEST_RESULT_RE TEST_STR("Result.RecordingEncoder")
#define TEST_STR(x) "Basic.AutoConfig.TestPage." x
#define SUBTITLE_TESTING TEST_STR("Subtitle.Testing")
#define SUBTITLE_COMPLETE TEST_STR("Subtitle.Complete")
#define TEST_BW TEST_STR("TestingBandwidth")
#define TEST_BW_CONNECTING TEST_STR("TestingBandwidth.Connecting")
#define TEST_BW_CONNECT_FAIL TEST_STR("TestingBandwidth.ConnectFailed")
#define TEST_BW_SERVER TEST_STR("TestingBandwidth.Server")
#define TEST_RES TEST_STR("TestingRes")
#define TEST_RES_VAL TEST_STR("TestingRes.Resolution")
#define TEST_RES_FAIL TEST_STR("TestingRes.Fail")
#define TEST_SE TEST_STR("TestingStreamEncoder")
#define TEST_RE TEST_STR("TestingRecordingEncoder")
#define TEST_RESULT_SE TEST_STR("Result.StreamingEncoder")
#define TEST_RESULT_RE TEST_STR("Result.RecordingEncoder")
void AutoConfigTestPage::StartBandwidthStage()
{
ui->progressLabel->setText(QTStr(TEST_BW));
testThread = std::thread([this] () {TestBandwidthThread();});
testThread = std::thread([this]() { TestBandwidthThread(); });
}
void AutoConfigTestPage::StartStreamEncoderStage()
{
ui->progressLabel->setText(QTStr(TEST_SE));
testThread = std::thread([this] () {TestStreamEncoderThread();});
testThread = std::thread([this]() { TestStreamEncoderThread(); });
}
void AutoConfigTestPage::StartRecordingEncoderStage()
{
ui->progressLabel->setText(QTStr(TEST_RE));
testThread = std::thread([this] () {TestRecordingEncoderThread();});
testThread = std::thread([this]() { TestRecordingEncoderThread(); });
}
void AutoConfigTestPage::GetServers(std::vector<ServerInfo> &servers)
@ -176,21 +173,20 @@ void AutoConfigTestPage::TestBandwidthThread()
*/
QMetaObject::invokeMethod(this, "UpdateMessage",
Q_ARG(QString, QStringLiteral("")));
Q_ARG(QString, QStringLiteral("")));
/* -----------------------------------*/
/* create obs objects */
const char *serverType = wiz->customServer
? "rtmp_custom"
: "rtmp_common";
const char *serverType = wiz->customServer ? "rtmp_custom"
: "rtmp_common";
OBSEncoder vencoder = obs_video_encoder_create("obs_x264",
"test_x264", nullptr, nullptr);
OBSEncoder aencoder = obs_audio_encoder_create("ffmpeg_aac",
"test_aac", nullptr, 0, nullptr);
OBSService service = obs_service_create(serverType,
"test_service", nullptr, nullptr);
OBSEncoder vencoder = obs_video_encoder_create("obs_x264", "test_x264",
nullptr, nullptr);
OBSEncoder aencoder = obs_audio_encoder_create("ffmpeg_aac", "test_aac",
nullptr, 0, nullptr);
OBSService service = obs_service_create(serverType, "test_service",
nullptr, nullptr);
obs_encoder_release(vencoder);
obs_encoder_release(aencoder);
obs_service_release(service);
@ -218,14 +214,14 @@ void AutoConfigTestPage::TestBandwidthThread()
if (wiz->service == AutoConfig::Service::Twitch) {
string_depad_key(key);
key += "?bandwidthtest";
}
else if(wiz->serviceName == "Restream.io" || wiz->serviceName == "Restream.io - RTMP") {
} else if (wiz->serviceName == "Restream.io" ||
wiz->serviceName == "Restream.io - RTMP") {
string_depad_key(key);
key += "?test=true";
}
obs_data_set_string(service_settings, "service",
wiz->serviceName.c_str());
wiz->serviceName.c_str());
obs_data_set_string(service_settings, "key", key.c_str());
obs_data_set_int(vencoder_settings, "bitrate", wiz->startingBitrate);
@ -235,9 +231,9 @@ void AutoConfigTestPage::TestBandwidthThread()
obs_data_set_int(aencoder_settings, "bitrate", 32);
OBSBasic *main = reinterpret_cast<OBSBasic*>(App()->GetMainWindow());
const char *bind_ip = config_get_string(main->Config(), "Output",
"BindIP");
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
const char *bind_ip =
config_get_string(main->Config(), "Output", "BindIP");
obs_data_set_string(output_settings, "bind_ip", bind_ip);
/* -----------------------------------*/
@ -251,12 +247,12 @@ void AutoConfigTestPage::TestBandwidthThread()
/* just use the first server if it only has one alternate server,
* or if using Mixer or Restream due to their "auto" servers */
if (servers.size() < 3 || wiz->serviceName == "Mixer.com - FTL" ||
wiz->serviceName.substr(0, 11)=="Restream.io") {
if (servers.size() < 3 || wiz->serviceName == "Mixer.com - FTL" ||
wiz->serviceName.substr(0, 11) == "Restream.io") {
servers.resize(1);
} else if (wiz->service == AutoConfig::Service::Twitch &&
wiz->twitchAuto) {
wiz->twitchAuto) {
/* if using Twitch and "Auto" is available, test 3 closest
* server */
servers.erase(servers.begin() + 1);
@ -267,8 +263,8 @@ void AutoConfigTestPage::TestBandwidthThread()
/* apply service settings */
obs_service_update(service, service_settings);
obs_service_apply_encoder_settings(service,
vencoder_settings, aencoder_settings);
obs_service_apply_encoder_settings(service, vencoder_settings,
aencoder_settings);
/* -----------------------------------*/
/* create output */
@ -277,18 +273,17 @@ void AutoConfigTestPage::TestBandwidthThread()
if (!output_type)
output_type = "rtmp_output";
OBSOutput output = obs_output_create(output_type,
"test_stream", nullptr, nullptr);
OBSOutput output =
obs_output_create(output_type, "test_stream", nullptr, nullptr);
obs_output_release(output);
obs_output_update(output, output_settings);
const char *audio_codec =
obs_output_get_supported_audio_codecs(output);
const char *audio_codec = obs_output_get_supported_audio_codecs(output);
if (strcmp(audio_codec, "aac") != 0) {
const char *id = FindAudioEncoderFromCodec(audio_codec);
aencoder = obs_audio_encoder_create(id,
"test_audio", nullptr, 0, nullptr);
aencoder = obs_audio_encoder_create(id, "test_audio", nullptr,
0, nullptr);
obs_encoder_release(aencoder);
}
@ -308,16 +303,14 @@ void AutoConfigTestPage::TestBandwidthThread()
/* -----------------------------------*/
/* connect signals */
auto on_started = [&] ()
{
auto on_started = [&]() {
unique_lock<mutex> lock(m);
connected = true;
stopped = false;
cv.notify_one();
};
auto on_stopped = [&] ()
{
auto on_stopped = [&]() {
unique_lock<mutex> lock(m);
connected = false;
stopped = true;
@ -327,17 +320,15 @@ void AutoConfigTestPage::TestBandwidthThread()
using on_started_t = decltype(on_started);
using on_stopped_t = decltype(on_stopped);
auto pre_on_started = [] (void *data, calldata_t *)
{
auto pre_on_started = [](void *data, calldata_t *) {
on_started_t &on_started =
*reinterpret_cast<on_started_t*>(data);
*reinterpret_cast<on_started_t *>(data);
on_started();
};
auto pre_on_stopped = [] (void *data, calldata_t *)
{
auto pre_on_stopped = [](void *data, calldata_t *) {
on_stopped_t &on_stopped =
*reinterpret_cast<on_stopped_t*>(data);
*reinterpret_cast<on_stopped_t *>(data);
on_stopped();
};
@ -358,12 +349,13 @@ void AutoConfigTestPage::TestBandwidthThread()
int per = int((i + 1) * 100 / servers.size());
QMetaObject::invokeMethod(this, "Progress", Q_ARG(int, per));
QMetaObject::invokeMethod(this, "UpdateMessage",
Q_ARG(QString, QTStr(TEST_BW_CONNECTING)
.arg(server.name.c_str())));
QMetaObject::invokeMethod(
this, "UpdateMessage",
Q_ARG(QString, QTStr(TEST_BW_CONNECTING)
.arg(server.name.c_str())));
obs_data_set_string(service_settings, "server",
server.address.c_str());
server.address.c_str());
obs_service_update(service, service_settings);
if (!obs_output_start(output))
@ -385,9 +377,10 @@ void AutoConfigTestPage::TestBandwidthThread()
if (!connected)
continue;
QMetaObject::invokeMethod(this, "UpdateMessage",
Q_ARG(QString, QTStr(TEST_BW_SERVER)
.arg(server.name.c_str())));
QMetaObject::invokeMethod(
this, "UpdateMessage",
Q_ARG(QString,
QTStr(TEST_BW_SERVER).arg(server.name.c_str())));
/* ignore first 2.5 seconds due to possible buffering skewing
* the result */
@ -418,10 +411,10 @@ void AutoConfigTestPage::TestBandwidthThread()
uint64_t total_time = os_gettime_ns() - t_start;
int total_bytes = (int)obs_output_get_total_bytes(output) -
start_bytes;
uint64_t bitrate = (uint64_t)total_bytes * 8
* 1000000000 / total_time / 1000;
int total_bytes =
(int)obs_output_get_total_bytes(output) - start_bytes;
uint64_t bitrate = (uint64_t)total_bytes * 8 * 1000000000 /
total_time / 1000;
if (obs_output_get_frames_dropped(output) ||
(int)bitrate < (wiz->startingBitrate * 75 / 100)) {
@ -436,7 +429,8 @@ void AutoConfigTestPage::TestBandwidthThread()
if (!success) {
QMetaObject::invokeMethod(this, "Failure",
Q_ARG(QString, QTStr(TEST_BW_CONNECT_FAIL)));
Q_ARG(QString,
QTStr(TEST_BW_CONNECT_FAIL)));
return;
}
@ -480,7 +474,8 @@ static long double EstimateMinBitrate(int cx, int cy, int fps_num, int fps_den)
return EstimateBitrateVal(cx, cy, fps_num, fps_den) / val;
}
static long double EstimateUpperBitrate(int cx, int cy, int fps_num, int fps_den)
static long double EstimateUpperBitrate(int cx, int cy, int fps_num,
int fps_den)
{
long double val = EstimateBitrateVal(1280, 720, 30, 1) / 3000.0l;
return EstimateBitrateVal(cx, cy, fps_num, fps_den) / val;
@ -520,17 +515,17 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
{
TestMode testMode;
QMetaObject::invokeMethod(this, "UpdateMessage",
Q_ARG(QString, QStringLiteral("")));
Q_ARG(QString, QStringLiteral("")));
/* -----------------------------------*/
/* create obs objects */
OBSEncoder vencoder = obs_video_encoder_create("obs_x264",
"test_x264", nullptr, nullptr);
OBSEncoder aencoder = obs_audio_encoder_create("ffmpeg_aac",
"test_aac", nullptr, 0, nullptr);
OBSOutput output = obs_output_create("null_output",
"null", nullptr, nullptr);
OBSEncoder vencoder = obs_video_encoder_create("obs_x264", "test_x264",
nullptr, nullptr);
OBSEncoder aencoder = obs_audio_encoder_create("ffmpeg_aac", "test_aac",
nullptr, 0, nullptr);
OBSOutput output =
obs_output_create("null_output", "null", nullptr, nullptr);
obs_output_release(output);
obs_encoder_release(vencoder);
obs_encoder_release(aencoder);
@ -547,7 +542,7 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
if (wiz->type != AutoConfig::Type::Recording) {
obs_data_set_int(vencoder_settings, "keyint_sec", 2);
obs_data_set_int(vencoder_settings, "bitrate",
wiz->idealBitrate);
wiz->idealBitrate);
obs_data_set_string(vencoder_settings, "rate_control", "CBR");
obs_data_set_string(vencoder_settings, "profile", "main");
obs_data_set_string(vencoder_settings, "preset", "veryfast");
@ -573,18 +568,16 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
/* -----------------------------------*/
/* connect signals */
auto on_stopped = [&] ()
{
auto on_stopped = [&]() {
unique_lock<mutex> lock(m);
cv.notify_one();
};
using on_stopped_t = decltype(on_stopped);
auto pre_on_stopped = [] (void *data, calldata_t *)
{
auto pre_on_stopped = [](void *data, calldata_t *) {
on_stopped_t &on_stopped =
*reinterpret_cast<on_stopped_t*>(data);
*reinterpret_cast<on_stopped_t *>(data);
on_stopped();
};
@ -628,9 +621,8 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
int i = 0;
int count = 1;
auto testRes = [&] (long double div, int fps_num, int fps_den,
bool force)
{
auto testRes = [&](long double div, int fps_num, int fps_den,
bool force) {
int per = ++i * 100 / count;
QMetaObject::invokeMethod(this, "Progress", Q_ARG(int, per));
@ -669,13 +661,13 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
QString cxStr = QString::number(cx);
QString cyStr = QString::number(cy);
QString fpsStr = (fps_den > 1)
? QString::number(fps, 'f', 2)
: QString::number(fps, 'g', 2);
QString fpsStr = (fps_den > 1) ? QString::number(fps, 'f', 2)
: QString::number(fps, 'g', 2);
QMetaObject::invokeMethod(this, "UpdateMessage",
Q_ARG(QString, QTStr(TEST_RES_VAL)
.arg(cxStr, cyStr, fpsStr)));
QMetaObject::invokeMethod(
this, "UpdateMessage",
Q_ARG(QString,
QTStr(TEST_RES_VAL).arg(cxStr, cyStr, fpsStr)));
unique_lock<mutex> ul(m);
if (cancel)
@ -683,7 +675,8 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
if (!obs_output_start(output)) {
QMetaObject::invokeMethod(this, "Failure",
Q_ARG(QString, QTStr(TEST_RES_FAIL)));
Q_ARG(QString,
QTStr(TEST_RES_FAIL)));
return false;
}
@ -692,8 +685,8 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
obs_output_stop(output);
cv.wait(ul);
int skipped = (int)video_output_get_skipped_frames(
obs_get_video());
int skipped =
(int)video_output_get_skipped_frames(obs_get_video());
if (force || skipped <= 10)
results.emplace_back(cx, cy, fps_num, fps_den);
@ -702,23 +695,38 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
if (wiz->specificFPSNum && wiz->specificFPSDen) {
count = 5;
if (!testRes(1.0, 0, 0, false)) return false;
if (!testRes(1.5, 0, 0, false)) return false;
if (!testRes(1.0 / 0.6, 0, 0, false)) return false;
if (!testRes(2.0, 0, 0, false)) return false;
if (!testRes(2.25, 0, 0, true)) return false;
if (!testRes(1.0, 0, 0, false))
return false;
if (!testRes(1.5, 0, 0, false))
return false;
if (!testRes(1.0 / 0.6, 0, 0, false))
return false;
if (!testRes(2.0, 0, 0, false))
return false;
if (!testRes(2.25, 0, 0, true))
return false;
} else {
count = 10;
if (!testRes(1.0, 60, 1, false)) return false;
if (!testRes(1.0, 30, 1, false)) return false;
if (!testRes(1.5, 60, 1, false)) return false;
if (!testRes(1.5, 30, 1, false)) return false;
if (!testRes(1.0 / 0.6, 60, 1, false)) return false;
if (!testRes(1.0 / 0.6, 30, 1, false)) return false;
if (!testRes(2.0, 60, 1, false)) return false;
if (!testRes(2.0, 30, 1, false)) return false;
if (!testRes(2.25, 60, 1, false)) return false;
if (!testRes(2.25, 30, 1, true)) return false;
if (!testRes(1.0, 60, 1, false))
return false;
if (!testRes(1.0, 30, 1, false))
return false;
if (!testRes(1.5, 60, 1, false))
return false;
if (!testRes(1.5, 30, 1, false))
return false;
if (!testRes(1.0 / 0.6, 60, 1, false))
return false;
if (!testRes(1.0 / 0.6, 30, 1, false))
return false;
if (!testRes(2.0, 60, 1, false))
return false;
if (!testRes(2.0, 30, 1, false))
return false;
if (!testRes(2.25, 60, 1, false))
return false;
if (!testRes(2.25, 30, 1, true))
return false;
}
/* -----------------------------------*/
@ -744,7 +752,7 @@ bool AutoConfigTestPage::TestSoftwareEncoding()
wiz->idealFPSDen = result.fps_den;
long double fUpperBitrate = EstimateUpperBitrate(
result.cx, result.cy, result.fps_num, result.fps_den);
result.cx, result.cy, result.fps_num, result.fps_den);
int upperBitrate = int(floor(fUpperBitrate / 50.0l) * 50.0l);
@ -776,9 +784,8 @@ void AutoConfigTestPage::FindIdealHardwareResolution()
maxDataRate = 1280 * 720 * 30 + 1000;
}
auto testRes = [&] (long double div, int fps_num, int fps_den,
bool force)
{
auto testRes = [&](long double div, int fps_num, int fps_den,
bool force) {
if (results.size() >= 3)
return;
@ -805,7 +812,8 @@ void AutoConfigTestPage::FindIdealHardwareResolution()
* ratio, so increase the minimum bitrate estimate for them.
* NVENC currently is the exception because of the improvements
* its made to its quality in recent generations. */
if (!nvenc) minBitrate = minBitrate * 114 / 100;
if (!nvenc)
minBitrate = minBitrate * 114 / 100;
if (wiz->type == AutoConfig::Type::Recording)
force = true;
@ -919,9 +927,9 @@ void AutoConfigTestPage::TestRecordingEncoderThread()
#define ENCODER_TEXT(x) "Basic.Settings.Output.Simple.Encoder." x
#define ENCODER_SOFTWARE ENCODER_TEXT("Software")
#define ENCODER_NVENC ENCODER_TEXT("Hardware.NVENC")
#define ENCODER_QSV ENCODER_TEXT("Hardware.QSV")
#define ENCODER_AMD ENCODER_TEXT("Hardware.AMD")
#define ENCODER_NVENC ENCODER_TEXT("Hardware.NVENC")
#define ENCODER_QSV ENCODER_TEXT("Hardware.QSV")
#define ENCODER_AMD ENCODER_TEXT("Hardware.AMD")
#define QUALITY_SAME "Basic.Settings.Output.Simple.RecordingQuality.Stream"
#define QUALITY_HIGH "Basic.Settings.Output.Simple.RecordingQuality.Small"
@ -933,8 +941,7 @@ void AutoConfigTestPage::FinalizeResults()
QFormLayout *form = results;
auto encName = [] (AutoConfig::Encoder enc) -> QString
{
auto encName = [](AutoConfig::Encoder enc) -> QString {
switch (enc) {
case AutoConfig::Encoder::x264:
return QTStr(ENCODER_SOFTWARE);
@ -951,18 +958,16 @@ void AutoConfigTestPage::FinalizeResults()
return QTStr(ENCODER_SOFTWARE);
};
auto newLabel = [this] (const char *str) -> QLabel *
{
auto newLabel = [this](const char *str) -> QLabel * {
return new QLabel(QTStr(str), this);
};
if (wiz->type != AutoConfig::Type::Recording) {
const char *serverType = wiz->customServer
? "rtmp_custom"
: "rtmp_common";
const char *serverType = wiz->customServer ? "rtmp_custom"
: "rtmp_common";
OBSService service = obs_service_create(serverType,
"temp_service", nullptr, nullptr);
OBSService service = obs_service_create(
serverType, "temp_service", nullptr, nullptr);
obs_service_release(service);
OBSData service_settings = obs_data_create();
@ -971,44 +976,45 @@ void AutoConfigTestPage::FinalizeResults()
obs_data_release(vencoder_settings);
obs_data_set_int(vencoder_settings, "bitrate",
wiz->idealBitrate);
wiz->idealBitrate);
obs_data_set_string(service_settings, "service",
wiz->serviceName.c_str());
wiz->serviceName.c_str());
obs_service_update(service, service_settings);
obs_service_apply_encoder_settings(service,
vencoder_settings, nullptr);
obs_service_apply_encoder_settings(service, vencoder_settings,
nullptr);
wiz->idealBitrate = (int)obs_data_get_int(vencoder_settings,
"bitrate");
wiz->idealBitrate =
(int)obs_data_get_int(vencoder_settings, "bitrate");
if (!wiz->customServer)
form->addRow(
newLabel("Basic.AutoConfig.StreamPage.Service"),
new QLabel(wiz->serviceName.c_str(),
ui->finishPage));
ui->finishPage));
form->addRow(newLabel("Basic.AutoConfig.StreamPage.Server"),
new QLabel(wiz->serverName.c_str(), ui->finishPage));
new QLabel(wiz->serverName.c_str(),
ui->finishPage));
form->addRow(newLabel("Basic.Settings.Output.VideoBitrate"),
new QLabel(QString::number(wiz->idealBitrate),
ui->finishPage));
new QLabel(QString::number(wiz->idealBitrate),
ui->finishPage));
form->addRow(newLabel(TEST_RESULT_SE),
new QLabel(encName(wiz->streamingEncoder),
ui->finishPage));
new QLabel(encName(wiz->streamingEncoder),
ui->finishPage));
}
QString baseRes = QString("%1x%2").arg(
QString::number(wiz->baseResolutionCX),
QString::number(wiz->baseResolutionCY));
QString scaleRes = QString("%1x%2").arg(
QString::number(wiz->idealResolutionCX),
QString::number(wiz->idealResolutionCY));
QString baseRes =
QString("%1x%2").arg(QString::number(wiz->baseResolutionCX),
QString::number(wiz->baseResolutionCY));
QString scaleRes =
QString("%1x%2").arg(QString::number(wiz->idealResolutionCX),
QString::number(wiz->idealResolutionCY));
if (wiz->recordingEncoder != AutoConfig::Encoder::Stream ||
wiz->recordingQuality != AutoConfig::Quality::Stream)
form->addRow(newLabel(TEST_RESULT_RE),
new QLabel(encName(wiz->recordingEncoder),
ui->finishPage));
new QLabel(encName(wiz->recordingEncoder),
ui->finishPage));
QString recQuality;
@ -1022,21 +1028,20 @@ void AutoConfigTestPage::FinalizeResults()
}
form->addRow(newLabel("Basic.Settings.Output.Simple.RecordingQuality"),
new QLabel(recQuality, ui->finishPage));
new QLabel(recQuality, ui->finishPage));
long double fps =
(long double)wiz->idealFPSNum / (long double)wiz->idealFPSDen;
QString fpsStr = (wiz->idealFPSDen > 1)
? QString::number(fps, 'f', 2)
: QString::number(fps, 'g', 2);
QString fpsStr = (wiz->idealFPSDen > 1) ? QString::number(fps, 'f', 2)
: QString::number(fps, 'g', 2);
form->addRow(newLabel("Basic.Settings.Video.BaseResolution"),
new QLabel(baseRes, ui->finishPage));
new QLabel(baseRes, ui->finishPage));
form->addRow(newLabel("Basic.Settings.Video.ScaledResolution"),
new QLabel(scaleRes, ui->finishPage));
new QLabel(scaleRes, ui->finishPage));
form->addRow(newLabel("Basic.Settings.Video.FPS"),
new QLabel(fpsStr, ui->finishPage));
new QLabel(fpsStr, ui->finishPage));
}
#define STARTING_SEPARATOR \
@ -1103,8 +1108,7 @@ void AutoConfigTestPage::Progress(int percentage)
}
AutoConfigTestPage::AutoConfigTestPage(QWidget *parent)
: QWizardPage (parent),
ui (new Ui_AutoConfigTestPage)
: QWizardPage(parent), ui(new Ui_AutoConfigTestPage)
{
ui->setupUi(this);
setTitle(QTStr("Basic.AutoConfig.TestPage"));