You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1.1 KiB

#include <QApplication>
#include <QDesktopWidget>
#include <QSurfaceFormat>
#include <QMainWindow>
#ifdef QT_STATIC
# include <QtPlugin>
# ifdef _WIN32
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
# endif
#endif
#include "qtvlcwidget.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// this important so we can call makeCurrent from our rendering thread
QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
QSurfaceFormat fmt;
fmt.setDepthBufferSize(24);
QSurfaceFormat::setDefaultFormat(fmt);
QMainWindow mainWindow;
QtVLCWidget *glWidget = new QtVLCWidget;
mainWindow.setCentralWidget(glWidget);
mainWindow.resize(mainWindow.sizeHint());
int desktopArea = QApplication::desktop()->width() *
QApplication::desktop()->height();
int widgetArea = mainWindow.width() * mainWindow.height();
if (((float)widgetArea / (float)desktopArea) < 0.75f)
mainWindow.show();
else
mainWindow.showMaximized();
glWidget->playMedia(argv[1]);
return app.exec();
}