<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >Another approach to autoplugging</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="Autoplugging" HREF="chapter-autoplug.html"><LINK REL="PREVIOUS" TITLE="Using the GstAutoplugCache element" HREF="section-autoplug-cache.html"><LINK REL="NEXT" TITLE="Your second application" HREF="chapter-hello2.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-autoplug-cache.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 28. Autoplugging</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="chapter-hello2.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="section-autoplugging-spider" >28.3. Another approach to autoplugging</A ></H1 ><P > The autoplug API is interesting, but often impractical. It is static; it cannot deal with dynamic pipelines. An element that will automatically figure out and decode the type is more useful. Enter the spider. </P ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="AEN979" >28.3.1. The spider element</A ></H2 ><P > The spider element is a generalized autoplugging element. At this point (April 2002), it's the best we've got; it can be inserted anywhere within a pipeline to perform caps conversion, if possible. Consider the following gst-launch line: <PRE CLASS="programlisting" > $ gst-launch filesrc location=my.mp3 ! spider ! osssink </PRE > The spider will detect the type of the stream, autoplug it to the osssink's caps, and play the pipeline. It's neat. </P ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="AEN983" >28.3.2. Spider features</A ></H2 ><P > <P ></P ><OL TYPE="1" ><LI ><P > Automatically typefinds the incoming stream. </P ></LI ><LI ><P > Has request pads on the source side. This means that it can autoplug one source stream into many sink streams. For example, an MPEG1 system stream can have audio as well as video; that pipeline would be represented in gst-launch syntax as <PRE CLASS="programlisting" > $ gst-launch filesrc location=my.mpeg1 ! spider ! { queue ! osssink } spider.src_%d! { queue ! xvideosink } </PRE > </P ></LI ></OL > </P ></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="section-autoplug-cache.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-hello2.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Using the <CODE CLASS="classname" >GstAutoplugCache</CODE > element</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="chapter-autoplug.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Your second application</TD ></TR ></TABLE ></DIV ></BODY ></HTML >