You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, March 9th 2009, 9:35am

How to Show GStreamer video inside Qt Widget

Hi
I'm trying to write a photo program on Nokia N800. There is one example of how to use
N800 camera with GTK at http://maemo.org/development/documentation/manuals/4-0-x/how_to_use_camera_api/.
I try to show the video inside a QWidget object. But when I call

gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(data), winId())

inside QWidget::paintEvent. The program report X window error. It seems that the winId() is not
correct.
If I call

gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(data), window()->winId())

The video will show on the parent window but no widget itself. I have also try the
effectiveWinId() to get win id. It have same problem as winId().
Does any one know how to get the correct x window id for a QtWidget?
Thanks
Yi

2

Monday, March 9th 2009, 1:44pm

Try to force the creation of the widgets "real" windows.
http://doc.trolltech.com/4.5/qcoreapplic…ml#setAttribute
http://doc.trolltech.com/4.5/qt.html#App…nAttribute-enum

Quoted

Qt::AA_NativeWindows 3 Ensures that widgets have native windows.
Fighting fire with fire.
Three can keep a secret if two of them are dead.

3

Wednesday, March 11th 2009, 10:07am

Thanks. it works now :)