Skip to content

Commit

Permalink
sdp path
Browse files Browse the repository at this point in the history
  • Loading branch information
liangzhuohua committed Jun 13, 2024
1 parent 8a422cf commit a93f373
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/QmlNativeAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef CTRLCENTER_QMLNATIVEAPI_H
#define CTRLCENTER_QMLNATIVEAPI_H
#include "WFBReceiver.h"
#include <QDir>
#include <QFileInfo>
#include <QObject>
#include <QUdpSocket>
#include <fstream>
Expand Down Expand Up @@ -41,8 +43,13 @@ class QmlNativeAPI : public QObject {
Q_INVOKABLE static bool Stop() {
return WFBReceiver::Stop();
}
Q_INVOKABLE static void BuildSdp(const QString &path,const QString &codec,int payloadType,int port) {
std::ofstream sdpFos(path.toStdString());
Q_INVOKABLE static void BuildSdp(const QString &filePath,const QString &codec,int payloadType,int port) {
QString dirPath = QFileInfo(filePath).absolutePath();
QDir dir(dirPath);
if (!dir.exists()) {
dir.mkpath(dirPath);
}
std::ofstream sdpFos(filePath.toStdString());
sdpFos<<"v=0\n";
sdpFos<<"o=- 0 0 IN IP4 127.0.0.1\n";
sdpFos<<"s=No Name\n";
Expand Down

0 comments on commit a93f373

Please sign in to comment.