#include "defs.h"
#include "mainwindow.h"
#include "ffmpeg_raii.h"
+#include "httpd.h"
#include "player.h"
#include "post_to_main_thread.h"
#include "ui_mainwindow.h"
mutex frame_mu;
vector<int64_t> frames[MAX_STREAMS];
+QGLWidget *global_share_widget;
+HTTPD *global_httpd;
int record_thread_func();
int main(int argc, char **argv)
{
- av_register_all();
avformat_network_init();
+ global_httpd = new HTTPD;
+ global_httpd->start(DEFAULT_HTTPD_PORT);
+
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
+
+ QSurfaceFormat fmt;
+ fmt.setDepthBufferSize(0);
+ fmt.setStencilBufferSize(0);
+ fmt.setProfile(QSurfaceFormat::CoreProfile);
+ fmt.setMajorVersion(3);
+ fmt.setMinorVersion(1);
+
+ // Turn off vsync, since Qt generally gives us at most frame rate
+ // (display frequency) / (number of QGLWidgets active).
+ fmt.setSwapInterval(0);
+
+ QSurfaceFormat::setDefaultFormat(fmt);
+
+ QGLFormat::setDefaultFormat(QGLFormat::fromSurfaceFormat(fmt));
QApplication app(argc, argv);
+ global_share_widget = new QGLWidget();
+ if (!global_share_widget->isValid()) {
+ fprintf(stderr, "Failed to initialize OpenGL. Futatabi needs at least OpenGL 3.1 to function properly.\n");
+ exit(1);
+ }
MainWindow mainWindow;
mainWindow.show();