FreeJ is a commandline application on GNU/Linux and a graphical application on Apple/OSX - and besides that, it provides a C++ library with API for multimedia frameworks. FreeJ code relies on portable POSIX code and different native functions present on various operating systems, triggered at compile time (for instance uses FFMpeg on GNU/Linux and Quicktime components on Apple/OSX).
Using the libfreej library all these internal implementations are operable using the same calls on all different functions: this documentation is intended to give an introduction and overview on its API.
The FreeJ engine is organized in a tree structure seen as:
ViewPort---(Blit)______________Layer_____Filter \ vvvv \____Filter \-(Blit)____Layer__Filter \___Filter \ vvvv \__Filter ... (Blit)__Layer \_Filter \Filter ...
Each Layer holds a list of instantiated Filter objects.
A Filter is a plugin loaded and served by the Plugger.
A Blit is the operation used to sum Layers into the ViewPort
At last, there can be as many ViewPorts as you want (each with its own output implementation at screen or via special devices) and their list is kept by the global Context.
If you are implementing a new Layer (or you simply want to use an existing Layer even outside the FreeJ Context, still using its library) you need to take into account just a few methods common to all Layer implementations:
bool open(char *file) called to open MyLayer's source returns false if is not accessible bool init(Context *scr) if the open was succesful, call this and the Layer will enter the chain bool feed() this function is executed by the Context when it needs to grab more data in the Layer bool close() you need to call this when you want to close the Layer, in case you initialized it
If you are implementing a new Layer, you don't need to care about threading or synchronizing the execution: just be sure to correctly free all the buffers you allocate ;^)
This documentation needs to be completed but it's already useful as various coders found their way through the headers for the missing bits. We are actively documenting the code! feel free to contact our mailinglist if you want to speed up the process and point out parts you need to have documented ASAP.