s/ffmpegcolorspace/videoconvert/ in a few places
[platform/upstream/gstreamer.git] / manual-motivation.md
1 ---
2 title: Design principles
3 ...
4
5 # Design principles
6
7 ## Clean and powerful
8
9 GStreamer provides a clean interface to:
10
11   - The application programmer who wants to build a media pipeline. The
12     programmer can use an extensive set of powerful tools to create
13     media pipelines without writing a single line of code. Performing
14     complex media manipulations becomes very easy.
15
16   - The plugin programmer. Plugin programmers are provided a clean and
17     simple API to create self-contained plugins. An extensive debugging
18     and tracing mechanism has been integrated. GStreamer also comes with
19     an extensive set of real-life plugins that serve as examples too.
20
21 ## Object oriented
22
23 GStreamer adheres to GObject, the GLib 2.0 object model. A programmer
24 familiar with GLib 2.0 or GTK+ will be comfortable with GStreamer.
25
26 GStreamer uses the mechanism of signals and object properties.
27
28 All objects can be queried at runtime for their various properties and
29 capabilities.
30
31 GStreamer intends to be similar in programming methodology to GTK+. This
32 applies to the object model, ownership of objects, reference counting,
33 etc.
34
35 ## Extensible
36
37 All GStreamer Objects can be extended using the GObject inheritance
38 methods.
39
40 All plugins are loaded dynamically and can be extended and upgraded
41 independently.
42
43 ## Allow binary-only plugins
44
45 Plugins are shared libraries that are loaded at runtime. Since all the
46 properties of the plugin can be set using the GObject properties, there
47 is no need (and in fact no way) to have any header files installed for
48 the plugins.
49
50 Special care has been taken to make plugins completely self-contained.
51 All relevant aspects of plugins can be queried at run-time.
52
53 ## High performance
54
55 High performance is obtained by:
56
57   - using GLib's `GSlice` allocator
58
59   - extremely light-weight links between plugins. Data can travel the
60     pipeline with minimal overhead. Data passing between plugins only
61     involves a pointer dereference in a typical pipeline.
62
63   - providing a mechanism to directly work on the target memory. A
64     plugin can for example directly write to the X server's shared
65     memory space. Buffers can also point to arbitrary memory, such as a
66     sound card's internal hardware buffer.
67
68   - refcounting and copy on write minimize usage of memcpy. Sub-buffers
69     efficiently split buffers into manageable pieces.
70
71   - dedicated streaming threads, with scheduling handled by the kernel.
72
73   - allowing hardware acceleration by using specialized plugins.
74
75   - using a plugin registry with the specifications of the plugins so
76     that the plugin loading can be delayed until the plugin is actually
77     used.
78
79 ## Clean core/plugins separation
80
81 The core of GStreamer is essentially media-agnostic. It only knows about
82 bytes and blocks, and only contains basic elements. The core of
83 GStreamer is functional enough to even implement low-level system tools,
84 like cp.
85
86 All of the media handling functionality is provided by plugins external
87 to the core. These tell the core how to handle specific types of media.
88
89 ## Provide a framework for codec experimentation
90
91 GStreamer also wants to be an easy framework where codec developers can
92 experiment with different algorithms, speeding up the development of
93 open and free multimedia codecs like those developed by the [Xiph.Org
94 Foundation](http://www.xiph.org) (such as Theora and Vorbis).
95