1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>TS Feed API</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="dvb_kdapi.html" title="Chapter&#160;15.&#160;Kernel Demux API"><link rel="prev" href="demux_callback_api.html" title="Demux Callback API"><link rel="next" href="section_feed_api.html" title="Section Feed API"></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">TS Feed API</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="demux_callback_api.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;15.&#160;Kernel Demux API</th><td width="20%" align="right">&#160;<a accesskey="n" href="section_feed_api.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ts_feed_api"></a>TS Feed API</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="ts_feed_api.html#idp1130955484">set()</a></span></dt><dt><span class="section"><a href="ts_feed_api.html#idp1130971196">start_filtering()</a></span></dt><dt><span class="section"><a href="ts_feed_api.html#idp1130978764">stop_filtering()</a></span></dt></dl></div><p>A TS feed is typically mapped to a hardware PID filter on the demux chip.
2Using this API, the client can set the filtering properties to start/stop filtering TS
3packets on a particular TS feed. The API is defined as an abstract interface of the type
4dmx_ts_feed_t.
5</p><p>The functions that implement the interface should be defined static or module private. The
6client can get the handle of a TS feed API by calling the function allocate_ts_feed() in the
7demux API.
8</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp1130955484"></a>set()</h3></div></div></div><p>DESCRIPTION
9</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
10<p>This function sets the parameters of a TS feed. Any filtering in progress on the
11 TS feed must be stopped before calling this function.</p>
12</td></tr></tbody></table></div><p>SYNOPSIS
13</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
14<p>int set ( dmx_ts_feed_t&#8902; feed, __u16 pid, size_t
15 callback_length, size_t circular_buffer_size, int
16 descramble, struct timespec timeout);</p>
17</td></tr></tbody></table></div><p>PARAMETERS
18</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
19<p>dmx_ts_feed_t* feed</p>
20</td><td align="char">
21<p>Pointer to the TS feed API and instance data.</p>
22</td></tr><tr><td align="char">
23<p>__u16 pid</p>
24</td><td align="char">
25<p>PID value to filter. Only the TS packets carrying the
26 specified PID will be passed to the API client.</p>
27</td></tr><tr><td align="char">
28<p>size_t
29 callback_length</p>
30</td><td align="char">
31<p>Number of bytes to deliver with each call to the
32 dmx_ts_cb() callback function. The value of this
33 parameter should be a multiple of 188.</p>
34</td></tr><tr><td align="char">
35<p>size_t
36 circular_buffer_size</p>
37</td><td align="char">
38<p>Size of the circular buffer for the filtered TS packets.</p>
39</td></tr><tr><td align="char">
40<p>int descramble</p>
41</td><td align="char">
42<p>If non-zero, descramble the filtered TS packets.</p>
43</td></tr><tr><td align="char">
44<p>struct timespec
45 timeout</p>
46</td><td align="char">
47<p>Maximum time to wait before delivering received TS
48 packets to the client.</p>
49</td></tr></tbody></table></div><p>RETURNS
50</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
51<p>0</p>
52</td><td align="char">
53<p>The function was completed without errors.</p>
54</td></tr><tr><td align="char">
55<p>-ENOMEM</p>
56</td><td align="char">
57<p>Not enough memory for the requested buffer size.</p>
58</td></tr><tr><td align="char">
59<p>-ENOSYS</p>
60</td><td align="char">
61<p>No descrambling facility available for TS.</p>
62</td></tr><tr><td align="char">
63<p>-EINVAL</p>
64</td><td align="char">
65<p>Bad parameter.</p>
66</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp1130971196"></a>start_filtering()</h3></div></div></div><p>DESCRIPTION
67</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
68<p>Starts filtering TS packets on this TS feed, according to its settings. The PID
69 value to filter can be set by the API client. All matching TS packets are
70 delivered asynchronously to the client, using the callback function registered
71 with allocate_ts_feed().</p>
72</td></tr></tbody></table></div><p>SYNOPSIS
73</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
74<p>int start_filtering(dmx_ts_feed_t&#8902; feed);</p>
75</td></tr></tbody></table></div><p>PARAMETERS
76</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
77<p>dmx_ts_feed_t* feed</p>
78</td><td align="char">
79<p>Pointer to the TS feed API and instance data.</p>
80</td></tr></tbody></table></div><p>RETURNS
81</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
82<p>0</p>
83</td><td align="char">
84<p>The function was completed without errors.</p>
85</td></tr><tr><td align="char">
86<p>-EINVAL</p>
87</td><td align="char">
88<p>Bad parameter.</p>
89</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp1130978764"></a>stop_filtering()</h3></div></div></div><p>DESCRIPTION
90</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
91<p>Stops filtering TS packets on this TS feed.</p>
92</td></tr></tbody></table></div><p>SYNOPSIS
93</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
94<p>int stop_filtering(dmx_ts_feed_t&#8902; feed);</p>
95</td></tr></tbody></table></div><p>PARAMETERS
96</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
97<p>dmx_ts_feed_t* feed</p>
98</td><td align="char">
99<p>Pointer to the TS feed API and instance data.</p>
100</td></tr></tbody></table></div><p>RETURNS
101</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
102<p>0</p>
103</td><td align="char">
104<p>The function was completed without errors.</p>
105</td></tr><tr><td align="char">
106<p>-EINVAL</p>
107</td><td align="char">
108<p>Bad parameter.</p>
109</td></tr></tbody></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="demux_callback_api.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="dvb_kdapi.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="section_feed_api.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Demux Callback API&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Section Feed API</td></tr></table></div></body></html>
110