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.
27 lines
659 B
27 lines
659 B
#include "videosurface.h"
|
|
|
|
VideoSurface::VideoSurface(QObject *parent): QObject(parent), d(new VideoSurfacePrivate){
|
|
|
|
}
|
|
|
|
VideoSurface:: ~VideoSurface(){
|
|
delete d;
|
|
}
|
|
void VideoSurface::onUpdate(){
|
|
Q_FOREACH(QQuickItem *item, d->items){
|
|
item->update();
|
|
}
|
|
}
|
|
void VideoSurface::onUpdateThunk(GstElement *sink, gpointer data){
|
|
Q_UNUSED(sink);
|
|
VideoSurface *pThis = (VideoSurface *)data;
|
|
pThis->onUpdate();
|
|
}
|
|
GstElement *VideoSurface::videoSink(){
|
|
d->videosink = gst_element_factory_make("qtquick2videosink", NULL);
|
|
g_signal_connect(d->videosink,"update",G_CALLBACK(onUpdateThunk),(void *)this);
|
|
return d->videosink;
|
|
}
|
|
|
|
|