title: Load Statically Linked GStreamer Plugin
body: <p>I'm working on software for an embedded system that uses GStreamer 0.10.36.  My goal is to keep the software as small as possible in terms of Flash memory space, so I'd like to statically linking the GStreamer plugins I need.  According to the Core Reference Manual:</p>
  
  <blockquote>
    <p>"There are options to statically link plugins to an app or even use
    GStreamer without a plugin repository in which case gst_plugin_load()
    can be needed to bring the plugin into memory. "</p>
  </blockquote>
  
  <p>Unfortunately, it's not clear to me exactly what I need to do to bring the plugin into memory such that a subsequent call to <code>gst_element_factory_make()</code> completes successfully.</p>
  
  <p>I'm doing the following:</p>
  
  <ul>
  <li>Building GStreamer with <code>--enable-static</code> and <code>--disable-registry</code> set.</li>
  <li>Linking the static library into my application</li>
  <li>Call <code>gst_element_factory_make()</code> to create an element</li>
  </ul>
  
  <p>Right now I'm only doing this for one plugin (tcpclientsink) out of several as an experiment.  I had to edit the Makefile for that plugin to remove a <code>--disable-static</code> statement to get the libgsttcp.a file to build.  I assume the library is good, but I'm not sure if there is a good way to verify that.  <code>gst-inspect</code> does not appear to work on static libraries.</p>
  
  <p>Note: If I call <code>load_gst_plugin(/path/to/libgsttcp.a)</code>, GStreamer fails to load the plugin because of an invalid ELF header.</p>
  
  <p>How does one load a statically linked GStreamer library?</p>