<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libannodex: anx_import.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2-20100208 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div class="contents"> <h1>anx_import.h File Reference</h1> <p>Specification of AnxImporter. <a href="#_details">More...</a></p> <code>#include <<a class="el" href="anx__types_8h_source.html">annodex/anx_types.h</a>></code><br/> <code>#include <<a class="el" href="anx__core_8h_source.html">annodex/anx_core.h</a>></code><br/> <p><a href="anx__import_8h_source.html">Go to the source code of this file.</a></p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td colspan="2"><h2>Data Structures</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__AnxImporter.html">_AnxImporter</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__AnxSourceTrack.html">_AnxSourceTrack</a></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="struct__AnxSource.html">_AnxSource</a></td></tr> <tr><td colspan="2"><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7ef25c6a503d22c097a97880568d63b2"></a><!-- doxytag: member="anx_import.h::AnxImporter" ref="a7ef25c6a503d22c097a97880568d63b2" args="" --> typedef struct <a class="el" href="struct__AnxImporter.html">_AnxImporter</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a7ef25c6a503d22c097a97880568d63b2">AnxImporter</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">An AnxImporter implements generic functions for retrieving data from sources of a particular content type. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac085fbac2d98170e3f0adde743906196"></a><!-- doxytag: member="anx_import.h::AnxSourceTrack" ref="ac085fbac2d98170e3f0adde743906196" args="" --> typedef struct <a class="el" href="struct__AnxSourceTrack.html">_AnxSourceTrack</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#ac085fbac2d98170e3f0adde743906196">AnxSourceTrack</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">An AnxSourceTrack contains one track of data. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a14e091e5058dcbc76d259426cccc30fe"></a><!-- doxytag: member="anx_import.h::AnxSource" ref="a14e091e5058dcbc76d259426cccc30fe" args="" --> typedef struct <a class="el" href="struct__AnxSource.html">_AnxSource</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a14e091e5058dcbc76d259426cccc30fe">AnxSource</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">An AnxSource contains an instance of an active source object, which may in turn contain several tracks. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="struct__AnxSource.html">AnxSource</a> *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a156f2d28f8a13687285236ab26068bdc">AnxImporterOpenFunc</a> )(const char *path, const char *id, int ignore_raw, double start_time, double end_time, <a class="el" href="struct__AnxImportCallbacks.html">AnxImportCallbacks</a> *import_callbacks)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signature of a function for opening a source object by filename. <a href="#a156f2d28f8a13687285236ab26068bdc"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="struct__AnxSource.html">AnxSource</a> *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a509bb30fec7ca4c8ded4bbf8ef822344">AnxImporterOpenFDFunc</a> )(int fd, const char *id, int ignore_raw, double start_time, double end_time, <a class="el" href="struct__AnxImportCallbacks.html">AnxImportCallbacks</a> *import_callbacks)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signature of a function for opening a source object attached to an open file descriptor. <a href="#a509bb30fec7ca4c8ded4bbf8ef822344"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef long(* </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#aea82f572a0e267e0d6e23b0a69b345a8">AnxImporterReadFunc</a> )(<a class="el" href="struct__AnxSource.html">AnxSource</a> *source, unsigned char *buf, long n, long bound)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signature of a function for reading bytes from a source object. <a href="#aea82f572a0e267e0d6e23b0a69b345a8"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef long(* </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a643d13715eabc862f669689d6650e0e9">AnxImporterSizeofNextReadFunc</a> )(<a class="el" href="struct__AnxSource.html">AnxSource</a> *source, long bound)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signature of a function to return the preferred next read size. <a href="#a643d13715eabc862f669689d6650e0e9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a7e7f0638d437057f8f2213d592175bcf">AnxImporterCloseFunc</a> )(<a class="el" href="struct__AnxSource.html">AnxSource</a> *source)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signature of a function to close a source object. <a href="#a7e7f0638d437057f8f2213d592175bcf"></a><br/></td></tr> <tr><td colspan="2"><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a8dafe7e363ef5e53591ebae10206485d">anx_importer_register</a> (<a class="el" href="struct__AnxImporter.html">AnxImporter</a> *importer)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Register an AnxImporter object with libannodex. <a href="#a8dafe7e363ef5e53591ebae10206485d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#a651facffd5bce00746056eb25f4964c6">anx_importer_unregister</a> (<a class="el" href="struct__AnxImporter.html">AnxImporter</a> *importer)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Unregister an AnxImporter previously registered with libannodex. <a href="#a651facffd5bce00746056eb25f4964c6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct__AnxImporter.html">AnxImporter</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="anx__import_8h.html#ac74356f4bcef219f8d1fe4e1a824210b">anx_importer_find</a> (char *content_type)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Find the AnxImporter registered with the given content type. <a href="#ac74356f4bcef219f8d1fe4e1a824210b"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>Specification of AnxImporter. </p> <ul> <li>When read requires starting a new frame or GOP, check the need_sync flag. If this is set, output a sync frame.</li> </ul> <dl class="note"><dt><b>Note:</b></dt><dd>Always check not to seek before start_packet and not to seek or read past end_packet.</dd></dl> <ul> <li>seek should return the actual position after seeking (as the backend may not be able to seek exactly to the requested position).</li> </ul> <p>Backends must implement the following function:</p> <ul> <li>AnxImporter * anx_importer_init (int i);</li> </ul> <p>Importers are accessed by index i using values from 0 upwards. For out of range indexes, this function must return NULL.</p> <p>No other symbols in a backend should be visible (ie. declare all other globals and functions as static). </p> <hr/><h2>Typedef Documentation</h2> <a class="anchor" id="a7e7f0638d437057f8f2213d592175bcf"></a><!-- doxytag: member="anx_import.h::AnxImporterCloseFunc" ref="a7e7f0638d437057f8f2213d592175bcf" args=")(AnxSource *source)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef int(* <a class="el" href="anx__import_8h.html#a7e7f0638d437057f8f2213d592175bcf">AnxImporterCloseFunc</a>)(<a class="el" href="struct__AnxSource.html">AnxSource</a> *source)</td> </tr> </table> </div> <div class="memdoc"> <p>Signature of a function to close a source object. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>source</em> </td><td>an AnxSource* handle </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a509bb30fec7ca4c8ded4bbf8ef822344"></a><!-- doxytag: member="anx_import.h::AnxImporterOpenFDFunc" ref="a509bb30fec7ca4c8ded4bbf8ef822344" args=")(int fd, const char *id, int ignore_raw, double start_time, double end_time, AnxImportCallbacks *import_callbacks)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef <a class="el" href="struct__AnxSource.html">AnxSource</a>*(* <a class="el" href="anx__import_8h.html#a509bb30fec7ca4c8ded4bbf8ef822344">AnxImporterOpenFDFunc</a>)(int fd, const char *id, int ignore_raw, double start_time, double end_time, <a class="el" href="struct__AnxImportCallbacks.html">AnxImportCallbacks</a> *import_callbacks)</td> </tr> </table> </div> <div class="memdoc"> <p>Signature of a function for opening a source object attached to an open file descriptor. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>fd</em> </td><td>an open file descriptor </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>the id of this </td></tr> <tr><td valign="top"></td><td valign="top"><em>ignore_raw</em> </td><td>a flag to indicate that the importer should ignore any raw source read requests, ie. just deliver clips </td></tr> <tr><td valign="top"></td><td valign="top"><em>start_time</em> </td><td>the start time to initially seek to </td></tr> <tr><td valign="top"></td><td valign="top"><em>end_time</em> </td><td>a time bound to end on </td></tr> <tr><td valign="top"></td><td valign="top"><em>import_callbacks</em> </td><td>callbacks to call when further importing or anchor inserting is required. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>a new AnxSource * handle </dd></dl> </div> </div> <a class="anchor" id="a156f2d28f8a13687285236ab26068bdc"></a><!-- doxytag: member="anx_import.h::AnxImporterOpenFunc" ref="a156f2d28f8a13687285236ab26068bdc" args=")(const char *path, const char *id, int ignore_raw, double start_time, double end_time, AnxImportCallbacks *import_callbacks)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef <a class="el" href="struct__AnxSource.html">AnxSource</a>*(* <a class="el" href="anx__import_8h.html#a156f2d28f8a13687285236ab26068bdc">AnxImporterOpenFunc</a>)(const char *path, const char *id, int ignore_raw, double start_time, double end_time, <a class="el" href="struct__AnxImportCallbacks.html">AnxImportCallbacks</a> *import_callbacks)</td> </tr> </table> </div> <div class="memdoc"> <p>Signature of a function for opening a source object by filename. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>path</em> </td><td>the path to the source file </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>the id of this </td></tr> <tr><td valign="top"></td><td valign="top"><em>ignore_raw</em> </td><td>a flag to indicate that the importer should ignore any raw source read requests, ie. just deliver clips </td></tr> <tr><td valign="top"></td><td valign="top"><em>start_time</em> </td><td>the start time to initially seek to </td></tr> <tr><td valign="top"></td><td valign="top"><em>end_time</em> </td><td>a time bound to end on </td></tr> <tr><td valign="top"></td><td valign="top"><em>import_callbacks</em> </td><td>callbacks to call when further importing or anchor inserting is required. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>a new AnxSource * handle </dd></dl> </div> </div> <a class="anchor" id="aea82f572a0e267e0d6e23b0a69b345a8"></a><!-- doxytag: member="anx_import.h::AnxImporterReadFunc" ref="aea82f572a0e267e0d6e23b0a69b345a8" args=")(AnxSource *source, unsigned char *buf, long n, long bound)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef long(* <a class="el" href="anx__import_8h.html#aea82f572a0e267e0d6e23b0a69b345a8">AnxImporterReadFunc</a>)(<a class="el" href="struct__AnxSource.html">AnxSource</a> *source, unsigned char *buf, long n, long bound)</td> </tr> </table> </div> <div class="memdoc"> <p>Signature of a function for reading bytes from a source object. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>source</em> </td><td>an AnxSource * handle </td></tr> <tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>a buffer to read data into </td></tr> <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>a maximum number of bytes to read </td></tr> <tr><td valign="top"></td><td valign="top"><em>bound</em> </td><td>a maximum granulecount to read </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a643d13715eabc862f669689d6650e0e9"></a><!-- doxytag: member="anx_import.h::AnxImporterSizeofNextReadFunc" ref="a643d13715eabc862f669689d6650e0e9" args=")(AnxSource *source, long bound)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef long(* <a class="el" href="anx__import_8h.html#a643d13715eabc862f669689d6650e0e9">AnxImporterSizeofNextReadFunc</a>)(<a class="el" href="struct__AnxSource.html">AnxSource</a> *source, long bound)</td> </tr> </table> </div> <div class="memdoc"> <p>Signature of a function to return the preferred next read size. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>source</em> </td><td>an AnxSource * handle </td></tr> <tr><td valign="top"></td><td valign="top"><em>bound</em> </td><td>a maximum granulecount to read </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Function Documentation</h2> <a class="anchor" id="ac74356f4bcef219f8d1fe4e1a824210b"></a><!-- doxytag: member="anx_import.h::anx_importer_find" ref="ac74356f4bcef219f8d1fe4e1a824210b" args="(char *content_type)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="struct__AnxImporter.html">AnxImporter</a>* anx_importer_find </td> <td>(</td> <td class="paramtype">char * </td> <td class="paramname"> <em>content_type</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Find the AnxImporter registered with the given content type. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>content_type</em> </td><td>the content type </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>the AnxImporter * on success, NULL on failure </dd></dl> </div> </div> <a class="anchor" id="a8dafe7e363ef5e53591ebae10206485d"></a><!-- doxytag: member="anx_import.h::anx_importer_register" ref="a8dafe7e363ef5e53591ebae10206485d" args="(AnxImporter *importer)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int anx_importer_register </td> <td>(</td> <td class="paramtype"><a class="el" href="struct__AnxImporter.html">AnxImporter</a> * </td> <td class="paramname"> <em>importer</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Register an AnxImporter object with libannodex. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>importer</em> </td><td>the importer </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl> </div> </div> <a class="anchor" id="a651facffd5bce00746056eb25f4964c6"></a><!-- doxytag: member="anx_import.h::anx_importer_unregister" ref="a651facffd5bce00746056eb25f4964c6" args="(AnxImporter *importer)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int anx_importer_unregister </td> <td>(</td> <td class="paramtype"><a class="el" href="struct__AnxImporter.html">AnxImporter</a> * </td> <td class="paramname"> <em>importer</em></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Unregister an AnxImporter previously registered with libannodex. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>importer</em> </td><td>the importer </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>0 on success, -1 on failure </dd></dl> </div> </div> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>