zhuizhu 8 maanden geleden
bovenliggende
commit
c93f0721da
4 gewijzigde bestanden met toevoegingen van 148 en 146 verwijderingen
  1. 1 1
      AV/AV.pri
  2. 3 1
      AvRecorder/ui/av_recorder.cpp
  3. 1 1
      LearningSmartClient.pro
  4. 143 143
      main.cpp

+ 1 - 1
AV/AV.pri

@@ -42,7 +42,7 @@ SOURCES += \
     $$PWD/code/utils/utils_thread_pool.cpp
 
 include($$PWD/code/player/player.pri)
-# include($$PWD/code/recorder/recorder.pri)
+ include($$PWD/code/recorder/recorder.pri)
 
 # Test files (uncomment to enable)
 # SOURCES += $$PWD/test_basic.cpp

+ 3 - 1
AvRecorder/ui/av_recorder.cpp

@@ -404,7 +404,8 @@ bool AvRecorder::startStream(std::string_view path, std::string_view format)
     m_recordTime = QTime::currentTime();
     m_captureStatusLabel->setText("状态: 正在工作");
     m_settingsBtn->setEnabled(false);
-    // m_captureComboBox->setEnabled(false); // 禁用采集源切换
+    m_captureComboBox->setEnabled(false); // 禁用采集源切换
+    m_syncRecordBox->setEnabled(false);
     m_updateListBtn->setEnabled(false);
     m_captureMethodBox->setEnabled(false); // 禁用采集方式切换
 
@@ -436,6 +437,7 @@ void AvRecorder::stopStream()
     m_captureStatusLabel->setText("状态: 正常");
     m_settingsBtn->setEnabled(true);
     m_captureComboBox->setEnabled(true); // 恢复采集源切换
+    m_syncRecordBox->setEnabled(true);
     m_updateListBtn->setEnabled(true);
     m_captureMethodBox->setEnabled(true); // 恢复采集方式切换
 }

+ 1 - 1
LearningSmartClient.pro

@@ -90,7 +90,7 @@ include($$PWD/fmt.pri)
 include($$PWD/qtpromise/qtpromise.pri)
 include($$PWD/jsonserializer/jsonserializer.pri)
 
-# include($$PWD/AV/AV.pri)
+include($$PWD/AV/AV.pri)
 
 
 INCLUDEPATH+="E:/AAA/ffmpeg-7.0.2-full_build-shared/include"

+ 143 - 143
main.cpp

@@ -1,143 +1,143 @@
-// #include "AVPlayer2/mainwindowa.h"
-
-#include <QApplication>
-#include <QDateTime>
-#include <QDebug>
-#include <QFile>
-#include <QLoggingCategory>
-#include <QMutex>
-#include <QTextStream>
-#include <QVBoxLayout>
-#include <qendian.h>
-#include <qmath.h>
-
-#include <AvPlayer2/PlayWidget.h>
-
-#include "mainwindow.h"
-#include "thememanager.h"
-#include "themesettingswidget.h"
-
-#include "tlogger.h"
-
-#include "ui/av_recorder.h"
-
-namespace avrecorder::video {
-void InitWinRTCapture();
-}
-
-#undef ERROR
-// Qt输出(用于兼容现有Qt日志系统)
-
-namespace TC {
-class QtOutput : public LogOutput
-{
-public:
-    void write(LogLevel level, const std::string &message) override;
-};
-
-void QtOutput::write(LogLevel level, const std::string &message)
-{
-    QString qmsg = QString::fromUtf8(message.c_str());
-    switch (level) {
-    case LogLevel::DEBUG:
-        qDebug() << qmsg;
-        break;
-    case LogLevel::INFO:
-        qInfo() << qmsg;
-        break;
-    case LogLevel::WARNING:
-        qWarning() << qmsg;
-        break;
-    case LogLevel::ERROR:
-        qCritical() << qmsg;
-        break;
-    }
-}
-} // namespace TC
-
-int main(int argc, char *argv[])
-{
-    // "player.controller.ReadThread=false\n"
-    QLoggingCategory::setFilterRules(QStringLiteral("player.controller.AudioPlayThread=false\n"
-                                                    "player.controller.AudioDecodeThread=false\n"));
-    // QLoggingCategory::setFilterRules("*.debug=false\n"
-    //                                  "*.info=false\n"
-    //                                  "*.warning=false\n"
-    //                                  "*.critical=false\n"
-    //                                  "player.controller.*.debug=true\n"
-    //                                  "player.controller.*.info=true\n");
-
-    // 安装日志处理器
-    //qInstallMessageHandler(myMessageHandler);
-
-    // std::freopen(nullptr, "w", stdout);
-    setvbuf(stdout, nullptr, _IONBF, 0);
-
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
-    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
-        Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
-#endif
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
-    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-    QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
-#endif
-
-    QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
-
-    QApplication a(argc, argv);
-
-    qRegisterMetaType<AVFrame *>("AVFrame*");
-
-    ThemeManager::instance().setThemeMode(ThemeManager::Light);
-
-    // 注册Room 相关的类型 方便 序列化
-    void initRoomType();
-    initRoomType();
-
-    // 初始化wgc
-
-    avrecorder::video::InitWinRTCapture();
-
-    /*
-docker run -itd  --name zlmediakit --restart=always
--p 1935:1935 -p 8080:80 -p 8443:443
--p 8554:554 -p 10000:10000
--p 10000:10000/udp -p 8000:8000/udp
--p 9000:9000/udp
--v /data/zlmediakit/media/bin:/opt/media/bin
--v /data/zlmediakit/media/conf:/opt/media/conf
-zlmediakit/zlmediakit:master
-*/
-    MainWindow w;
-    w.show();
-
-    // PlayWidget playWidget;
-    // playWidget.resize(960, 540);
-    // playWidget.show();
-
-    // for (int var = 0; var < 20; ++var) {
-    //     playWidget.startToPlay("C:/Users/zhuizhu/Videos/2.mp4");
-    // }
-
-    // AvRecorder avRecorder;
-    // avRecorder.show();
-    // ThemeSettingsWidget ThemeSettingsWidget;
-    // ThemeSettingsWidget.show();
-
-    // PlayerWindow w;
-    // w.resize(960, 540);
-    // w.show();
-
-    // MainWindowA aa;
-    // aa.show();
-
-    // // 这里填你的流地址
-    // // w.startPlay("http://vd3.bdstatic.com/mda-jennyc5ci1ugrxzi/mda-jennyc5ci1ugrxzi.mp4");
-
-    // w.open("C:/Users/zhuizhu/Videos/1.mp4");
-    // // w.startPlay("rtmp://192.168.3.76:1935/stream/V1/stream");
-
-    int ret = a.exec();
-
-    return ret;
-}
+// // #include "AVPlayer2/mainwindowa.h"
+
+// #include <QApplication>
+// #include <QDateTime>
+// #include <QDebug>
+// #include <QFile>
+// #include <QLoggingCategory>
+// #include <QMutex>
+// #include <QTextStream>
+// #include <QVBoxLayout>
+// #include <qendian.h>
+// #include <qmath.h>
+
+// #include <AvPlayer2/PlayWidget.h>
+
+// #include "mainwindow.h"
+// #include "thememanager.h"
+// #include "themesettingswidget.h"
+
+// #include "tlogger.h"
+
+// #include "ui/av_recorder.h"
+
+// namespace avrecorder::video {
+// void InitWinRTCapture();
+// }
+
+// #undef ERROR
+// // Qt输出(用于兼容现有Qt日志系统)
+
+// namespace TC {
+// class QtOutput : public LogOutput
+// {
+// public:
+//     void write(LogLevel level, const std::string &message) override;
+// };
+
+// void QtOutput::write(LogLevel level, const std::string &message)
+// {
+//     QString qmsg = QString::fromUtf8(message.c_str());
+//     switch (level) {
+//     case LogLevel::DEBUG:
+//         qDebug() << qmsg;
+//         break;
+//     case LogLevel::INFO:
+//         qInfo() << qmsg;
+//         break;
+//     case LogLevel::WARNING:
+//         qWarning() << qmsg;
+//         break;
+//     case LogLevel::ERROR:
+//         qCritical() << qmsg;
+//         break;
+//     }
+// }
+// } // namespace TC
+
+// int main(int argc, char *argv[])
+// {
+//     // "player.controller.ReadThread=false\n"
+//     QLoggingCategory::setFilterRules(QStringLiteral("player.controller.AudioPlayThread=false\n"
+//                                                     "player.controller.AudioDecodeThread=false\n"));
+//     // QLoggingCategory::setFilterRules("*.debug=false\n"
+//     //                                  "*.info=false\n"
+//     //                                  "*.warning=false\n"
+//     //                                  "*.critical=false\n"
+//     //                                  "player.controller.*.debug=true\n"
+//     //                                  "player.controller.*.info=true\n");
+
+//     // 安装日志处理器
+//     //qInstallMessageHandler(myMessageHandler);
+
+//     // std::freopen(nullptr, "w", stdout);
+//     setvbuf(stdout, nullptr, _IONBF, 0);
+
+// #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+//     QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+//         Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
+// #endif
+// #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+//     QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+//     QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+// #endif
+
+//     QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
+
+//     QApplication a(argc, argv);
+
+//     qRegisterMetaType<AVFrame *>("AVFrame*");
+
+//     ThemeManager::instance().setThemeMode(ThemeManager::Light);
+
+//     // 注册Room 相关的类型 方便 序列化
+//     void initRoomType();
+//     initRoomType();
+
+//     // 初始化wgc
+
+//     avrecorder::video::InitWinRTCapture();
+
+//     /*
+// docker run -itd  --name zlmediakit --restart=always
+// -p 1935:1935 -p 8080:80 -p 8443:443
+// -p 8554:554 -p 10000:10000
+// -p 10000:10000/udp -p 8000:8000/udp
+// -p 9000:9000/udp
+// -v /data/zlmediakit/media/bin:/opt/media/bin
+// -v /data/zlmediakit/media/conf:/opt/media/conf
+// zlmediakit/zlmediakit:master
+// */
+//     MainWindow w;
+//     w.show();
+
+//     // PlayWidget playWidget;
+//     // playWidget.resize(960, 540);
+//     // playWidget.show();
+
+//     // for (int var = 0; var < 20; ++var) {
+//     //     playWidget.startToPlay("C:/Users/zhuizhu/Videos/2.mp4");
+//     // }
+
+//     // AvRecorder avRecorder;
+//     // avRecorder.show();
+//     // ThemeSettingsWidget ThemeSettingsWidget;
+//     // ThemeSettingsWidget.show();
+
+//     // PlayerWindow w;
+//     // w.resize(960, 540);
+//     // w.show();
+
+//     // MainWindowA aa;
+//     // aa.show();
+
+//     // // 这里填你的流地址
+//     // // w.startPlay("http://vd3.bdstatic.com/mda-jennyc5ci1ugrxzi/mda-jennyc5ci1ugrxzi.mp4");
+
+//     // w.open("C:/Users/zhuizhu/Videos/1.mp4");
+//     // // w.startPlay("rtmp://192.168.3.76:1935/stream/V1/stream");
+
+//     int ret = a.exec();
+
+//     return ret;
+// }