Re: [PATCH 00/25] Turn gvnc into a proper GObject



On Sat, Nov 21, 2009 at 01:27:49PM +0000, Daniel P. Berrange wrote:
> This is a huge series which does something that on the surface sounds
> rather simple: turn gvnc into a GObject
> 
> It is not as simple as it sounds though. The gvnc code has grown
> rather too complex and is doing far too much. There is also a wierd
> split of responsibilities between VncDisplay and gvnc for running
> the coroutine. This means that some of the gvnc APIs must only be
> called from the VNC coroutine context, and others must only be called
> from the main process context. This is going to make it very hard, if
> not impossible to use gvnc from non-C languages like Python/Perl/etc.
> 
> Part of the refactoring is to thus move all the coroutine code inside
> the gvnc object (or rather the VncConnection object as it is now to
> be called). No user of the APIs need ever see the coroutines now.
> 
> The second huge part of the refactoring is removing all the function
> callbacks in the gvnc_operations struct, and replacing them with
> proper GObject signals.
> 
> The third huge part of the refactoring is to remove all the framebuffer
> rendering operation code from gvnc, and put it into a new gobject
> called VncFramebuffer (or rather a subclass of it). This will give
> users of the API more flexibility in how they process framebuffer data
> updates.
> 
> In the end we end up with two sets of classes. The first set is stuff
> which only uses GLib, GObject or Gdk-Pixbuf (needed for JPEG rendering
> in TightVNC)
> 
>   VncPixelFormat - describes the data format for a single pixel, both
>                    for the local framebuffer format, and the remote
>                    framebuffer format
> 
>   VncFramebuffer - an interface definition for how framebuffer objects
>                    will provide rendering functions to VncConnection.
>                    A framebuffer consists of a memory region, and two
>                    pixel formats (local & remote), and provides APIs
>                    to render from remote format to a local format
> 
>   VncBaseFramebuffer - a simple implementation of the VncFramebuffer
>                        interface that uses our existing rendering
>                        functions from blt.h
> 
>   VncCursor - describes the image and hotspot for a client side
>               rendered mouse cursor
> 
>   VncConnection - a GObject that implements the basic VNC protocol.
>                   This contains all the coroutine code, and the
>                   protocol handling code. It does not contain any
>                   rendering code anymore, since that's moved to
>                   the framebuffer classes
> 
> The second set of classes is stuff which actually depends on GTK
> 
>   VncImageFramebuffer - a subclass of VncBaseFramebuffer which stores
>                         the framebuffer in a GdkImage object
> 
>   VncDisplay - the original VncDisplay class, but with all the
>                coroutine stuff removed, since its now all hidden
>                inside the VncConnection object

I have pushed all the patches implementing this new API scheme.


> There is still more work to be done relating to this
> 
>  - Generate GObject Introspection data for all classes. This will allow
>    all our APIs to be accessed from non-C languages (Perl, Python, etc)
>    without us needing to write any more code. The old python binding can
>    stay around for compatability, but for the future everything can be
>    introspection based

I have also pushed code which enables GObject introspection when building
with a new enough GTK/GObject library (Fedora >= 12 is sufficient). There
is a demo program examples/gvncviewer.js showing how to use GTK-VNC from
JavaScript using Gjs (the javascript runtime used by gnome-shell) !

>  - Implement the audio-over-VNC protocol extension, and provide classes
>    to handle this. We will need to add VncSampleFormat to describe the
>    audio format, and a VncAudioBuffer interface to receive the data
>    This will be incredibly useful for QEMU which implements this extension
>    since we can then receive audio from the virtual sound card.
> 
>  - Integrate with GStreamer to provide audio and video sources. This
>    will let us do nice things like direct the Vnc audio stream to a
>    PulseAudio daemon on the client, or record a Vnc session into a
>    OGG/MPEG/etc video, or even broadcast a live video stream to many
>    clients without needing them to all use the unicast VNC connections

These two items are still outstanding. I have code which does both of
them, but I've still not been able to make it play without stuttering /
breaking up audio. Once I've debugged it, I'll post it for review.


>  - Split the library into 2 pieces. Or rather three.
> 
>      libgvnc.so   - the basic protocol handling, only needs to link
>                     to libglib.so, libgobject.so and libgdk-pixbuf.so
> 
>      libgtk-vnc.so - the GTK widget integration, additionally linking
>                      to libgtk.of and libgvnc.so
> 
>      libgstreamer-vnc.so - the GStreamer source integration

I've pushed the change which introduces a 'libgvnc.so' library too,
as well as moving it into a separate RPM (gvnc, gvnc-devel).

Hopefully this hasn't broken anything major - things like vinagre and
virt-viewer still work in my testing & I didn't change any public API
in vncdisplay.h.

NB: all header files 'src/vnc*.h' are now public API, so care must be
taken when changing them to avoid breaking ABI.

Before we do a new release, we need to add padding to all the GObject
public structs to allow us to add further members in the future without
ABI breakage problems.

Regards,
Daniel
-- 
|: http://berrange.com/     -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://freshmeat.net/~danielpb/    -o-   http://gtk-vnc.sourceforge.net :|

Attachment: signature.asc
Description: Digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]