summaryrefslogtreecommitdiff
path: root/tests/examples/videoxoverlay/gstthread.cpp
blob: a11a15fe656c1c41561e7fb8b2322e04a6b7246d (plain)
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
#include "gstthread.h"

GstThread::GstThread(const WId winId, QObject *parent):
    QThread(parent),
    m_winId(winId)
{
}

GstThread::~GstThread()
{
}

void GstThread::exposeRequested()
{
    m_pipeline->exposeRequested();
}

void GstThread::resize(int width, int height)
{
    emit resizeRequested(width, height);
}

void GstThread::stop()
{
    m_pipeline->stop();
}

void GstThread::run()
{
    m_pipeline = new Pipeline(m_winId);
    connect(m_pipeline, SIGNAL(resizeRequested(int, int)), this, SLOT(resize(int, int)));
    m_pipeline->start(); //it runs the gmainloop on win32

    
#ifndef WIN32
    //works like the gmainloop on linux (GstEvent are handled)
    connect(m_pipeline, SIGNAL(stopRequested()), this, SLOT(quit()));
    exec();
#endif
    

    m_pipeline->unconfigure();
}