<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >Plugins</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="GStreamer Application Development Manual" HREF="index.html"><LINK REL="UP" TITLE="Basic API" HREF="part-basic-api.html"><LINK REL="PREVIOUS" TITLE="Capabilities of a pad" HREF="section-api-caps.html"><LINK REL="NEXT" TITLE="Linking elements" HREF="chapter-links-api.html"></HEAD ><BODY CLASS="chapter" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" ><SPAN CLASS="application" >GStreamer</SPAN > Application Development Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="section-api-caps.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="chapter-links-api.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="chapter" ><H1 ><A NAME="chapter-plugins-api" ></A >Chapter 14. Plugins</H1 ><P > All plugins should implement one function, <CODE CLASS="function" >plugin_init</CODE >, that creates all the element factories and registers all the type definitions contained in the plugin. Without this function, a plugin cannot be registered. </P ><P > The plugins are maintained in the plugin system. Optionally, the type definitions and the element factories can be saved into an XML representation so that the plugin system does not have to load all available plugins in order to know their definition. </P ><P > The basic plugin structure has the following fields: </P ><PRE CLASS="programlisting" > typedef struct _GstPlugin GstPlugin; struct _GstPlugin { gchar *name; /* name of the plugin */ gchar *longname; /* long name of plugin */ gchar *filename; /* filename it came from */ GList *types; /* list of types provided */ gint numtypes; GList *elements; /* list of elements provided */ gint numelements; GList *autopluggers; /* list of autopluggers provided */ gint numautopluggers; gboolean loaded; /* if the plugin is in memory */ }; </PRE ><P > You can query a <CODE CLASS="classname" >GList</CODE > of available plugins with the function <CODE CLASS="function" >gst_plugin_get_list</CODE > as this example shows: </P ><PRE CLASS="programlisting" > GList *plugins; plugins = gst_plugin_get_list (); while (plugins) { GstPlugin *plugin = (GstPlugin *)plugins->data; g_print ("plugin: %s\n", gst_plugin_get_name (plugin)); plugins = g_list_next (plugins); } </PRE ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="section-api-caps.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="chapter-links-api.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Capabilities of a pad</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="part-basic-api.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Linking elements</TD ></TR ></TABLE ></DIV ></BODY ></HTML >