<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Writing a Manager</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79;charset=UTF-8"><LINK REL="HOME" TITLE="GStreamer Plugin Writer's Guide (0.10.36)" HREF="index.html"><LINK REL="UP" TITLE="Creating special element types" HREF="part-other.html"><LINK REL="PREVIOUS" TITLE="Writing a N-to-1 Element or Muxer" HREF="chapter-other-ntoone.html"><LINK REL="NEXT" TITLE="Appendices" HREF="part-appendix.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 (0.10.36)</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="chapter-other-ntoone.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="part-appendix.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="chapter" ><H1 ><A NAME="chapter-other-manager" ></A >Chapter 22. Writing a Manager</H1 ><P > Managers are elements that add a function or unify the function of another (series of) element(s). Managers are generally a <CODE CLASS="classname" >GstBin</CODE > with one or more ghostpads. Inside them is/are the actual element(s) that matters. There is several cases where this is useful. For example: </P ><P ></P ><UL ><LI ><P > To add support for private events with custom event handling to another element. </P ></LI ><LI ><P > To add support for custom pad <CODE CLASS="function" >_query ()</CODE > or <CODE CLASS="function" >_convert ()</CODE > handling to another element. </P ></LI ><LI ><P > To add custom data handling before or after another element's data handler function (generally its <CODE CLASS="function" >_chain ()</CODE > function). </P ></LI ><LI ><P > To embed an element, or a series of elements, into something that looks and works like a simple element to the outside world. </P ></LI ></UL ><P > Making a manager is about as simple as it gets. You can derive from a <CODE CLASS="classname" >GstBin</CODE >, and in most cases, you can embed the required elements in the <CODE CLASS="function" >_init ()</CODE > already, including setup of ghostpads. If you need any custom data handlers, you can connect signals or embed a second element which you control. </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="chapter-other-ntoone.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="part-appendix.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Writing a N-to-1 Element or Muxer</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="part-other.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Appendices</TD ></TR ></TABLE ></DIV ></BODY ></HTML >