|
|
|
@ -26,11 +26,14 @@ void GDDCSet::initWindow() {
|
|
|
|
|
}
|
|
|
|
|
void GDDCSet::initUDPSocket() {}
|
|
|
|
|
void GDDCSet::initParam() {
|
|
|
|
|
m_FlowType = "";
|
|
|
|
|
|
|
|
|
|
// m_myPairNetwork("",0,"",0);
|
|
|
|
|
// QSettings setting("./sentence.ini",QSettings::IniFormat);
|
|
|
|
|
// setting.setIniCodec(QTextCodec::codecForName("UTF-8")); //重点
|
|
|
|
|
|
|
|
|
|
ui->comboBox_streamType->addItem("RTSP");
|
|
|
|
|
ui->comboBox_streamType->addItem("RTMP");
|
|
|
|
|
// ui->comboBox_streamType->addItem("UDP Raw");
|
|
|
|
|
// ui->comboBox_streamType->addItem("UDP 422");
|
|
|
|
|
// ui->comboBox_streamType->addItem("UDP TS");
|
|
|
|
@ -52,10 +55,20 @@ void GDDCSet::initParam() {
|
|
|
|
|
char *strSysIniName = m_configIniPath.data(); // 系统配置文件路径
|
|
|
|
|
char inBuf[100];
|
|
|
|
|
|
|
|
|
|
::GetPrivateProfileStringA("光电吊舱-视频连接-显示窗口2", "播放URL", "-1",
|
|
|
|
|
::GetPrivateProfileStringA("光电吊舱-视频连接-显示窗口1", "流类型", "-1",
|
|
|
|
|
inBuf, 100, strSysIniName);
|
|
|
|
|
m_FlowType = streamTypeToflowType(QString::fromUtf8(inBuf));
|
|
|
|
|
ui->comboBox_streamType->setCurrentText(flowTypeTostreamType(m_FlowType));
|
|
|
|
|
|
|
|
|
|
::GetPrivateProfileStringA("光电吊舱-视频连接-显示窗口1", "播放URL", "-1",
|
|
|
|
|
inBuf, 100, strSysIniName);
|
|
|
|
|
m_playURL2 = QString::fromUtf8(inBuf);
|
|
|
|
|
ui->lineEdit_playURL2->setText(m_playURL2);
|
|
|
|
|
m_playURL1 = QString::fromUtf8(inBuf);
|
|
|
|
|
ui->comboBox_playURL1->setCurrentText(m_playURL1);
|
|
|
|
|
|
|
|
|
|
// ::GetPrivateProfileStringA("光电吊舱-视频连接-显示窗口2", "播放URL", "-1",
|
|
|
|
|
// inBuf, 100, strSysIniName);
|
|
|
|
|
// m_playURL2 = QString::fromUtf8(inBuf);
|
|
|
|
|
// ui->lineEdit_playURL2->setText(m_playURL2);
|
|
|
|
|
|
|
|
|
|
::GetPrivateProfileStringA("光电吊舱-推流", "推流URL", "-1", inBuf, 100,
|
|
|
|
|
strSysIniName);
|
|
|
|
@ -145,10 +158,10 @@ void GDDCSet::on_pushButton_pushURL_clicked() {
|
|
|
|
|
saveDataToLocalIni();
|
|
|
|
|
if (ui->pushButton_pushURL->text() == "推送") {
|
|
|
|
|
emit SignalStartConnect(6);
|
|
|
|
|
ui->pushButton_pushURL->setText("停止推送");
|
|
|
|
|
//ui->pushButton_pushURL->setText("停止推送");
|
|
|
|
|
} else {
|
|
|
|
|
emit SignalStopConnect(6);
|
|
|
|
|
ui->pushButton_pushURL->setText("推送");
|
|
|
|
|
//ui->pushButton_pushURL->setText("推送");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -182,12 +195,26 @@ void GDDCSet::saveDataToLocalIni() {
|
|
|
|
|
::WritePrivateProfileStringA("光电吊舱-网络控制", "远端Port", inBuf,
|
|
|
|
|
strSysIniName);
|
|
|
|
|
|
|
|
|
|
m_playURL2 = ui->lineEdit_playURL2->text();
|
|
|
|
|
ba = m_playURL2.toLocal8Bit();
|
|
|
|
|
QString streamType = ui->comboBox_streamType->currentText();
|
|
|
|
|
m_FlowType = streamTypeToflowType(streamType);
|
|
|
|
|
ba = streamType.toLocal8Bit();
|
|
|
|
|
inBuf = ba.data();
|
|
|
|
|
::WritePrivateProfileStringA("光电吊舱-视频连接-显示窗口2", "播放URL", inBuf,
|
|
|
|
|
::WritePrivateProfileStringA("光电吊舱-视频连接-显示窗口1", "流类型", inBuf,
|
|
|
|
|
strSysIniName);
|
|
|
|
|
|
|
|
|
|
m_playURL1 = ui->comboBox_playURL1->currentText();
|
|
|
|
|
ba = m_playURL1.toLocal8Bit();
|
|
|
|
|
inBuf = ba.data();
|
|
|
|
|
::WritePrivateProfileStringA("光电吊舱-视频连接-显示窗口1", "播放URL", inBuf,
|
|
|
|
|
strSysIniName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// m_playURL2 = ui->lineEdit_playURL2->text();
|
|
|
|
|
// ba = m_playURL2.toLocal8Bit();
|
|
|
|
|
// inBuf = ba.data();
|
|
|
|
|
// ::WritePrivateProfileStringA("光电吊舱-视频连接-显示窗口2", "播放URL", inBuf,
|
|
|
|
|
// strSysIniName);
|
|
|
|
|
|
|
|
|
|
m_pushURL = ui->lineEdit_pushURL->text();
|
|
|
|
|
ba = m_pushURL.toLocal8Bit();
|
|
|
|
|
inBuf = ba.data();
|
|
|
|
@ -196,3 +223,65 @@ void GDDCSet::saveDataToLocalIni() {
|
|
|
|
|
|
|
|
|
|
m_playURL1 = ui->comboBox_playURL1->currentText();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// //流类型
|
|
|
|
|
// void GDDCSet::on_comboBox_streamType_currentIndexChanged(int index)
|
|
|
|
|
// {
|
|
|
|
|
// switch(index)
|
|
|
|
|
// {
|
|
|
|
|
// case 0:
|
|
|
|
|
// m_FlowType = "TCP";
|
|
|
|
|
// break;
|
|
|
|
|
// case 1:
|
|
|
|
|
// m_FlowType = "UDP";
|
|
|
|
|
// break;
|
|
|
|
|
// default:
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
QString GDDCSet::streamTypeToflowType(QString type)
|
|
|
|
|
{
|
|
|
|
|
if(type == "RTSP")
|
|
|
|
|
{
|
|
|
|
|
return "TCP";
|
|
|
|
|
}
|
|
|
|
|
else if(type == "RTMP")
|
|
|
|
|
{
|
|
|
|
|
return "UDP";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return "TCP";
|
|
|
|
|
}
|
|
|
|
|
QString GDDCSet::flowTypeTostreamType(QString type)
|
|
|
|
|
{
|
|
|
|
|
if(type == "TCP")
|
|
|
|
|
{
|
|
|
|
|
return "RTSP";
|
|
|
|
|
}
|
|
|
|
|
else if(type == "UDP")
|
|
|
|
|
{
|
|
|
|
|
return "RTMP";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return "RTSP";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GDDCSet::setConnectURL1Text(QString param)
|
|
|
|
|
{
|
|
|
|
|
ui->pushButton_ConnectURL1->setText(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GDDCSet::setConnectURL2Text(QString param)
|
|
|
|
|
{
|
|
|
|
|
ui->pushButton_ConnectURL1->setText(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GDDCSet::setNetCtrlText(QString param)
|
|
|
|
|
{
|
|
|
|
|
ui->pushButton_NetCtrlConnect->setText(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GDDCSet::setPushStreamText(QString param)
|
|
|
|
|
{
|
|
|
|
|
ui->pushButton_pushURL->setText(param);
|
|
|
|
|
}
|
|
|
|
|