<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >Types of elements</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="Elements" HREF="chapter-elements.html"><LINK REL="PREVIOUS" TITLE="Elements" HREF="chapter-elements.html"><LINK REL="NEXT" TITLE="Pads" HREF="chapter-pads.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-elements.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Chapter 4. Elements</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="chapter-pads.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="section-elements-types" >4.2. Types of elements</A ></H1 ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="section-elements-src" >4.2.1. Source elements</A ></H2 ><P > Source elements generate data for use by a pipeline, for example reading from disk or from a sound card. </P ><P > <A HREF="section-elements-types.html#section-element-srcimg" >Figure 4-1</A > shows how we will visualise a source element. We always draw a source pad to the right of the element. </P ><DIV CLASS="figure" ><A NAME="section-element-srcimg" ></A ><P ><B >Figure 4-1. Visualisation of a source element</B ></P ><DIV CLASS="mediaobject" ><P ><IMG SRC="images/src-element.png"></P ></DIV ></DIV ><P > Source elements do not accept data, they only generate data. You can see this in the figure because it only has a source pad. A source pad can only generate data. </P ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="section-elements-filter" >4.2.2. Filters and codecs</A ></H2 ><P > Filter elements have both input and output pads. They operate on data they receive in their sink pads and produce data on their source pads. For example, MPEG decoders and volume filters would fall into this category. </P ><P > Elements are not constrained as to the number of pads they might have; for example, a video mixer might have two input pads (the images of the two different video streams) and one output pad. </P ><DIV CLASS="figure" ><A NAME="section-element-filterimg" ></A ><P ><B >Figure 4-2. Visualisation of a filter element</B ></P ><DIV CLASS="mediaobject" ><P ><IMG SRC="images/filter-element.png"></P ></DIV ></DIV ><P > <A HREF="section-elements-types.html#section-element-filterimg" >Figure 4-2</A > shows how we will visualise a filter element. This element has one sink (input) pad and one source (output) pad. Sink pads are drawn on the left of the element. </P ><DIV CLASS="figure" ><A NAME="section-element-multifilterimg" ></A ><P ><B >Figure 4-3. Visualisation of a filter element with more than one output pad</B ></P ><DIV CLASS="mediaobject" ><P ><IMG SRC="images/filter-element-multi.png"></P ></DIV ></DIV ><P > <A HREF="section-elements-types.html#section-element-filterimg" >Figure 4-2</A > shows the visualisation of a filter element with more than one output pad. An example of such a filter is the AVI demultiplexer. This element will parse the input data and extract the audio and video data. Most of these filters dynamically send out a signal when a new pad is created so that the application programmer can link an arbitrary element to the newly created pad. </P ></DIV ><DIV CLASS="sect2" ><H2 CLASS="sect2" ><A NAME="section-elements-sink" >4.2.3. Sink elements</A ></H2 ><P > Sink elements are end points in a media pipeline. They accept data but do not produce anything. Disk writing, soundcard playback, and video output would all be implemented by sink elements. <A HREF="section-elements-types.html#section-element-sinkimg" >Figure 4-4</A > shows a sink element. </P ><DIV CLASS="figure" ><A NAME="section-element-sinkimg" ></A ><P ><B >Figure 4-4. Visualisation of a sink element</B ></P ><DIV CLASS="mediaobject" ><P ><IMG SRC="images/sink-element.png"></P ></DIV ></DIV ></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-elements.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-pads.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Elements</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="chapter-elements.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Pads</TD ></TR ></TABLE ></DIV ></BODY ></HTML >