main.cpp 778 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "widget.h"
  2. #include <QApplication>
  3. #include <QSurfaceFormat>
  4. #include "Logs/loginit.h"
  5. #include "spdlog/spdlog.h"
  6. #include "FmtLog/fmtlog.h"
  7. #include <QProcessEnvironment>
  8. // extern "C" {
  9. // #include <libavcodec/avcodec.h>
  10. // #include <libavutil/hwcontext.h>
  11. // }
  12. int main(int argc, char *argv[])
  13. {
  14. QApplication a(argc, argv);
  15. init_log();
  16. // 设置 QT_QPA_PLATFORM 环境变量
  17. qputenv("QT_QPA_PLATFORM", "cocoa");
  18. QSurfaceFormat format;
  19. format.setDepthBufferSize(24);
  20. format.setStencilBufferSize(8);
  21. format.setVersion(3, 3);
  22. format.setProfile(QSurfaceFormat::CoreProfile);
  23. QSurfaceFormat::setDefaultFormat(format);
  24. SPDLOG_INFO("********** VideoPlayer **********");
  25. Widget w;
  26. w.show();
  27. return a.exec();
  28. }