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 [334m 8301[00m 0x9120180 [33;01mWARN [00m
[00m ximagesink
ximagesink.c:1370:gst_ximagesink_show_frame:<ximagesink0>[00m error:
Internal error: can't allocate images
0:00:00.015862352 [334m 8301[00m 0x9120180 [33;01mWARN [00m
[00m ximagesink
ximagesink.c:1370:gst_ximagesink_show_frame:<ximagesink0>[00m error: We
don't have a bufferpool negotiated
0:00:00.015901184 [334m 8301[00m 0x9120180 [33;01mWARN [00m
[00m basesrc
gstbasesrc.c:2812:gst_base_src_loop:<filesrc0>[00m error: Errore
interno nel flusso di dati.
0:00:00.015913197 [334m 8301[00m 0x9120180 [33;01mWARN [00m
[00m basesrc
gstbasesrc.c:2812:gst_base_src_loop:<filesrc0>[00m 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