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



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


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

 - 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

 - 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

Daniel



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