<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >Creating elements with the factory</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="More on factories" HREF="chapter-factories.html"><LINK REL="PREVIOUS" TITLE="GStreamer types" HREF="section-factories-gstreamer-types.html"><LINK REL="NEXT" TITLE="GStreamer basic types" HREF="section-factories-basic-types.html"></HEAD ><BODY CLASS="sect1" 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-factories-gstreamer-types.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 20. More on factories</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="section-factories-basic-types.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="section-factories-create" >20.4. Creating elements with the factory</A ></H1 ><P > In the previous section we described how you could obtain an element factory using MIME types. One the factory has been obtained, you can create an element using: </P ><PRE CLASS="programlisting" > GstElementFactory *factory; GstElement *element; // obtain the factory factory = ... element = gst_element_factory_create (factory, "name"); </PRE ><P > This way, you do not have to create elements by name which allows the end-user to select the elements he/she prefers for the given MIME types. </P ></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-factories-gstreamer-types.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="section-factories-basic-types.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >GStreamer types</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="chapter-factories.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >GStreamer basic types</TD ></TR ></TABLE ></DIV ></BODY ></HTML >