multiple streams in QWidget
prkhr4u
prakhargupta at bel.co.in
Sat Feb 1 00:36:02 PST 2014
I want to implement multiple mjpeg streams from IP Cameras in one/more
QWidget.
I have successfully implemented 1 stream in one QWidget but is not able to
play streams from 2 cameras simultaneously..
What are the possible options for me?
Here is my implementation for single stream:
if (!g_thread_supported ())
g_thread_init (NULL);
gst_init (NULL, NULL);
QApplication app(NULL, NULL);
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ()));
// prepare the pipeline
GstElement *pipeline = gst_pipeline_new ("xvoverlay");
GstElement *src = gst_element_factory_make ("souphttpsrc",NULL);
GstElement *sink = gst_element_factory_make ("xvimagesink", NULL);
GstElement *jpegdec = gst_element_factory_make("jpegdec",NULL);
//assert(jpegdec);
gst_bin_add_many (GST_BIN (pipeline), src,jpegdec, sink, NULL);
gst_element_link_many(src,jpegdec, sink);
g_object_set (src, "location", "http://169.254.75.39/video2.mjpg",
NULL);
// prepare the ui
QWidget window;
window.move(0,0);
window.resize(320, 240);
window.show();
WId xwinid = window.winId();
gst_x_overlay_set_window_handle (GST_X_OVERLAY (sink), xwinid);
// run the pipeline
GstStateChangeReturn sret = gst_element_set_state (pipeline,
GST_STATE_PLAYING);
if (sret == GST_STATE_CHANGE_FAILURE) {
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
// Exit application
QTimer::singleShot(0, QApplication::activeWindow(), SLOT(quit()));
}
int ret = app.exec();
window.hide();
gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline);
return ret;
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/multiple-streams-in-QWidget-tp4665021.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list