This page describes the status of the implementation in the GPAC project of the Scalable Vector Graphics (SVG) language.
The GPAC project is divided into a command-line authoring tool (MP4Box) and a set of players for various platforms (e.g. Osmo4, mp4client, Osmophone, wxOsmo, osmozilla). Development started around MPEG-4 technologies (like BIFS), and is continuing around W3C technologies. However, the goal of the project is neither to provide yet another browser, nor to provide yet a media player, but to focus on integration of description languages with audio/video resources. The GPAC players should be seen as something in between browsers and audio/video players with support for languages like BIFS, SVG, X3D …
The implementation of SVG in GPAC targets SVG Tiny 1.2, with audio/video support but not SVG Full 1.1, with Filters, Full CSS … A snapshot of the support of SVG Tiny 1.2 is GPAC and other SVG implementations has been published by the W3C. You can check it here.
The full GPAC player can be downloaded (download). Obviously, the current implementation has some limitations, which we would like to remove and bugs we would like to fix. So if we have bug reports, don’t hesitate to send them.
The implementation spreads over 3 modules:
- SVG Parsing: this is performed by a native, limited but functional, SAX XML parser. In the past we had a LibXML SAX parser but, it had so many features that was very big and heavy to handle. In particular, our parser can load, progressively or not, an SVG document into memory. You can have a look at this code: the parser (.c, .h) and the wrapper around this parser to make it a Scene Decoder module that the player can use.
- SVG Tree Managment: this part of the SVG support follows some principles derived from the MPEG-4 BIFS tree managment, and is called in general Scene Graph Managment. It is responsible for the creation of elements, the handling of attributes (parsing, dump, cloning …). It also handles the animations and scripting features of SVG. The source code of the declaration of the supported SVG elements and attributes is here, the basic element types and associated functions are declared here, the SVG data types are declared here. The actual implementation is here.
- SVG Compositing: this is the process which consists in transforming the scene graph into structures used by a rasterizer, that is applying animations, interactivity, CSS. The GPAC project has two rasterizers: GDI Plus on Windows platforms, and the GPAC 2D Rasterizer, based on FreeType, on other platforms. The compositing code is here.
If you’re interested in the details of the algorithms behind the implementation, you can have a look at this paper:
Concolato C., Le Feuvre J. et Moissinac J. C., (2008), Design of an Efficient Scalable Vector Graphics Player for Constrained Devices, IEEE Transactions on Consumer Electronics, vol. 54, n° 2, pp. 895?903.