qt gstreamer video

econ_gst narayanan.krish at e-consystems.com
Wed Nov 12 08:57:20 PST 2014


Hello all,

We are new to gstreamer. We are trying to play a video on Qt Widget using
gstreamer as backend. We are able to play the video over Qt using gstreamer
in X86 Ubuntu 12.04. The host and the target uses same gstreamer versions.
But when we cross compile and try to play it on our target board (ARM), we
are getting following error:

(resize:227): GStreamer-CRITICAL **: gst_implements_interface_cast:
assertion 'gst_element_implements_interface (GST_ELEMENT (from), iface_typd

** (resize:227): CRITICAL **: gst_x_overlay_set_window_handle: assertion
'overlay != NULL' failed.

We are getting a full screen video which is more than the size what we set
for our Qt widget. We assume the gstreamer is displaying the video in its
own screen. 

Following is the code we tried: 

@
#include <glib.h>
#include <gst/gst.h>
#include <gst/interfaces/xoverlay.h>

#include <QApplication>
#include <QTimer>
#include <QWidget>

int main(int argc, char *argv[])
{
  if (!g_thread_supported ())
    g_thread_init (NULL);

  gst_init (&argc, &argv);
  QApplication app(argc, argv);
  app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ()));

  // prepare the pipeline

  GstElement *pipeline = gst_pipeline_new ("xvoverlay");
  GstElement *src = gst_element_factory_make ("videotestsrc", NULL);
  //GstElement *sink = gst_element_factory_make ("xvimagesink", NULL);
  GstElement *sink = gst_element_factory_make ("mfw_v4lsink", NULL);
  gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
  gst_element_link (src, sink);

  // prepare the ui

  QWidget window, window1;
  window1.setParent(&window);
  window.resize(800, 800);
  window1.setGeometry(0,0,200,200);
  window.show();

  WId xwinid = window1.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;
}

@

Any help will be greatly helpful.

Thanks,
Nara 




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/qt-gstreamer-video-tp4669483.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list