The libraries

General Introduction to the Libraries

Because this project does not have high goals like business ones and doesn't need to bridge any gap to fulfill particular human beings needs, it is written using an usual and very pratical set of libraries. Though sometimes it leads to unwanted lacks of resources allocation compared to more specific and low-level ways to program, the choice made over the libraries issue allowed to satisfy thoroughly programming needs.
Particulary, G-libs cover a spread spectrum of fields going from networking to user interface creations and passing through multimedia applications: in other words, everything needed for the development of an audio conference program. Thus, G-libs take part of a more general programming style and because of that hardly show compatibility problems when used together.
Moreover, Linux community offers a lot of open source professional programs which use this kind of libraries making them the right choice to a first approach on skilled programming.

 


 

In general, the whole g-programming-like libraries are based on pseudo-object structures and event-driven signals even if C, the language actually used, isn't an object oriented one. What they do is to define objects and methods using usual C structures and function pointers filling some holes of C language. The result is a versatile programming style which takes pros from object oriented languages and in the same time keeps the advantages of a C framework.
Going deeply inside this choice, it can be stated that there are three main developing areas in order to implement an audio conference system.
First of all the multimedia area, which concern everyhing from sending audio streams over the network to the handle and the manipulate of them, is covered entirely by gstreamer libs.
Secondly, the building of an apprpriate user interface is left to gtk libraries which are used in a lot of gnome based programs.
Lastly, the need to realize a network exchange of string and thus infromation apart from streaming ones, is carried out using gnet libraries.


GTK Libs - Graphical Interface

Gtk libs are used to build graphical interfaces. Over the internet there are a lot of examples involving them and it's quite easy to reach immediatly great results. However, pure code gtk programming wear out a lot of code lines because of the need to set up every single parameter of each object used. In any case, it is possible drastically reduce this wast of space by moving the definition of the layout in an external file which is loaded into the program during initialization.
The essential block of gtk libraries are GtkWidgets which include every kind of visible and invisible object forming the UI. Even if any object has his own peculiar structure belonging to it, each one can refear and than be casted to a GtkWidget.
After having loaded the complete layout from an external file, every Gtk element that need to be used during the session have to be assigned to preallocated memory. Than initialization can be performed.
Since external file does not allow to set all the feature of the objects somentimes it is necessary to execute this task via line code.
As can be easly understand, the creation of the external files represent a huge section of the final work. This is performed using a program called Glade and the resulting file has a .glade extension. Glade is a graphical program and let the programmer build his interface simply drawing it. Each object can be easly picked from the list and dragged into the project. By selecting them, it allows to modify wide range of parameters form the assigning of the name of the callback coupled with event signal to the defining of behavioural and structural properties.


GStreamer Libs - Multimedia Application

Gstreamer libraries represent the real core of Client and Server programs. They put in execution all the mechanics related to multimedial areas such as the manipulating of audio streams and the real time networking transmissions. The basic concepts of gstreamer libs are pipelines and their fondamental blocks: elements or plugins. Though this organization could seem too unusual, it actually permits a quick development of the most common multimedia application because of its block-based structure. Indeed, to maintain simple an high view structure, obviously all the effort is moved to elements and their construction. To build a robust element is really an hard work but gstreamer's community continously refresh the list of aviable plugins in order to cover the maximum possible range of needs.
Generally, elements can bee seen as single blocks performing a particular task on incoming streams. Elements are logically connected to create a pipeline so that to carry out more complex targets.
Depending on necessity, some plugins features can also be set or modified via particular functions: as an example, the amplification property of a volume block can be lowed or rised according with needs. As said above, pipelines and elements manage mainly multimedial streams like audio and video. Streams flowing through the pipeline can be represented as buffers containing audio samples or video frames passing from an element to the following all along the chain. This kind of flowing buffers over a pipeline can obviously have different capabilities according to audio or video formats used and elements taking part of the chain are requested to handle them.
Due to its multimedial prominent usage, gstreamer are bounded to comply with severe timing constrains to prevent the occurring of huge delays. In order to spread computational weight and reduce delays, gstreamer core creates several separate threads which synchronize themselves automatically. There are also specific elements that can force the creation of extra threads and that are requested every time there is a partition of the pipeline in two or more branches.


GNet Libs - Network Communication

Gstreamer libraries allow to start network trasmissions only within stream flows. The sending of strings and messages is performed by gnet libraries which provides, beside other things, the possibility to create sockets, channels and more importantly to add watching functions to channels in order to monitor constantly the incoming messages.