Gstreamer application using Qt

pushpa pushpalatha.sg at mistralsolutions.com
Fri Sep 7 00:00:06 PDT 2012


I tried to execute gstreamer pipeline using Qt and display gstreamer window
on Qtwidget. This worked fine on host pc, however did not succeed on my
target platform(omap35x). 

On target platform, gstreamer window is not showed on Qtwidget, video is
displayed on separate window with following messages

(gst:1743): GStreamer-CRITICAL **: gst_implements_interface_cast: assertion
`gst_element_implements_interface (GST_ELEMENT 
(from), iface_type)' failed

** (gst:1743): CRITICAL **: gst_x_overlay_set_xwindow_id: assertion `overlay
!= NULL' failed


Here is the code which i am using

int main(int argc, char *argv[])
{
    gst_init (&argc, &argv);
    QApplication app(argc, argv);
      app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ()));
    GstElement *pipeline = gst_pipeline_new ("xvoverlay");
    GstElement *src = gst_element_factory_make ("videotestsrc", NULL);
    GstElement *sink = gst_element_factory_make ("autovideosink", NULL);

    gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
      gst_element_link (src, sink);


      QWidget window;
        window.resize(320, 240);
        window.setWindowTitle("Video");
        window.show();

        gst_element_set_state (sink, GST_STATE_READY);

        WId xwinid = window.winId();
        QApplication::syncX();

       gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (sink), xwinid);
          
        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);

           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/Gstreamer-application-using-Qt-tp4656142p4656195.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list