<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!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/html; charset=ANSI_X3.4-1968" /><title>Chapter 10. DVB Demux Device</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API" /><link rel="up" href="pt02.html" title="Part II. LINUX DVB API" /><link rel="prev" href="ch09s03.html" title="ISDB-T frontend" /><link rel="next" href="ch10s02.html" title="Demux Function Calls" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. DVB Demux Device</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch09s03.html">Prev</a> </td><th width="60%" align="center">Part II. LINUX DVB API</th><td width="20%" align="right"> <a accesskey="n" href="ch10s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 10. DVB Demux Device"><div class="titlepage"><div><div><h2 class="title"><a id="dvb_demux"></a>Chapter 10. DVB Demux Device</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch10.html#dmx_types">Demux Data Types</a></span></dt><dd><dl><dt><span class="section"><a href="ch10.html#dmx_output_t">dmx_output_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_input_t">dmx_input_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_pes_type_t">dmx_pes_type_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_event_t">dmx_event_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_scrambling_status_t">dmx_scrambling_status_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_filter">struct dmx_filter</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_sct_filter_params">struct dmx_sct_filter_params</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_pes_filter_params">struct dmx_pes_filter_params</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_event">struct dmx_event</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_stc">struct dmx_stc</a></span></dt></dl></dd><dt><span class="section"><a href="ch10s02.html">Demux Function Calls</a></span></dt><dd><dl><dt><span class="section"><a href="ch10s02.html#dmx_fopen">open()</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_fclose">close()</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_fread">read()</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_fwrite">write()</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_start">DMX_START</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_stop">DMX_STOP</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_set_filter">DMX_SET_FILTER</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_set_pes_filter">DMX_SET_PES_FILTER</a></span></dt><dt><span class="section"><a href="ch10s02.html#dms_set_buffer_size">DMX_SET_BUFFER_SIZE</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_get_event">DMX_GET_EVENT</a></span></dt><dt><span class="section"><a href="ch10s02.html#dmx_get_stc">DMX_GET_STC</a></span></dt></dl></dd></dl></div><p>The DVB demux device controls the filters of the DVB hardware/software. It can be accessed through <span class="tt">/dev/adapter0/demux0</span>. Data types and and ioctl definitions can be accessed by including <span class="tt">linux/dvb/dmx.h</span> in your application. </p><div class="section" title="Demux Data Types"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="dmx_types"></a>Demux Data Types</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ch10.html#dmx_output_t">dmx_output_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_input_t">dmx_input_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_pes_type_t">dmx_pes_type_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_event_t">dmx_event_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_scrambling_status_t">dmx_scrambling_status_t</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_filter">struct dmx_filter</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_sct_filter_params">struct dmx_sct_filter_params</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_pes_filter_params">struct dmx_pes_filter_params</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_event">struct dmx_event</a></span></dt><dt><span class="section"><a href="ch10.html#dmx_stc">struct dmx_stc</a></span></dt></dl></div><div class="section" title="dmx_output_t"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_output_t"></a>dmx_output_t</h3></div></div></div><pre class="programlisting"> typedef enum { DMX_OUT_DECODER, DMX_OUT_TAP, DMX_OUT_TS_TAP } dmx_output_t; </pre><p><span class="tt">DMX_OUT_TAP</span> delivers the stream output to the demux device on which the ioctl is called. </p><p><span class="tt">DMX_OUT_TS_TAP</span> routes output to the logical DVR device <span class="tt">/dev/dvb/adapter0/dvr0</span>, which delivers a TS multiplexed from all filters for which <span class="tt">DMX_OUT_TS_TAP</span> was specified. </p></div><div class="section" title="dmx_input_t"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_input_t"></a>dmx_input_t</h3></div></div></div><pre class="programlisting"> typedef enum { DMX_IN_FRONTEND, DMX_IN_DVR } dmx_input_t; </pre></div><div class="section" title="dmx_pes_type_t"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_pes_type_t"></a>dmx_pes_type_t</h3></div></div></div><pre class="programlisting"> typedef enum { DMX_PES_AUDIO, DMX_PES_VIDEO, DMX_PES_TELETEXT, DMX_PES_SUBTITLE, DMX_PES_PCR, DMX_PES_OTHER } dmx_pes_type_t; </pre></div><div class="section" title="dmx_event_t"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_event_t"></a>dmx_event_t</h3></div></div></div><pre class="programlisting"> typedef enum { DMX_SCRAMBLING_EV, DMX_FRONTEND_EV } dmx_event_t; </pre></div><div class="section" title="dmx_scrambling_status_t"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_scrambling_status_t"></a>dmx_scrambling_status_t</h3></div></div></div><pre class="programlisting"> typedef enum { DMX_SCRAMBLING_OFF, DMX_SCRAMBLING_ON } dmx_scrambling_status_t; </pre></div><div class="section" title="struct dmx_filter"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_filter"></a>struct dmx_filter</h3></div></div></div><pre class="programlisting"> typedef struct dmx_filter { uint8_t filter[DMX_FILTER_SIZE]; uint8_t mask[DMX_FILTER_SIZE]; } dmx_filter_t; </pre></div><div class="section" title="struct dmx_sct_filter_params"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_sct_filter_params"></a>struct dmx_sct_filter_params</h3></div></div></div><pre class="programlisting"> struct dmx_sct_filter_params { uint16_t pid; dmx_filter_t filter; uint32_t timeout; uint32_t flags; #define DMX_CHECK_CRC 1 #define DMX_ONESHOT 2 #define DMX_IMMEDIATE_START 4 }; </pre></div><div class="section" title="struct dmx_pes_filter_params"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_pes_filter_params"></a>struct dmx_pes_filter_params</h3></div></div></div><pre class="programlisting"> struct dmx_pes_filter_params { uint16_t pid; dmx_input_t input; dmx_output_t output; dmx_pes_type_t pes_type; uint32_t flags; }; </pre></div><div class="section" title="struct dmx_event"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_event"></a>struct dmx_event</h3></div></div></div><pre class="programlisting"> struct dmx_event { dmx_event_t event; time_t timeStamp; union { dmx_scrambling_status_t scrambling; } u; }; </pre></div><div class="section" title="struct dmx_stc"><div class="titlepage"><div><div><h3 class="title"><a id="dmx_stc"></a>struct dmx_stc</h3></div></div></div><pre class="programlisting"> struct dmx_stc { unsigned int num; /⋆ input : which STC? 0..N ⋆/ unsigned int base; /⋆ output: divisor for stc to get 90 kHz clock ⋆/ uint64_t stc; /⋆ output: stc in 'base'⋆90 kHz units ⋆/ }; </pre></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch09s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch10s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ISDB-T frontend </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Demux Function Calls</td></tr></table></div></body></html>