main.cpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // #include "AVPlayer2/mainwindowa.h"
  2. // #include "mainwindow.h"
  3. // #include "thememanager.h"
  4. // #include "themesettingswidget.h"
  5. // #include <QApplication>
  6. // #include <QAudioDeviceInfo>
  7. // #include <QAudioOutput>
  8. // #include <QDebug>
  9. // #include <QVBoxLayout>
  10. // #include <qendian.h>
  11. // #include <qmath.h>
  12. // #include <QFile>
  13. // #include <QTextStream>
  14. // #include <QDateTime>
  15. // #include <QMutex>
  16. // #include <QLoggingCategory>
  17. // QFile g_logFile;
  18. // QTextStream* g_logStream = nullptr;
  19. // QMutex g_logMutex;
  20. // void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
  21. // {
  22. // QMutexLocker locker(&g_logMutex);
  23. // if (!g_logStream) return;
  24. // QString typeStr;
  25. // switch (type) {
  26. // case QtDebugMsg: typeStr = "DEBUG"; break;
  27. // case QtWarningMsg: typeStr = "WARN "; break;
  28. // case QtCriticalMsg: typeStr = "ERROR"; break;
  29. // case QtFatalMsg: typeStr = "FATAL"; break;
  30. // case QtInfoMsg:
  31. // break;
  32. // }
  33. // QString logMsg = QString("%1 [%2] %3 (%4:%5)\n")
  34. // .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz"))
  35. // .arg(typeStr)
  36. // .arg(msg)
  37. // .arg(QString(context.file ? context.file : ""))
  38. // .arg(context.line);
  39. // (*g_logStream) << logMsg;
  40. // g_logStream->flush();
  41. // if (type == QtFatalMsg)
  42. // abort();
  43. // }
  44. // namespace avrecorder::video { void InitWinRTCapture(); }
  45. // int main(int argc, char* argv[])
  46. // {
  47. // QLoggingCategory::setFilterRules(QStringLiteral("player.controller.ReadThread=false\n"
  48. // "player.controller.AudioPlayThread=false\n"));
  49. // // QLoggingCategory::setFilterRules("*.debug=false\n"
  50. // // "*.info=false\n"
  51. // // "*.warning=false\n"
  52. // // "*.critical=false\n"
  53. // // "player.controller.*.debug=true\n"
  54. // // "player.controller.*.info=true\n");
  55. // // 打开日志文件(覆盖模式)
  56. // g_logFile.setFileName("log.txt");
  57. // g_logFile.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate);
  58. // g_logStream = new QTextStream(&g_logFile);
  59. // // 安装日志处理器
  60. // //qInstallMessageHandler(myMessageHandler);
  61. // // std::freopen(nullptr, "w", stdout);
  62. // setvbuf(stdout, nullptr, _IONBF, 0);
  63. // #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
  64. // QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
  65. // Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
  66. // #endif
  67. // #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
  68. // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  69. // QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
  70. // #endif
  71. // QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
  72. // QApplication a(argc, argv);
  73. // ThemeManager::instance().setThemeMode(ThemeManager::Light);
  74. // // 注册Room 相关的类型 方便 序列化
  75. // void initRoomType();
  76. // initRoomType();
  77. // // 初始化wgc
  78. // avrecorder::video::InitWinRTCapture();
  79. // /*
  80. // docker run -itd --name zlmediakit --restart=always
  81. // -p 1935:1935 -p 8080:80 -p 8443:443
  82. // -p 8554:554 -p 10000:10000
  83. // -p 10000:10000/udp -p 8000:8000/udp
  84. // -p 9000:9000/udp
  85. // -v /data/zlmediakit/media/bin:/opt/media/bin
  86. // -v /data/zlmediakit/media/conf:/opt/media/conf
  87. // zlmediakit/zlmediakit:master
  88. // */
  89. // // MainWindow w;
  90. // // w.show();
  91. // // 视频播放测试
  92. // MainWindowA aa;
  93. // aa.show();
  94. // // ThemeSettingsWidget ThemeSettingsWidget;
  95. // // ThemeSettingsWidget.show();
  96. // // PlayerWindow w;
  97. // // w.resize(960, 540);
  98. // // w.show();
  99. // // // 这里填你的流地址
  100. // // // w.startPlay("http://vd3.bdstatic.com/mda-jennyc5ci1ugrxzi/mda-jennyc5ci1ugrxzi.mp4");
  101. // // w.open("C:/Users/zhuizhu/Videos/1.mp4");
  102. // // // w.startPlay("rtmp://192.168.3.76:1935/stream/V1/stream");
  103. // int ret = a.exec();
  104. // delete g_logStream;
  105. // g_logFile.close();
  106. // return ret;
  107. // }