New upstream version 21.0.2+dfsg1
This commit is contained in:
parent
1f1bbb3518
commit
baafb6325b
706 changed files with 49633 additions and 5044 deletions
|
|
@ -57,15 +57,11 @@ OBSBasicStats::OBSBasicStats(QWidget *parent)
|
|||
|
||||
cpuUsage = new QLabel(this);
|
||||
hddSpace = new QLabel(this);
|
||||
#ifdef _WIN32
|
||||
memUsage = new QLabel(this);
|
||||
#endif
|
||||
|
||||
newStat("CPUUsage", cpuUsage, 0);
|
||||
newStat("HDDSpaceAvailable", hddSpace, 0);
|
||||
#ifdef _WIN32
|
||||
newStat("MemoryUsage", memUsage, 0);
|
||||
#endif
|
||||
|
||||
fps = new QLabel(this);
|
||||
renderTime = new QLabel(this);
|
||||
|
|
@ -240,7 +236,7 @@ void OBSBasicStats::Update()
|
|||
obs_output_release(strOutput);
|
||||
obs_output_release(recOutput);
|
||||
|
||||
if (!strOutput || !recOutput)
|
||||
if (!strOutput && !recOutput)
|
||||
return;
|
||||
|
||||
/* ------------------------------------------- */
|
||||
|
|
@ -300,12 +296,10 @@ void OBSBasicStats::Update()
|
|||
|
||||
/* ------------------ */
|
||||
|
||||
#ifdef _WIN32
|
||||
num = (long double)CurrentMemoryUsage() / (1024.0l * 1024.0l);
|
||||
num = (long double)os_get_proc_resident_size() / (1024.0l * 1024.0l);
|
||||
|
||||
str = QString::number(num, 'f', 1) + QStringLiteral(" MB");
|
||||
memUsage->setText(str);
|
||||
#endif
|
||||
|
||||
/* ------------------ */
|
||||
|
||||
|
|
@ -388,8 +382,8 @@ void OBSBasicStats::Update()
|
|||
/* ------------------------------------------- */
|
||||
/* recording/streaming stats */
|
||||
|
||||
outputLabels[0].Update(strOutput);
|
||||
outputLabels[1].Update(recOutput);
|
||||
outputLabels[0].Update(strOutput, false);
|
||||
outputLabels[1].Update(recOutput, true);
|
||||
}
|
||||
|
||||
void OBSBasicStats::Reset()
|
||||
|
|
@ -411,15 +405,9 @@ void OBSBasicStats::Reset()
|
|||
Update();
|
||||
}
|
||||
|
||||
void OBSBasicStats::OutputLabels::Update(obs_output_t *output)
|
||||
void OBSBasicStats::OutputLabels::Update(obs_output_t *output, bool rec)
|
||||
{
|
||||
if (!output)
|
||||
return;
|
||||
|
||||
const char *id = obs_obj_get_id(output);
|
||||
bool rec = strcmp(id, "rtmp_output") != 0;
|
||||
|
||||
uint64_t totalBytes = obs_output_get_total_bytes(output);
|
||||
uint64_t totalBytes = output ? obs_output_get_total_bytes(output) : 0;
|
||||
uint64_t curTime = os_gettime_ns();
|
||||
uint64_t bytesSent = totalBytes;
|
||||
|
||||
|
|
@ -439,12 +427,17 @@ void OBSBasicStats::OutputLabels::Update(obs_output_t *output)
|
|||
|
||||
QString str = QTStr("Basic.Stats.Status.Inactive");
|
||||
QString themeID;
|
||||
bool active = output ? obs_output_active(output) : false;
|
||||
if (rec) {
|
||||
if (obs_output_active(output))
|
||||
if (active)
|
||||
str = QTStr("Basic.Stats.Status.Recording");
|
||||
} else {
|
||||
if (obs_output_active(output)) {
|
||||
if (obs_output_reconnecting(output)) {
|
||||
if (active) {
|
||||
bool reconnecting = output
|
||||
? obs_output_reconnecting(output)
|
||||
: false;
|
||||
|
||||
if (reconnecting) {
|
||||
str = QTStr("Basic.Stats.Status.Reconnecting");
|
||||
themeID = "error";
|
||||
} else {
|
||||
|
|
@ -465,8 +458,8 @@ void OBSBasicStats::OutputLabels::Update(obs_output_t *output)
|
|||
QString("%1 kb/s").arg(QString::number(kbps, 'f', 0)));
|
||||
|
||||
if (!rec) {
|
||||
int total = obs_output_get_total_frames(output);
|
||||
int dropped = obs_output_get_frames_dropped(output);
|
||||
int total = output ? obs_output_get_total_frames(output) : 0;
|
||||
int dropped = output ? obs_output_get_frames_dropped(output) : 0;
|
||||
|
||||
if (total < first_total || dropped < first_dropped) {
|
||||
first_total = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue