<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >More on MIME Types</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="More on factories" HREF="chapter-factories.html"><LINK REL="NEXT" TITLE="GStreamer types" HREF="section-factories-gstreamer-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="chapter-factories.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-gstreamer-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-mime" >20.2. More on MIME Types</A ></H1 ><P > GStreamer uses MIME types to identify the different types of data that can be handled by the elements. They are the high level mechanisms to make sure that everyone is talking about the right kind of data. </P ><P > A MIME (Multipurpose Internet Mail Extension) type is a pair of strings that denote a certain type of data. Examples include: <P ></P ><UL ><LI ><P > audio/raw : raw audio samples </P ></LI ><LI ><P > audio/mpeg : MPEG audio </P ></LI ><LI ><P > video/mpeg : MPEG video </P ></LI ></UL > </P ><P > An element must associate a MIME type to its source and sink pads when it is loaded into the system. GStreamer knows about the different elements and what type of data they expect and emit. This allows for very dynamic and extensible element creation as we will see. </P ><P > As we have seen in the previous chapter, MIME types are added to the Capability structure of a pad. </P ><P > <A HREF="section-factories-mime.html#section-mime-img" >Figure 20-1</A > shows the MIME types associated with each pad from the "hello world" example. </P ><DIV CLASS="figure" ><A NAME="section-mime-img" ></A ><P ><B >Figure 20-1. The Hello world pipeline with MIME types</B ></P ><DIV CLASS="mediaobject" ><P ><IMG SRC="images/mime-world.png"></P ></DIV ></DIV ><P > We will see how you can create an element based on the MIME types of its source and sink pads. This way the end-user will have the ability to choose his/her favorite audio/mpeg decoder without you even having to care about it. </P ><P > The typing of the source and sink pads also makes it possible to 'autoplug' a pipeline. We will have the ability to say: "construct a pipeline that does an audio/mpeg to audio/raw conversion". </P ><DIV CLASS="note" ><P ></P ><TABLE CLASS="note" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="../images/note.gif" HSPACE="5" ALT="Note"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P > The basic GStreamer library does not try to solve all of your autoplug problems. It leaves the hard decisions to the application programmer, where they belong. </P ></TD ></TR ></TABLE ></DIV ></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="chapter-factories.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-gstreamer-types.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >More on factories</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 types</TD ></TR ></TABLE ></DIV ></BODY ></HTML >