<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML ><HEAD ><TITLE >Basic Concepts</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="GStreamer Plugin Writer's Guide" HREF="index.html"><LINK REL="UP" TITLE="Introduction" HREF="part-introduction.html"><LINK REL="PREVIOUS" TITLE="Structure of This Guide" HREF="section-preface-structure.html"><LINK REL="NEXT" TITLE="Pads" HREF="section-basics-pads.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 > Plugin Writer's Guide</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="section-preface-structure.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="section-basics-pads.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="chapter" ><H1 ><A NAME="chapter-intro-basics" ></A >Chapter 2. Basic Concepts</H1 ><P > This chapter of the guide introduces the basic concepts of <SPAN CLASS="application" >GStreamer</SPAN >. Understanding these concepts will help you grok the issues involved in extending <SPAN CLASS="application" >GStreamer</SPAN >. Many of these concepts are explained in greater detail in the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >GStreamer Application Development Manual</I ></SPAN >; the basic concepts presented here serve mainly to refresh your memory. </P ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="section-basics-elements" >2.1. Elements and Plugins</A ></H1 ><P > Elements are at the core of <SPAN CLASS="application" >GStreamer</SPAN >. In the context of plugin development, an <SPAN CLASS="emphasis" ><I CLASS="emphasis" >element</I ></SPAN > is an object derived from the <CODE CLASS="classname" >GstElement</CODE > class. Elements provide some sort of functionality when linked with other elements: For example, a source element provides data to a stream, and a filter element acts on the data in a stream. Without elements, <SPAN CLASS="application" >GStreamer</SPAN > is just a bunch of conceptual pipe fittings with nothing to link. A large number of elements ship with <SPAN CLASS="application" >GStreamer</SPAN >, but extra elements can also be written. </P ><P > Just writing a new element is not entirely enough, however: You will need to encapsulate your element in a <SPAN CLASS="emphasis" ><I CLASS="emphasis" >plugin</I ></SPAN > to enable <SPAN CLASS="application" >GStreamer</SPAN > to use it. A plugin is essentially a loadable block of code, usually called a shared object file or a dynamically linked library. A single plugin may contain the implementation of several elements, or just a single one. For simplicity, this guide concentrates primarily on plugins containing one element. </P ><P > A <SPAN CLASS="emphasis" ><I CLASS="emphasis" >filter</I ></SPAN > is an important type of element that processes a stream of data. Producers and consumers of data are called <SPAN CLASS="emphasis" ><I CLASS="emphasis" >source</I ></SPAN > and <SPAN CLASS="emphasis" ><I CLASS="emphasis" >sink</I ></SPAN > elements, respectively. <SPAN CLASS="emphasis" ><I CLASS="emphasis" >Bin</I ></SPAN > elements contain other elements. One type of bin is responsible for scheduling the elements that they contain so that data flows smoothly. Another type of bin, called <SPAN CLASS="emphasis" ><I CLASS="emphasis" >autoplugger</I ></SPAN > elements, automatically add other elements to the bin and link them together so that they act as a filter between two arbitary stream types. </P ><P > The plugin mechanism is used everywhere in <SPAN CLASS="application" >GStreamer</SPAN >, even if only the standard packages are being used. A few very basic functions reside in the core library, and all others are implemented in plugins. A plugin registry is used to store the details of the plugins in an XML file. This way, a program using <SPAN CLASS="application" >GStreamer</SPAN > does not have to load all plugins to determine which are needed. Plugins are only loaded when their provided elements are requested. </P ><P > See the <SPAN CLASS="emphasis" ><I CLASS="emphasis" >GStreamer Library Reference</I ></SPAN > for the current implementation details of <A HREF="../gstreamer/gstelement.html" TARGET="_top" ><CODE CLASS="classname" >GstElement</CODE ></A > and <A HREF="../gstreamer/gstreamer-gstplugin.html" TARGET="_top" ><CODE CLASS="classname" >GstPlugin</CODE ></A >. </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-preface-structure.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-basics-pads.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Structure of This Guide</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="part-introduction.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Pads</TD ></TR ></TABLE ></DIV ></BODY ></HTML >