[Qt-interest] GStreamer xvimagesink with QGraphicsWidget

dmytro.poplavskiy at nokia.com dmytro.poplavskiy at nokia.com
Thu Apr 8 08:34:20 CEST 2010


On 02/04/2010, at 10:50 AM, ext Zhao, Halley wrote:

On Linux/X based platform, GStreamer xvimagesink works well with QWidget since QWidget’s winId() could connect to xvimagesink

xvimagesink (or xvideo at all) is not suitable to be used with QGraphicsView
(well, it's possible in some cases to use xvideo with color key filled video item and geometry passed to xvideo,
but it's not very good idea:  not all the xvideo adapters support color key drawing, all the gfx transformation will not be available,
and it will not be possible to have semi-trasparent items on top of video. Finally xvimagesink doesn't allow
to specify geometry and you will have to implement another xvideo based element.)

The proper solution will be writing your own gstreamer video sink to receive frames data and render then on the graphics view.
It will be quite slow (colorspace transformation and scaling are not accelerated), but much faster than with QGraphicsProxyWidget.
The raster graphics system is also expected to be faster than X11 on linux in this case.

The best solution is to use OpenGL widget as QGraphicsView viewport and use shaders for YUV->RGB colorspace transformation.
Except of opengl dependency, I can't see any drawbacks here, colorspace and scaling will be hardware accelerated,
with all the effect and transformations supported.

You can check the qt mobility or qt 4.7 repos for example implementation (QGraphicsVideoItem and gstreamer mobility backend).

In order to get rich user experience, I try to use QGraphics*.
QGraphicsWidget doesn’t associate with xid, I tried to add QWidget to QGraphicsProxyWidget. Then it could be used in QGraphicsScene.
There is no video at all, though audio playback well at the same time, and log from xvimagesink also looks well since _put_frame() is called timely.

Do you think it is a right approach?
Where should I look into to find some potential issue? QGraphicsWidget?
ZHAO, Halley (Aihua)
Email: halley.zhao at intel.com<BLOCKED::mailto:aihua.zhao at intel.com>
Tel: +86(21)61166476
iNet: 8821-6476
SSG/OTC/Moblin 3W038 Pole: F4


Regards
  Dmytro.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100408/a825f98f/attachment.html 


More information about the Qt-interest-old mailing list