QtGStreamer: How to get run a QGst::Ui::GraphicsVideoWidget ?

pfarmer flacone at gmx.de
Wed Mar 20 14:17:55 PDT 2013


I am trying to run a simple test video with QtGtreamer. The examples provided
with the QtGStreamer API documentation run successfully. The Voip example (
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html
<http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/examples_2voip_2main_8cpp-example.html> 
) also includes a videotestsrc which is properly displayed. 
Nevertheless a QGst::Ui::VideoWidget in conjunction with watchPipeline() is
used there. I rather wanted to get it work with the help of a
QGst::Ui::GraphicsVideoWidget. Therefore I tried following code:

#include <QGst/Init>
#include <QGst/Pipeline>
#include <QGst/Element>
#include <QGst/ElementFactory>
#include <QGst/Ui/GraphicsVideoSurface>
#include <QGst/Ui/GraphicsVideoWidget>

#include <QApplication>
#include <QGLWidget>
#include <QGraphicsView>
#include <QDebug>

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);
	QGst::init(&argc, &argv);

	QGraphicsView* view = new QGraphicsView;
	view->setViewport(new QGLWidget);
	QGst::Ui::GraphicsVideoSurface* surface = new
QGst::Ui::GraphicsVideoSurface(view);
	QGst::Ui::GraphicsVideoWidget* widget = new
QGst::Ui::GraphicsVideoWidget();
	widget->setSurface(surface);

	QGst::ElementPtr source = QGst::ElementFactory::make("videotestsrc");
	QGst::ElementPtr sink = surface->videoSink();
	QGst::PipelinePtr pipeline = QGst::Pipeline::create();
	pipeline->add(source);
	pipeline->add(sink);
	if(source->link(sink) == false)
		qDebug("Link failed");

	view->show();
	pipeline->setState(QGst::StatePlaying);

	return app.exec();
}


This code is running, but the widget stays empty. What is the mistake I
made? 
Hopefully this is the right place to ask questions about QtGStreamer.




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/QtGStreamer-How-to-get-run-a-QGst-Ui-GraphicsVideoWidget-tp4659202.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list