-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (29 loc) · 713 Bytes
/
main.cpp
File metadata and controls
46 lines (29 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <QtGui>
#include <QtGui/QApplication>
#include <QCoreApplication>
#include <QApplication>
#include "stream.h"
#include "mainwindow.h"
stream *strm;
int main(int argc, char *argv[])
{
QApplication app(argc,argv);
strm = new stream();
Task* task = new Task();
MainWindow window;
window.show();
QObject::connect(task, SIGNAL(finished()),&app, SLOT(quit()));
gst_init(&argc, &argv);
QTimer::singleShot(10, task, SLOT(run()));
return app.exec();
}
void Task::run()
{
bool pipelinebuilt = false;
pipelinebuilt = strm->buildpipeline();
if(pipelinebuilt){
strm->startstream();
}
QCoreApplication::instance()->quit();
return;
}