Просмотр исходного кода

移动头文件到cpp文件 防止重复包含

zhuizhu 9 месяцев назад
Родитель
Сommit
48862475bd

+ 1 - 1
AvPlayer2/PlayWidget.cpp

@@ -105,7 +105,7 @@ void PlayWidget::setPlayerController(PlayerController* controller)
             m_btnPlayPause->setText("暂停");
     });
 
-    controller->startToPlay("C:/Users/zhuizhu/Videos/1.mp4");
+    // controller->startToPlay("C:/Users/zhuizhu/Videos/1.mp4");
 }
 
 void PlayWidget::onPlayPauseClicked()

+ 12 - 0
AvPlayer2/playercontroller.cpp

@@ -12,6 +12,18 @@
 #include "start_play_thread.h"
 #include "video_state.h"
 
+#include "audio_decode_thread.h"
+#include "audio_effect_helper.h"
+#include "audio_play_thread.h"
+#include "play_control_window.h"
+#include "read_thread.h"
+#include "start_play_thread.h"
+#include "stopplay_waiting_thread.h"
+#include "subtitle_decode_thread.h"
+#include "video_decode_thread.h"
+#include "video_play_thread.h"
+#include "video_state.h"
+
 PlayerController::PlayerController(QWidget* parent)
     : QObject(parent)
 {

+ 13 - 11
AvPlayer2/playercontroller.h

@@ -13,17 +13,19 @@
 #include <QWidget>
 #include <memory>
 
-#include "audio_decode_thread.h"
-#include "audio_effect_helper.h"
-#include "audio_play_thread.h"
-#include "play_control_window.h"
-#include "read_thread.h"
-#include "start_play_thread.h"
-#include "stopplay_waiting_thread.h"
-#include "subtitle_decode_thread.h"
-#include "video_decode_thread.h"
-#include "video_play_thread.h"
-#include "video_state.h"
+#include "AVPlayer2/audio_play_thread.h"
+
+class ReadThread;
+class VideoDecodeThread;
+class AudioDecodeThread;
+class SubtitleDecodeThread;
+class AudioPlayThread;
+class VideoPlayThread;
+class VideoStateData;
+class StartPlayThread;
+class StopWaitingThread;
+
+struct VideoState;
 
 class OpenGLVideoWidget;
 

+ 1 - 0
AvPlayer2/start_play_thread.cpp

@@ -8,6 +8,7 @@
 // ***********************************************************/
 
 #include "start_play_thread.h"
+#include "AVPlayer2/video_state.h"
 #include "playercontroller.h"
 
 StartPlayThread::StartPlayThread(QObject* parent)

+ 6 - 6
AvRecorder/capturer/video/wgc_capturer.cpp

@@ -7,7 +7,7 @@
 winrt::Windows::System::DispatcherQueue* WgcCapturer::queuePtr = nullptr;
 winrt::Windows::UI::Composition::ContainerVisual* WgcCapturer::rootPtr = nullptr;
 std::list<WgcCapturer*> WgcCapturer::_capturers;
-QWidget* __widget = nullptr;
+// QWidget* __widget = nullptr;
 
 void WgcCapturer::Init()
 {
@@ -20,14 +20,14 @@ void WgcCapturer::Init()
     static auto controller = CreateDispatcherQueueController();
     // Initialize Composition
     static auto compositor = Compositor();
-    __widget = new QWidget;
-    __widget->hide();
+    // __widget = new QWidget;
+    // __widget->hide();
     // __widget->resize(800, 600);
     // __widget->show();
-    static auto target = CreateDesktopWindowTarget(compositor, (HWND)__widget->winId());
+    // static auto target = CreateDesktopWindowTarget(compositor, (HWND)__widget->winId());
     static auto root = compositor.CreateContainerVisual();
     root.RelativeSizeAdjustment({1.0f, 1.0f});
-    target.Root(root);
+    // target.Root(root);
 
     // Enqueue our capture work on the dispatcher
     static auto queue = controller.DispatcherQueue();
@@ -39,7 +39,7 @@ void WgcCapturer::Init()
 
 void WgcCapturer::Uninit()
 {
-    delete __widget;
+    // delete __widget;
     while (!_capturers.empty()) {
         delete *_capturers.begin();
         _capturers.erase(_capturers.begin());

+ 1 - 1
AvRecorder/ui/av_recorder.cpp

@@ -13,7 +13,7 @@ AvRecorder::AvRecorder(QWidget* parent)
     m_settingsParam.videoParam.fps = 30;
     m_settingsParam.videoParam.name = Encoder<MediaType::VIDEO>::GetUsableEncoders().front();
     m_settingsParam.outputDir = ".";
-    m_settingsParam.liveUrl = "rtmp://127.0.0.1:1935/hls/111111";
+    m_settingsParam.liveUrl = "rtmp://192.168.3.76:1935/stream/V1";
     m_settingsParam.liveName = "stream";
 
     m_glWidget = new OpenGLVideoWidget(this);

+ 3 - 2
main.cpp

@@ -30,6 +30,8 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const Q
     case QtWarningMsg:  typeStr = "WARN "; break;
     case QtCriticalMsg: typeStr = "ERROR"; break;
     case QtFatalMsg:    typeStr = "FATAL"; break;
+    case QtInfoMsg:
+        break;
     }
 
     QString logMsg = QString("%1 [%2] %3 (%4:%5)\n")
@@ -45,7 +47,6 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const Q
     if (type == QtFatalMsg)
         abort();
 }
-#include "AvPlayer2/mainwindowa.h"
 int main(int argc, char* argv[])
 {
     // 打开日志文件(覆盖模式)
@@ -89,7 +90,7 @@ zlmediakit/zlmediakit:master
     // // w.startPlay("http://vd3.bdstatic.com/mda-jennyc5ci1ugrxzi/mda-jennyc5ci1ugrxzi.mp4");
 
     // w.open("C:/Users/zhuizhu/Videos/1.mp4");
-    // // w.startPlay("rtmp://127.0.0.1:1936/stream/V1");
+    // // w.startPlay("rtmp://192.168.3.76:1935/stream/V1/stream");
 
     int ret = a.exec();