1<html><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.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="dvbapi.html" title="Part II. LINUX DVB API"><link rel="prev" href="FE_GET_SET_PROPERTY.html" title="FE_GET_PROPERTY/FE_SET_PROPERTY"><link rel="next" href="dmx_fcalls.html" title="Demux Function Calls"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><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="FE_GET_SET_PROPERTY.html">Prev</a> </td><th width="60%" align="center">Part II. LINUX DVB API</th><td width="20%" align="right"> <a accesskey="n" href="dmx_fcalls.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="dvb_demux"></a>Chapter 10. DVB Demux Device</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="dvb_demux.html#dmx_types">Demux Data Types</a></span></dt><dd><dl><dt><span class="section"><a href="dvb_demux.html#dmx-output-t">dmx_output_t</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-input-t">dmx_input_t</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-pes-type-t">dmx_pes_type_t</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-filter">struct dmx_filter</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-sct-filter-params">struct dmx_sct_filter_params</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-pes-filter-params">struct dmx_pes_filter_params</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-event">struct dmx_event</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-stc">struct dmx_stc</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-caps">struct dmx_caps</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-source-t">enum dmx_source_t</a></span></dt></dl></dd><dt><span class="section"><a href="dmx_fcalls.html">Demux Function Calls</a></span></dt><dd><dl><dt><span class="section"><a href="dmx_fcalls.html#dmx_fopen">open()</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#dmx_fclose">close()</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#dmx_fread">read()</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#dmx_fwrite">write()</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_START">DMX_START</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_STOP">DMX_STOP</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_SET_FILTER">DMX_SET_FILTER</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_SET_PES_FILTER">DMX_SET_PES_FILTER</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_SET_BUFFER_SIZE">DMX_SET_BUFFER_SIZE</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_GET_EVENT">DMX_GET_EVENT</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_GET_STC">DMX_GET_STC</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_GET_PES_PIDS">DMX_GET_PES_PIDS</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_GET_CAPS">DMX_GET_CAPS</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_SET_SOURCE">DMX_SET_SOURCE</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_ADD_PID">DMX_ADD_PID</a></span></dt><dt><span class="section"><a href="dmx_fcalls.html#DMX_REMOVE_PID">DMX_REMOVE_PID</a></span></dt></dl></dd></dl></div><p>The DVB demux device controls the filters of the DVB hardware/software. It can be 2accessed through <span class="tt">/dev/adapter0/demux0</span>. Data types and and ioctl definitions can be 3accessed by including <span class="tt">linux/dvb/dmx.h</span> in your application. 4</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="dmx_types"></a>Demux Data Types</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="dvb_demux.html#dmx-output-t">dmx_output_t</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-input-t">dmx_input_t</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-pes-type-t">dmx_pes_type_t</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-filter">struct dmx_filter</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-sct-filter-params">struct dmx_sct_filter_params</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-pes-filter-params">struct dmx_pes_filter_params</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-event">struct dmx_event</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-stc">struct dmx_stc</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-caps">struct dmx_caps</a></span></dt><dt><span class="section"><a href="dvb_demux.html#dmx-source-t">enum dmx_source_t</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-output-t"></a>dmx_output_t</h3></div></div></div><pre class="programlisting"> 5typedef enum 6{ 7 DMX_OUT_DECODER, /⋆ Streaming directly to decoder. ⋆/ 8 DMX_OUT_TAP, /⋆ Output going to a memory buffer ⋆/ 9 /⋆ (to be retrieved via the read command).⋆/ 10 DMX_OUT_TS_TAP, /⋆ Output multiplexed into a new TS ⋆/ 11 /⋆ (to be retrieved by reading from the ⋆/ 12 /⋆ logical DVR device). ⋆/ 13 DMX_OUT_TSDEMUX_TAP /⋆ Like TS_TAP but retrieved from the DMX device ⋆/ 14} dmx_output_t; 15</pre><p><span class="tt">DMX_OUT_TAP</span> delivers the stream output to the demux device on which the ioctl is 16called. 17</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>, 18which delivers a TS multiplexed from all filters for which <span class="tt">DMX_OUT_TS_TAP</span> was 19specified. 20</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-input-t"></a>dmx_input_t</h3></div></div></div><pre class="programlisting"> 21typedef enum 22{ 23 DMX_IN_FRONTEND, /⋆ Input from a front-end device. ⋆/ 24 DMX_IN_DVR /⋆ Input from the logical DVR device. ⋆/ 25} dmx_input_t; 26</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-pes-type-t"></a>dmx_pes_type_t</h3></div></div></div><pre class="programlisting"> 27typedef enum 28{ 29 DMX_PES_AUDIO0, 30 DMX_PES_VIDEO0, 31 DMX_PES_TELETEXT0, 32 DMX_PES_SUBTITLE0, 33 DMX_PES_PCR0, 34 35 DMX_PES_AUDIO1, 36 DMX_PES_VIDEO1, 37 DMX_PES_TELETEXT1, 38 DMX_PES_SUBTITLE1, 39 DMX_PES_PCR1, 40 41 DMX_PES_AUDIO2, 42 DMX_PES_VIDEO2, 43 DMX_PES_TELETEXT2, 44 DMX_PES_SUBTITLE2, 45 DMX_PES_PCR2, 46 47 DMX_PES_AUDIO3, 48 DMX_PES_VIDEO3, 49 DMX_PES_TELETEXT3, 50 DMX_PES_SUBTITLE3, 51 DMX_PES_PCR3, 52 53 DMX_PES_OTHER 54} dmx_pes_type_t; 55</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-filter"></a>struct dmx_filter</h3></div></div></div><pre class="programlisting"> 56 typedef struct dmx_filter 57{ 58 __u8 filter[DMX_FILTER_SIZE]; 59 __u8 mask[DMX_FILTER_SIZE]; 60 __u8 mode[DMX_FILTER_SIZE]; 61} dmx_filter_t; 62</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-sct-filter-params"></a>struct dmx_sct_filter_params</h3></div></div></div><pre class="programlisting"> 63struct dmx_sct_filter_params 64{ 65 __u16 pid; 66 dmx_filter_t filter; 67 __u32 timeout; 68 __u32 flags; 69#define DMX_CHECK_CRC 1 70#define DMX_ONESHOT 2 71#define DMX_IMMEDIATE_START 4 72#define DMX_KERNEL_CLIENT 0x8000 73}; 74</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-pes-filter-params"></a>struct dmx_pes_filter_params</h3></div></div></div><pre class="programlisting"> 75struct dmx_pes_filter_params 76{ 77 __u16 pid; 78 dmx_input_t input; 79 dmx_output_t output; 80 dmx_pes_type_t pes_type; 81 __u32 flags; 82}; 83</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-event"></a>struct dmx_event</h3></div></div></div><pre class="programlisting"> 84 struct dmx_event 85 { 86 dmx_event_t event; 87 time_t timeStamp; 88 union 89 { 90 dmx_scrambling_status_t scrambling; 91 } u; 92 }; 93</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-stc"></a>struct dmx_stc</h3></div></div></div><pre class="programlisting"> 94struct dmx_stc { 95 unsigned int num; /⋆ input : which STC? 0..N ⋆/ 96 unsigned int base; /⋆ output: divisor for stc to get 90 kHz clock ⋆/ 97 __u64 stc; /⋆ output: stc in 'base'⋆90 kHz units ⋆/ 98}; 99</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-caps"></a>struct dmx_caps</h3></div></div></div><pre class="programlisting"> 100 typedef struct dmx_caps { 101 __u32 caps; 102 int num_decoders; 103} dmx_caps_t; 104</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="dmx-source-t"></a>enum dmx_source_t</h3></div></div></div><pre class="programlisting"> 105typedef enum { 106 DMX_SOURCE_FRONT0 = 0, 107 DMX_SOURCE_FRONT1, 108 DMX_SOURCE_FRONT2, 109 DMX_SOURCE_FRONT3, 110 DMX_SOURCE_DVR0 = 16, 111 DMX_SOURCE_DVR1, 112 DMX_SOURCE_DVR2, 113 DMX_SOURCE_DVR3 114} dmx_source_t; 115</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="FE_GET_SET_PROPERTY.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="dvbapi.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dmx_fcalls.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><code class="constant">FE_GET_PROPERTY/FE_SET_PROPERTY</code> </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> 116