Qt5, gstreamer and QWidget

Marco Trapanese marcotrapanese at gmail.com
Fri May 31 04:19:37 PDT 2013


Hello!

I'm new to gstreamer and I searched in the old threads without find an 
answer.
Please, look at this short code:

Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) {
     ui->setupUi(this);
     this->setAttribute(Qt::WA_NativeWindow, true);

     gst_init(NULL, NULL);
     GstElement *pipeline = gst_pipeline_new ("xvoverlay");
     GstElement *src = gst_element_factory_make ("filesrc", NULL);
     g_object_set(G_OBJECT(src), "location", 
"/home/marco/Video/video.mp4",NULL);
     GstElement *sink = gst_element_factory_make ("ximagesink", NULL);
     gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
     gst_element_link (src, sink);
     gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY(sink), 
this->winId());
     GstStateChangeReturn ret = gst_element_set_state (pipeline, 
GST_STATE_PLAYING);
}

I get the following errors:

0:00:00.015822683  8301  0x9120180 WARN    
          ximagesink 
ximagesink.c:1370:gst_ximagesink_show_frame:<ximagesink0> error: 
Internal error: can't allocate images
0:00:00.015862352  8301  0x9120180 WARN    
          ximagesink 
ximagesink.c:1370:gst_ximagesink_show_frame:<ximagesink0> error: We 
don't have a bufferpool negotiated
0:00:00.015901184  8301  0x9120180 WARN    
             basesrc 
gstbasesrc.c:2812:gst_base_src_loop:<filesrc0> error: Errore 
interno nel flusso di dati.
0:00:00.015913197  8301  0x9120180 WARN    
             basesrc 
gstbasesrc.c:2812:gst_base_src_loop:<filesrc0> error: streaming 
task paused, reason error (-5)

Changing the src definition to:

GstElement *src = gst_element_factory_make ("videotestsrc", NULL);

leads to correctly display the video test on my QWidget.
What's wrong in my pipeline?

Thank you in advance
Marco



More information about the gstreamer-devel mailing list