1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><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="frontend_legacy_dvbv3_api.html" title="DVB Frontend legacy API (a. k. a. DVBv3)"><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="frontend_legacy_dvbv3_api.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">Output for the demux</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 <code class="constant">/dev/adapter?/demux?</code>. Data types and and ioctl definitions can be
3accessed by including <code class="constant">linux/dvb/dmx.h</code> 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">Output for the demux</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>Output for the demux</h3></div></div></div><div class="table"><a name="dmx-output"></a><p class="title"><b>Table 10.1. enum dmx_output</b></p><div class="table-contents"><table summary="enum dmx_output" width="100%" border="0"><colgroup><col class="c1"><col class="c2"></colgroup><thead><tr><th>ID</th><th>Description</th></tr></thead><tbody valign="top"><tr><td align="char" valign="top"><a name="DMX-OUT-DECODER"></a>DMX_OUT_DECODER</td><td valign="top">Streaming directly to decoder.</td></tr><tr><td align="char" valign="top"><a name="DMX-OUT-TAP"></a>DMX_OUT_TAP</td><td valign="top">Output going to a memory buffer (to be retrieved via the
5		    read command). Delivers the stream output to the demux
6		    device on which the ioctl is called.</td></tr><tr><td align="char" valign="top"><a name="DMX-OUT-TS-TAP"></a>DMX_OUT_TS_TAP</td><td valign="top">Output multiplexed into a new TS (to be retrieved by
7		    reading from the logical DVR device). Routes output to the
8		    logical DVR device <code class="constant">/dev/dvb/adapter?/dvr?</code>,
9		    which delivers a TS multiplexed from all filters for which
10		    <code class="constant">DMX_OUT_TS_TAP</code> was specified.</td></tr><tr><td align="char" valign="top"><a name="DMX-OUT-TSDEMUX-TAP"></a>DMX_OUT_TSDEMUX_TAP</td><td valign="top">Like <a class="link" href="dvb_demux.html#DMX-OUT-TS-TAP"><code class="constant">DMX_OUT_TS_TAP</code></a> but retrieved from the DMX
11		    device.</td></tr></tbody></table></div></div><br class="table-break"></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">
12typedef enum
13{
14	DMX_IN_FRONTEND, /⋆ Input from a front-end device.  ⋆/
15	DMX_IN_DVR       /⋆ Input from the logical DVR device.  ⋆/
16} dmx_input_t;
17</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">
18typedef enum
19{
20	DMX_PES_AUDIO0,
21	DMX_PES_VIDEO0,
22	DMX_PES_TELETEXT0,
23	DMX_PES_SUBTITLE0,
24	DMX_PES_PCR0,
25
26	DMX_PES_AUDIO1,
27	DMX_PES_VIDEO1,
28	DMX_PES_TELETEXT1,
29	DMX_PES_SUBTITLE1,
30	DMX_PES_PCR1,
31
32	DMX_PES_AUDIO2,
33	DMX_PES_VIDEO2,
34	DMX_PES_TELETEXT2,
35	DMX_PES_SUBTITLE2,
36	DMX_PES_PCR2,
37
38	DMX_PES_AUDIO3,
39	DMX_PES_VIDEO3,
40	DMX_PES_TELETEXT3,
41	DMX_PES_SUBTITLE3,
42	DMX_PES_PCR3,
43
44	DMX_PES_OTHER
45} dmx_pes_type_t;
46</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">
47 typedef struct dmx_filter
48{
49	__u8  filter[DMX_FILTER_SIZE];
50	__u8  mask[DMX_FILTER_SIZE];
51	__u8  mode[DMX_FILTER_SIZE];
52} dmx_filter_t;
53</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">
54struct dmx_sct_filter_params
55{
56	__u16          pid;
57	dmx_filter_t   filter;
58	__u32          timeout;
59	__u32          flags;
60#define DMX_CHECK_CRC       1
61#define DMX_ONESHOT         2
62#define DMX_IMMEDIATE_START 4
63#define DMX_KERNEL_CLIENT   0x8000
64};
65</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">
66struct dmx_pes_filter_params
67{
68	__u16          pid;
69	dmx_input_t    input;
70	dmx_output_t   output;
71	dmx_pes_type_t pes_type;
72	__u32          flags;
73};
74</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">
75 struct dmx_event
76 {
77	 dmx_event_t          event;
78	 time_t               timeStamp;
79	 union
80	 {
81		 dmx_scrambling_status_t scrambling;
82	 } u;
83 };
84</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">
85struct dmx_stc {
86	unsigned int num;	/⋆ input : which STC? 0..N ⋆/
87	unsigned int base;	/⋆ output: divisor for stc to get 90 kHz clock ⋆/
88	__u64 stc;		/⋆ output: stc in 'base'⋆90 kHz units ⋆/
89};
90</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">
91 typedef struct dmx_caps {
92	__u32 caps;
93	int num_decoders;
94} dmx_caps_t;
95</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">
96typedef enum {
97	DMX_SOURCE_FRONT0 = 0,
98	DMX_SOURCE_FRONT1,
99	DMX_SOURCE_FRONT2,
100	DMX_SOURCE_FRONT3,
101	DMX_SOURCE_DVR0   = 16,
102	DMX_SOURCE_DVR1,
103	DMX_SOURCE_DVR2,
104	DMX_SOURCE_DVR3
105} dmx_source_t;
106</pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="frontend_legacy_dvbv3_api.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">DVB Frontend legacy API (a. k. a. DVBv3) </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>
107