|
|
|
#include "mainwindow.h"
|
|
|
|
|
|
|
|
#include <QList>
|
|
|
|
|
|
|
|
#include "ui_mainwindow.h"
|
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget* parent)
|
|
|
|
: QMainWindow(parent), ui(new Ui::MainWindow) {
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
|
|
|
// QList<QString> list;
|
|
|
|
// list.append("rtmp://liteavapp.qcloud.com/live/liteavdemoplayerstreamid");
|
|
|
|
// list.append("rtsp://182.92.130.23/nmyj/video");
|
|
|
|
// list.append("rtmp://182.92.130.23/nmyj/video");
|
|
|
|
// list.append("rtmp://ns8.indexforce.com/home/mystream");
|
|
|
|
// // ui->videoWidget->udpPlay("172.10.1.199", 13001);
|
|
|
|
// ui->videoWidget->setVedioSaveFileDirPath("./video");
|
|
|
|
|
|
|
|
// ui->videoWidget->play(list.at(1));
|
|
|
|
// ui->videoWidget->pushStream("udp://172.10.1.199:8009");
|
|
|
|
|
|
|
|
QString urlFile = "networkSettingInfo.ini";
|
|
|
|
QFile file(urlFile);
|
|
|
|
if (!file.exists()) {
|
|
|
|
file.open(QIODevice::WriteOnly);
|
|
|
|
file.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
g_networkSettingInfo =
|
|
|
|
new QSettings("networkSettingInfo.ini", QSettings::IniFormat);
|
|
|
|
|
|
|
|
initSignalConnection();
|
|
|
|
initNotifyManager();
|
|
|
|
initNotifyMessageConnection();
|
|
|
|
}
|
|
|
|
|
|
|
|
MainWindow::~MainWindow() {
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::initSignalConnection() {
|
|
|
|
connect(ui->commandWidget, &CommandWidget::startConnectionSignal,
|
|
|
|
ui->videoWidget, &VideoWidget::udpPlay, Qt::UniqueConnection);
|
|
|
|
|
|
|
|
connect(ui->commandWidget, &CommandWidget::stopConnectionSignal,
|
|
|
|
ui->videoWidget, &VideoWidget::stopPlay, Qt::UniqueConnection);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::initNotifyMessageConnection() {
|
|
|
|
connect(ui->videoWidget, &VideoWidget::sendErrorMessageSignal, this,
|
|
|
|
&MainWindow::showMessageSlots);
|
|
|
|
connect(ui->commandWidget, &CommandWidget::sendErrorMessage, this,
|
|
|
|
&MainWindow::showMessageSlots);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::initNotifyManager() {
|
|
|
|
m_notifyManager = new NotifyManager(this, this);
|
|
|
|
m_notifyManager->setMaxCount(5);
|
|
|
|
m_notifyManager->setDisplayTime(2000);
|
|
|
|
m_notifyManager->setNotifyWndSize(400, 60);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MainWindow::showMessageSlots(QString message, int type) {
|
|
|
|
if (m_notifyManager) {
|
|
|
|
m_notifyManager->notify(message, "", type, 3000);
|
|
|
|
}
|
|
|
|
}
|