1 <chapter id="chapter-compiling">
2 <title>Compiling</title>
4 This section talks about the different things you can do when building
5 and shipping your applications and plugins.
8 <sect1 id="section-compiling-embedding">
9 <title>Embedding static elements in your application</title>
11 The <ulink type="http"
12 url="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/index.html">Plugin
13 Writer's Guide</ulink> describes in great detail how to write elements
14 for the &GStreamer; framework. In this section, we will solely discuss
15 how to embed such elements statically in your application. This can be
16 useful for application-specific elements that have no use elsewhere in
20 Dynamically loaded plugins contain a structure that's defined using
21 <function>GST_PLUGIN_DEFINE ()</function>. This structure is loaded
22 when the plugin is loaded by the &GStreamer; core. The structure
23 contains an initialization function (usually called
24 <function>plugin_init</function>) that will be called right after that.
25 It's purpose is to register the elements provided by the plugin with
26 the &GStreamer; framework.
27 If you want to embed elements directly in
28 your application, the only thing you need to do is to replace
29 <function>GST_PLUGIN_DEFINE ()</function> with a call to
30 <function>gst_plugin_register_static ()</function>. As soon as you
31 call <function>gst_plugin_register_static ()</function>, the elements
32 will from then on be available like any other element, without them
33 having to be dynamically loadable libraries. In the example below, you
34 would be able to call <function>gst_element_factory_make
35 ("my-element-name", "some-name")</function> to create an instance of the
42 * Here, you would write the actual plugin code.
48 register_elements (GstPlugin *plugin)
50 return gst_element_register (plugin, "my-element-name",
51 GST_RANK_NONE, MY_PLUGIN_TYPE);
59 gst_plugin_register_static (
63 "Private elements of my application",
67 "my-application-source",
69 "http://www.my-application.net/")