Question

I am developing a gstreamer based app on AM335x starter kit running arago linux. "gst-launch"(with a test pipeline) gives proper command line output (serial) but shows nothing on the screen. BTW the screen by default shows a qt demo app. Killing this demo app makes the gst-launch fail.

I compiled a "hello world" gtk app, which gives "Gtk-WARNING **: cannot open display:" error. BTW there is no X here.

But when I ran a Qt "hello world" app, a pop up window was displayed on top of the demo app.

Can someone please explain why. Any suggestions to solve this are welcome.

UPDATE1: Correct me if I am wrong. I was thinking maybe using qt-gstreamer API might be the easiest way.

UPDATE2: I am able to make this work using the "fbdevsink" gstreamer plugin. Thanks to all for the pointers.

No correct solution

OTHER TIPS

This sounds very weird.

GTK+ relies on GDK for its drawing and input needs, and GDK uses different backends for different platforms and environments.

The X11 backend is one, but there are others.

You simply must make sure you build GDK with a suitable backend for your environment.

GTK+ requires a working windowing system — i.e. X11, Windows, MacOS X, or Wayland — in order to display content and handle events.

Older versions of GTK+ allowed using the Linux frame buffer device, or DirectFB, as the windowing system, but both backends have been deprecated and are either removed in newer versions of the GTK+ library, or unmaintained and likely broken.

I'm not experienced with GTK, but my understanding is, that GTK itself is very much a graphics toolkit. It is the very part, which requires a graphics backend to work. There are other stuff which does not require that, and they are put in GLib.

Qt is much more general purpose toolkit, it has a lot of features built in, for which you'd use some other library if you had a GTK GUI. With Qt you can build application which does not require graphics backend, but you have to create the application object instance from QCoreApplication class. If you have a Qt application which uses QApplication, and you try to run it without having graphics backend, you get error too.

Reason is practicality and keeping things simple, and perhaps also just having a suboptimal design, which makes separting some things from graphics backend difficult. A lot of things really depend on having the graphics backend, and adding special cases for situations where there isn't one can be seen as extra complexity (==work and bugs) for little benefit.


As to 2nd part of your question, I don't know a workaround for GTK, other than, don't use it if you don't actually mean to draw anything. But I think generally, you would need to provide a "dummy" graphics backend, which can satisfy the requirements without actually having a screen.

There are at least the following ways to achive a non-X supplied gtk capplication:

  • GTK Framebuffer (gtkfb)

You can find further information about it: http://www.gtk.org/api/2.6/gtk/gtk-framebuffer.html

  • Do not use graphics functionality at all

This is a bit more drastic, so you would need to stick to things like glib, et cetera.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top