Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > 1af184c486f5d5f476d50602700ee0a0 > files > 50

lib64zvbi-devel-0.2.33-2mdv2010.0.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ZVBI Library: Data Service Decoder</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.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Data Service Decoder<br>
<small>
[<a class="el" href="group__HiDec.html">High Level Decoding</a>]</small>
</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">vbi_decoder *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Service.html#g3c09b7fa196326f51409a91e2857ba5e">vbi_decoder_new</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocate a new data service decoder instance.  <a href="#g3c09b7fa196326f51409a91e2857ba5e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Service.html#gb3f52f0b71746c9081c053a33cad7bce">vbi_decoder_delete</a> (vbi_decoder *vbi)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete a data service decoder instance.  <a href="#gb3f52f0b71746c9081c053a33cad7bce"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Service.html#g2e2201e3b2bab9b7fb1bb66ade716772">vbi_decode</a> (vbi_decoder *vbi, <a class="el" href="structvbi__sliced.html">vbi_sliced</a> *sliced, int lines, double timestamp)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Main function of the data service decoder.  <a href="#g2e2201e3b2bab9b7fb1bb66ade716772"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Service.html#g76b4210fb90365e6f09426fcde7ebec6">vbi_channel_switched</a> (vbi_decoder *vbi, <a class="el" href="group__Event.html#gf7674e0718ecde1f3340325e34296b6a">vbi_nuid</a> nuid)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__HiDec.html#gc59ccd99e4d2acdd8b48a2289047725f">vbi_page_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Service.html#g791491ac674cacc52fa27d8207f1c8e5">vbi_classify_page</a> (vbi_decoder *vbi, <a class="el" href="group__HiDec.html#g8711c9b42b61d518b7f79e941fe94eb1">vbi_pgno</a> pgno, <a class="el" href="group__HiDec.html#g06ee2e75548bbd0fcca06a71395c940e">vbi_subno</a> *subno, char **language)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Service.html#gf2e31cbf38e933d930d1bcbe4b259caa">vbi_version</a> (unsigned int *major, unsigned int *minor, unsigned int *micro)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Service.html#g594dbe49c85f00a11c3586a131203b61">vbi_set_log_fn</a> (<a class="el" href="group__Basic.html#g14be5ab1155e94b01c79a4ed044e64ac">vbi_log_mask</a> mask, vbi_log_fn *log_fn, void *user_data)</td></tr>

</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g3c09b7fa196326f51409a91e2857ba5e"></a><!-- doxytag: member="vbi.h::vbi_decoder_new" ref="g3c09b7fa196326f51409a91e2857ba5e" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">vbi_decoder* vbi_decoder_new           </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Allocate a new data service decoder instance. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>vbi_decoder pointer or <code>NULL</code> on failure, probably due to lack of memory. </dd></dl>

</div>
</div><p>
<a class="anchor" name="gb3f52f0b71746c9081c053a33cad7bce"></a><!-- doxytag: member="vbi.h::vbi_decoder_delete" ref="gb3f52f0b71746c9081c053a33cad7bce" args="(vbi_decoder *vbi)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vbi_decoder_delete           </td>
          <td>(</td>
          <td class="paramtype">vbi_decoder *&nbsp;</td>
          <td class="paramname"> <em>vbi</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Delete a data service decoder instance. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>vbi</em>&nbsp;</td><td>Decoder structure allocated with <a class="el" href="group__Service.html#g3c09b7fa196326f51409a91e2857ba5e" title="Allocate a new data service decoder instance.">vbi_decoder_new()</a>. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="g2e2201e3b2bab9b7fb1bb66ade716772"></a><!-- doxytag: member="vbi.h::vbi_decode" ref="g2e2201e3b2bab9b7fb1bb66ade716772" args="(vbi_decoder *vbi, vbi_sliced *sliced, int lines, double timestamp)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vbi_decode           </td>
          <td>(</td>
          <td class="paramtype">vbi_decoder *&nbsp;</td>
          <td class="paramname"> <em>vbi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structvbi__sliced.html">vbi_sliced</a> *&nbsp;</td>
          <td class="paramname"> <em>sliced</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>lines</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>time</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Main function of the data service decoder. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>vbi</em>&nbsp;</td><td>Initialized vbi decoding context as returned by <a class="el" href="group__Service.html#g3c09b7fa196326f51409a91e2857ba5e" title="Allocate a new data service decoder instance.">vbi_decoder_new()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sliced</em>&nbsp;</td><td>Array of <a class="el" href="structvbi__sliced.html" title="This structure holds one scan line of sliced vbi data.">vbi_sliced</a> data packets to be decoded. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>lines</em>&nbsp;</td><td>Number of <a class="el" href="structvbi__sliced.html" title="This structure holds one scan line of sliced vbi data.">vbi_sliced</a> data packets, i. e. VBI lines. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>time</em>&nbsp;</td><td>Timestamp associated with <em>all</em> sliced data packets. This is the time in seconds and fractions since 1970-01-01 00:00, for example from function gettimeofday(). <em>time</em> should only increment, the latest time entered is considered the current time for activity calculation.</td></tr>
  </table>
</dl>
Decodes zero or more lines of sliced VBI data from the same video frame, updates the decoder state and calls event handlers.<p>
<em>timestamp</em> shall advance by 1/30 to 1/25 seconds whenever calling this function. Failure to do so will be interpreted as frame dropping, which starts a resynchronization cycle, eventually a channel switch may be assumed which resets even more decoder state. So even if a frame did not contain any useful data this function must be called, with <em>lines</em> set to zero.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>This is one of the few not reentrant libzvbi functions. If multiple threads call this with the same <em>vbi</em> context you must implement your own locking mechanism. Never call this function from an event handler. </dd></dl>

</div>
</div><p>
<a class="anchor" name="g76b4210fb90365e6f09426fcde7ebec6"></a><!-- doxytag: member="vbi.h::vbi_channel_switched" ref="g76b4210fb90365e6f09426fcde7ebec6" args="(vbi_decoder *vbi, vbi_nuid nuid)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vbi_channel_switched           </td>
          <td>(</td>
          <td class="paramtype">vbi_decoder *&nbsp;</td>
          <td class="paramname"> <em>vbi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Event.html#gf7674e0718ecde1f3340325e34296b6a">vbi_nuid</a>&nbsp;</td>
          <td class="paramname"> <em>nuid</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>vbi</em>&nbsp;</td><td>VBI decoding context. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>nuid</em>&nbsp;</td><td>Set to zero for now.</td></tr>
  </table>
</dl>
Call this after switching away from the channel (RF channel, video input line, precisely: the network) from which this context used to receive vbi data, to reset the decoding context accordingly. This includes deletion of all cached Teletext and Closed Caption pages.<p>
The decoder attempts to detect channel switches automatically, but this is not 100 % reliable, especially without receiving and decoding Teletext or VPS which frequently transmit network identifiers.<p>
Note the reset is not executed until the next frame is about to be decoded, so you may still receive "old" events after calling this. You may also receive blank events (e. g. unknown network, unknown aspect ratio) revoking a previously sent event, until new information becomes available. 
</div>
</div><p>
<a class="anchor" name="g791491ac674cacc52fa27d8207f1c8e5"></a><!-- doxytag: member="vbi.h::vbi_classify_page" ref="g791491ac674cacc52fa27d8207f1c8e5" args="(vbi_decoder *vbi, vbi_pgno pgno, vbi_subno *subno, char **language)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__HiDec.html#gc59ccd99e4d2acdd8b48a2289047725f">vbi_page_type</a> vbi_classify_page           </td>
          <td>(</td>
          <td class="paramtype">vbi_decoder *&nbsp;</td>
          <td class="paramname"> <em>vbi</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__HiDec.html#g8711c9b42b61d518b7f79e941fe94eb1">vbi_pgno</a>&nbsp;</td>
          <td class="paramname"> <em>pgno</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__HiDec.html#g06ee2e75548bbd0fcca06a71395c940e">vbi_subno</a> *&nbsp;</td>
          <td class="paramname"> <em>subno</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&nbsp;</td>
          <td class="paramname"> <em>language</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>vbi</em>&nbsp;</td><td>Initialized vbi decoding context. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pgno</em>&nbsp;</td><td>Teletext or Closed Caption page to examine, see vbi_pgno. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>subno</em>&nbsp;</td><td>The highest subpage number of this page will be stored here. <em>subno</em> can be <code>NULL</code>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>language</em>&nbsp;</td><td>If it is possible to determine the language a page is written in, a pointer to the language name (Latin-1) will be stored here, <code>NULL</code> if the language is unknown. <em>language</em> can be <code>NULL</code> if this information is not needed.</td></tr>
  </table>
</dl>
Returns information about the page.<p>
For Closed Caption pages (<em>pgno</em> 1 ... 8) <em>subno</em> will always be zero, <em>language</em> set or <code>NULL</code>. The return value will be <code>VBI_SUBTITLE_PAGE</code> for page 1 ... 4 (Closed Caption channel 1 ... 4), <code>VBI_NORMAL_PAGE</code> for page 5 ... 8 (Text channel 1 ... 4), or <code>VBI_NO_PAGE</code> if no data is currently transmitted on the channel.<p>
For Teletext pages (<em>pgno</em> 0x100 ... 0x8FF) <em>subno</em> returns the highest subpage number used. Note this number can be larger (but not smaller) than the number of subpages actually received and cached. Still there is no guarantee the advertised subpages will ever appear or stay in cache.<p>
<table border="1" cellspacing="3" cellpadding="3">
<tr>
<td><b>subno</b></td><td><b>meaning</b> </td></tr>
<tr>
<td>0</td><td>single page, no subpages </td></tr>
<tr>
<td>1</td><td>never </td></tr>
<tr>
<td>2 ... 0x3F7F</td><td>has subpages 1 ... <em>subno</em>  </td></tr>
<tr>
<td>0xFFFE</td><td>has unknown number (two or more) of subpages </td></tr>
<tr>
<td>0xFFFF</td><td>presence of subpages unknown </td></tr>
</table>
<p>
<em>language</em> currently returns the language of subtitle pages, <code>NULL</code> if unknown or the page is not classified as <code>VBI_SUBTITLE_PAGE</code>.<p>
Other page types are:<p>
<table border="1" cellspacing="3" cellpadding="3">
<tr>
<td>VBI_NO_PAGE</td><td>Page is not in transmission </td></tr>
<tr>
<td>VBI_NORMAL_PAGE</td><td>&nbsp; </td></tr>
<tr>
<td>VBI_SUBTITLE_PAGE</td><td>&nbsp; </td></tr>
<tr>
<td>VBI_SUBTITLE_INDEX</td><td>List of subtitle pages </td></tr>
<tr>
<td>VBI_NONSTD_SUBPAGES</td><td>For example a world time page </td></tr>
<tr>
<td>VBI_PROGR_WARNING</td><td>Program related warning (perhaps schedule change anouncements, the Teletext specification does not elaborate on this) </td></tr>
<tr>
<td>VBI_CURRENT_PROGR</td><td>Information about the current program </td></tr>
<tr>
<td>VBI_NOW_AND_NEXT</td><td>Brief information about the current and next program </td></tr>
<tr>
<td>VBI_PROGR_INDEX</td><td>Program index page (perhaps the front page of all program related pages) </td></tr>
<tr>
<td>VBI_PROGR_SCHEDULE</td><td>Program schedule page </td></tr>
<tr>
<td>VBI_UNKNOWN_PAGE</td><td>&nbsp; </td></tr>
</table>
<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The results of this function are volatile: As more information becomes available and pages are edited (e. g. activation of subtitles, news updates, program related pages) subpage numbers can grow, page types, subno 0xFFFE and 0xFFFF and languages can change.</dd></dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Page type. </dd></dl>

</div>
</div><p>
<a class="anchor" name="gf2e31cbf38e933d930d1bcbe4b259caa"></a><!-- doxytag: member="vbi.h::vbi_version" ref="gf2e31cbf38e933d930d1bcbe4b259caa" args="(unsigned int *major, unsigned int *minor, unsigned int *micro)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vbi_version           </td>
          <td>(</td>
          <td class="paramtype">unsigned int *&nbsp;</td>
          <td class="paramname"> <em>major</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&nbsp;</td>
          <td class="paramname"> <em>minor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int *&nbsp;</td>
          <td class="paramname"> <em>micro</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>major</em>&nbsp;</td><td>Store major number here, can be NULL. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>minor</em>&nbsp;</td><td>Store minor number here, can be NULL. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>micro</em>&nbsp;</td><td>Store micro number here, can be NULL.</td></tr>
  </table>
</dl>
Returns the library version defined in the libzvbi.h header file when the library was compiled.<p>
<dl class="since" compact><dt><b>Since:</b></dt><dd>0.2.5 </dd></dl>

</div>
</div><p>
<a class="anchor" name="g594dbe49c85f00a11c3586a131203b61"></a><!-- doxytag: member="vbi.h::vbi_set_log_fn" ref="g594dbe49c85f00a11c3586a131203b61" args="(vbi_log_mask mask, vbi_log_fn *log_fn, void *user_data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void vbi_set_log_fn           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Basic.html#g14be5ab1155e94b01c79a4ed044e64ac">vbi_log_mask</a>&nbsp;</td>
          <td class="paramname"> <em>mask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">vbi_log_fn *&nbsp;</td>
          <td class="paramname"> <em>log_fn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>user_data</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>mask</em>&nbsp;</td><td>Which kind of information to log. Can be <code>0</code>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>log_fn</em>&nbsp;</td><td>This function is called with log messages. Consider <a class="el" href="group__Basic.html#g892c64da1c60919512f0c4db6641a708">vbi_log_on_stderr()</a>. Can be <code>NULL</code> to disable logging. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>user_data</em>&nbsp;</td><td>User pointer passed through to the <em>log_fn</em> function.</td></tr>
  </table>
</dl>
Various functions can print warnings, errors and information useful to debug the library. With this function you can enable these messages and determine a function to print them.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The kind and contents of messages logged by particular functions may change in the future.</dd></dl>
<dl class="since" compact><dt><b>Since:</b></dt><dd>0.2.22 </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed May 27 04:47:58 2009 for ZVBI Library by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>