2021-07-30 09:32:13 +00:00
|
|
|
#include <QApplication>
|
|
|
|
#include <QQmlApplicationEngine>
|
|
|
|
#include <QQmlContext>
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
gst_init (&argc, &argv);
|
|
|
|
|
2024-02-21 08:13:45 +00:00
|
|
|
int ret;
|
|
|
|
{
|
|
|
|
QGuiApplication app (argc, argv);
|
|
|
|
QQmlApplicationEngine engine;
|
2021-07-30 09:32:13 +00:00
|
|
|
|
2024-02-21 08:13:45 +00:00
|
|
|
/* make sure that plugin was loaded */
|
|
|
|
GstElement *qmlglsink = gst_element_factory_make ("qmlglsink", NULL);
|
|
|
|
g_assert (qmlglsink);
|
|
|
|
gst_clear_object (&qmlglsink);
|
2021-07-30 09:32:13 +00:00
|
|
|
|
2024-02-21 08:13:45 +00:00
|
|
|
/* anything supported by videotestsrc */
|
|
|
|
QStringList patterns (
|
|
|
|
{
|
|
|
|
"smpte", "ball", "spokes", "gamut"});
|
2021-07-30 09:32:13 +00:00
|
|
|
|
2024-02-21 08:13:45 +00:00
|
|
|
engine.rootContext ()->setContextProperty ("patterns",
|
|
|
|
QVariant::fromValue (patterns));
|
2021-07-30 09:32:13 +00:00
|
|
|
|
2024-02-21 08:13:45 +00:00
|
|
|
QObject::connect (&engine, &QQmlEngine::quit, [&] {
|
|
|
|
qApp->quit ();
|
|
|
|
});
|
2021-07-30 09:32:13 +00:00
|
|
|
|
2024-02-21 08:13:45 +00:00
|
|
|
engine.load (QUrl (QStringLiteral ("qrc:///main.qml")));
|
2021-07-30 09:32:13 +00:00
|
|
|
|
2024-02-21 08:13:45 +00:00
|
|
|
ret = app.exec();
|
|
|
|
}
|
|
|
|
gst_deinit();
|
|
|
|
|
|
|
|
return ret;
|
2021-07-30 09:32:13 +00:00
|
|
|
}
|