[MeeGo-touch-dev] Using Native Qt widget and Qcamera in Meegotouch application
ab at samba.org
Wed Sep 8 12:15:41 PDT 2010
On Wed, Sep 8, 2010 at 18:32, <Iqbal.Mohammad at tieto.com> wrote:
> Another Query:
> I am trying to use QCamera in meegotouch application by binding it with
> MVideoWidget . camera->start() call triggers camera to open in different
> window and rest of the application in different window. I suspect that
> camera binding is not happening with MVideoWidget. So can anybody share
> experiences of using camera with meegotouch?
What you are probably doing is instantiating GStreamer pipeline with
xvimagesink as a resulting destination for the video frames.
xvimagesink expects existing X drawable resource corresponding to the
window which geometry is then used to configure Xv port for video
output. If no xid is passed, xvimagesink creates new window itself.
The way Qt and Meegotouch on top of it are done, there is single X
window for whole application, not separate ones for every widget. In
order to set up this properly with xvimagesink, you need:
- pass xid of the main application window to the xvimagesink (it is a
winId() of the graphics view being used to display the scene);
- use gst_x_overlay_set_render_rectangle() to communicate position of
the MVideoWidget within the application window to xvimagesink();
- react on the changes in the geometry and winId(). Qt sometimes
destroys the drawable backing the windows, in particular, this happens
when window is minimized/maximized
- don't forget to set and paint colorkey on an architectures where
this is required (for example, N900) or there will be no video visible
through the widget.
Welcome to a client-side rendering age.
/ Alexander Bokovoy
More information about the MeeGo-touch-dev