main.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // #include "AVPlayer2/mainwindowa.h"
  2. #include "ui/av_recorder.h"
  3. #include <QApplication>
  4. #include <QAudioDeviceInfo>
  5. #include <QAudioOutput>
  6. #include <QDateTime>
  7. #include <QDebug>
  8. #include <QFile>
  9. #include <QLoggingCategory>
  10. #include <QMutex>
  11. #include <QTextStream>
  12. #include <QVBoxLayout>
  13. #include <qendian.h>
  14. #include <qmath.h>
  15. #include "mainwindow.h"
  16. #include "thememanager.h"
  17. #include "themesettingswidget.h"
  18. namespace avrecorder::video {
  19. void InitWinRTCapture();
  20. }
  21. int main(int argc, char *argv[])
  22. {
  23. QLoggingCategory::setFilterRules(QStringLiteral("player.controller.ReadThread=false\n"
  24. "player.controller.AudioPlayThread=false\n"));
  25. // QLoggingCategory::setFilterRules("*.debug=false\n"
  26. // "*.info=false\n"
  27. // "*.warning=false\n"
  28. // "*.critical=false\n"
  29. // "player.controller.*.debug=true\n"
  30. // "player.controller.*.info=true\n");
  31. // 安装日志处理器
  32. //qInstallMessageHandler(myMessageHandler);
  33. // std::freopen(nullptr, "w", stdout);
  34. setvbuf(stdout, nullptr, _IONBF, 0);
  35. #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
  36. QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
  37. Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
  38. #endif
  39. #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
  40. QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  41. QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
  42. #endif
  43. QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
  44. QApplication a(argc, argv);
  45. qRegisterMetaType<AVFrame *>("AVFrame*");
  46. ThemeManager::instance().setThemeMode(ThemeManager::Light);
  47. // 注册Room 相关的类型 方便 序列化
  48. void initRoomType();
  49. initRoomType();
  50. // 初始化wgc
  51. avrecorder::video::InitWinRTCapture();
  52. /*
  53. docker run -itd --name zlmediakit --restart=always
  54. -p 1935:1935 -p 8080:80 -p 8443:443
  55. -p 8554:554 -p 10000:10000
  56. -p 10000:10000/udp -p 8000:8000/udp
  57. -p 9000:9000/udp
  58. -v /data/zlmediakit/media/bin:/opt/media/bin
  59. -v /data/zlmediakit/media/conf:/opt/media/conf
  60. zlmediakit/zlmediakit:master
  61. */
  62. // MainWindow w;
  63. // w.show();
  64. AvRecorder avRecorder;
  65. avRecorder.show();
  66. // ThemeSettingsWidget ThemeSettingsWidget;
  67. // ThemeSettingsWidget.show();
  68. // PlayerWindow w;
  69. // w.resize(960, 540);
  70. // w.show();
  71. // MainWindowA aa;
  72. // aa.show();
  73. // // 这里填你的流地址
  74. // // w.startPlay("http://vd3.bdstatic.com/mda-jennyc5ci1ugrxzi/mda-jennyc5ci1ugrxzi.mp4");
  75. // w.open("C:/Users/zhuizhu/Videos/1.mp4");
  76. // // w.startPlay("rtmp://192.168.3.76:1935/stream/V1/stream");
  77. int ret = a.exec();
  78. return ret;
  79. }