2016-02-23 23:16:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QStatusBar>
|
|
|
|
#include <QPointer>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <util/platform.h>
|
|
|
|
#include <obs.h>
|
|
|
|
|
|
|
|
class QLabel;
|
|
|
|
|
|
|
|
class OBSBasicStatusBar : public QStatusBar {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
QLabel *delayInfo;
|
|
|
|
QLabel *droppedFrames;
|
2017-04-19 19:54:15 +00:00
|
|
|
QLabel *streamTime;
|
|
|
|
QLabel *recordTime;
|
2016-02-23 23:16:51 +00:00
|
|
|
QLabel *cpuUsage;
|
|
|
|
QLabel *kbps;
|
2017-04-19 19:54:15 +00:00
|
|
|
QLabel *statusSquare;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
obs_output_t *streamOutput = nullptr;
|
|
|
|
obs_output_t *recordOutput = nullptr;
|
|
|
|
bool active = false;
|
2016-10-10 19:01:40 +00:00
|
|
|
bool overloadedNotify = true;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
int retries = 0;
|
2017-04-19 19:54:15 +00:00
|
|
|
int totalStreamSeconds = 0;
|
|
|
|
int totalRecordSeconds = 0;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
int reconnectTimeout = 0;
|
|
|
|
|
|
|
|
int delaySecTotal = 0;
|
|
|
|
int delaySecStarting = 0;
|
|
|
|
int delaySecStopping = 0;
|
|
|
|
|
|
|
|
int startSkippedFrameCount = 0;
|
|
|
|
int startTotalFrameCount = 0;
|
|
|
|
int lastSkippedFrameCount = 0;
|
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
int bitrateUpdateSeconds = 0;
|
2016-02-23 23:16:51 +00:00
|
|
|
uint64_t lastBytesSent = 0;
|
|
|
|
uint64_t lastBytesSentTime = 0;
|
|
|
|
|
2017-04-19 19:54:15 +00:00
|
|
|
QPixmap transparentPixmap;
|
|
|
|
QPixmap greenPixmap;
|
|
|
|
QPixmap grayPixmap;
|
|
|
|
QPixmap redPixmap;
|
|
|
|
|
|
|
|
float lastCongestion = 0.0f;
|
|
|
|
|
2016-02-23 23:16:51 +00:00
|
|
|
QPointer<QTimer> refreshTimer;
|
|
|
|
|
|
|
|
obs_output_t *GetOutput();
|
|
|
|
|
|
|
|
void Activate();
|
|
|
|
void Deactivate();
|
|
|
|
|
|
|
|
void UpdateDelayMsg();
|
|
|
|
void UpdateBandwidth();
|
2017-04-19 19:54:15 +00:00
|
|
|
void UpdateStreamTime();
|
|
|
|
void UpdateRecordTime();
|
2016-02-23 23:16:51 +00:00
|
|
|
void UpdateDroppedFrames();
|
|
|
|
|
|
|
|
static void OBSOutputReconnect(void *data, calldata_t *params);
|
|
|
|
static void OBSOutputReconnectSuccess(void *data, calldata_t *params);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void Reconnect(int seconds);
|
|
|
|
void ReconnectSuccess();
|
|
|
|
void UpdateStatusBar();
|
|
|
|
void UpdateCPUUsage();
|
|
|
|
|
|
|
|
public:
|
|
|
|
OBSBasicStatusBar(QWidget *parent);
|
|
|
|
|
|
|
|
void StreamDelayStarting(int sec);
|
|
|
|
void StreamDelayStopping(int sec);
|
|
|
|
void StreamStarted(obs_output_t *output);
|
|
|
|
void StreamStopped();
|
|
|
|
void RecordingStarted(obs_output_t *output);
|
|
|
|
void RecordingStopped();
|
2016-08-28 12:07:43 +00:00
|
|
|
|
|
|
|
void ReconnectClear();
|
2016-02-23 23:16:51 +00:00
|
|
|
};
|