kdapi.xml 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309
  1. <title>Kernel Demux API</title>
  2. <para>The kernel demux API defines a driver-internal interface for registering low-level,
  3. hardware specific driver to a hardware independent demux layer. It is only of interest for
  4. DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in
  5. <emphasis role="tt">drivers/media/dvb/dvb-core</emphasis>.
  6. </para>
  7. <para>Maintainer note: This section must be reviewed. It is probably out of date.
  8. </para>
  9. <section id="kernel_demux_data_types">
  10. <title>Kernel Demux Data Types</title>
  11. <section id="dmx_success_t">
  12. <title>dmx_success_t</title>
  13. <programlisting>
  14. typedef enum {
  15. DMX_OK = 0, /&#x22C6; Received Ok &#x22C6;/
  16. DMX_LENGTH_ERROR, /&#x22C6; Incorrect length &#x22C6;/
  17. DMX_OVERRUN_ERROR, /&#x22C6; Receiver ring buffer overrun &#x22C6;/
  18. DMX_CRC_ERROR, /&#x22C6; Incorrect CRC &#x22C6;/
  19. DMX_FRAME_ERROR, /&#x22C6; Frame alignment error &#x22C6;/
  20. DMX_FIFO_ERROR, /&#x22C6; Receiver FIFO overrun &#x22C6;/
  21. DMX_MISSED_ERROR /&#x22C6; Receiver missed packet &#x22C6;/
  22. } dmx_success_t;
  23. </programlisting>
  24. </section>
  25. <section id="ts_filter_types">
  26. <title>TS filter types</title>
  27. <programlisting>
  28. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  29. /&#x22C6; TS packet reception &#x22C6;/
  30. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  31. /&#x22C6; TS filter type for set_type() &#x22C6;/
  32. #define TS_PACKET 1 /&#x22C6; send TS packets (188 bytes) to callback (default) &#x22C6;/
  33. #define TS_PAYLOAD_ONLY 2 /&#x22C6; in case TS_PACKET is set, only send the TS
  34. payload (&#x003C;=184 bytes per packet) to callback &#x22C6;/
  35. #define TS_DECODER 4 /&#x22C6; send stream to built-in decoder (if present) &#x22C6;/
  36. </programlisting>
  37. </section>
  38. <section id="dmx_ts_pes_t">
  39. <title>dmx_ts_pes_t</title>
  40. <para>The structure
  41. </para>
  42. <programlisting>
  43. typedef enum
  44. {
  45. DMX_TS_PES_AUDIO, /&#x22C6; also send packets to audio decoder (if it exists) &#x22C6;/
  46. DMX_TS_PES_VIDEO, /&#x22C6; ... &#x22C6;/
  47. DMX_TS_PES_TELETEXT,
  48. DMX_TS_PES_SUBTITLE,
  49. DMX_TS_PES_PCR,
  50. DMX_TS_PES_OTHER,
  51. } dmx_ts_pes_t;
  52. </programlisting>
  53. <para>describes the PES type for filters which write to a built-in decoder. The correspond (and
  54. should be kept identical) to the types in the demux device.
  55. </para>
  56. <programlisting>
  57. struct dmx_ts_feed_s {
  58. int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
  59. struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
  60. void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
  61. int (&#x22C6;set) (struct dmx_ts_feed_s&#x22C6; feed,
  62. __u16 pid,
  63. size_t callback_length,
  64. size_t circular_buffer_size,
  65. int descramble,
  66. struct timespec timeout);
  67. int (&#x22C6;start_filtering) (struct dmx_ts_feed_s&#x22C6; feed);
  68. int (&#x22C6;stop_filtering) (struct dmx_ts_feed_s&#x22C6; feed);
  69. int (&#x22C6;set_type) (struct dmx_ts_feed_s&#x22C6; feed,
  70. int type,
  71. dmx_ts_pes_t pes_type);
  72. };
  73. typedef struct dmx_ts_feed_s dmx_ts_feed_t;
  74. </programlisting>
  75. <programlisting>
  76. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  77. /&#x22C6; PES packet reception (not supported yet) &#x22C6;/
  78. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  79. typedef struct dmx_pes_filter_s {
  80. struct dmx_pes_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
  81. void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
  82. } dmx_pes_filter_t;
  83. </programlisting>
  84. <programlisting>
  85. typedef struct dmx_pes_feed_s {
  86. int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
  87. struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
  88. void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
  89. int (&#x22C6;set) (struct dmx_pes_feed_s&#x22C6; feed,
  90. __u16 pid,
  91. size_t circular_buffer_size,
  92. int descramble,
  93. struct timespec timeout);
  94. int (&#x22C6;start_filtering) (struct dmx_pes_feed_s&#x22C6; feed);
  95. int (&#x22C6;stop_filtering) (struct dmx_pes_feed_s&#x22C6; feed);
  96. int (&#x22C6;allocate_filter) (struct dmx_pes_feed_s&#x22C6; feed,
  97. dmx_pes_filter_t&#x22C6;&#x22C6; filter);
  98. int (&#x22C6;release_filter) (struct dmx_pes_feed_s&#x22C6; feed,
  99. dmx_pes_filter_t&#x22C6; filter);
  100. } dmx_pes_feed_t;
  101. </programlisting>
  102. <programlisting>
  103. typedef struct {
  104. __u8 filter_value [DMX_MAX_FILTER_SIZE];
  105. __u8 filter_mask [DMX_MAX_FILTER_SIZE];
  106. struct dmx_section_feed_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
  107. void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
  108. } dmx_section_filter_t;
  109. </programlisting>
  110. <programlisting>
  111. struct dmx_section_feed_s {
  112. int is_filtering; /&#x22C6; Set to non-zero when filtering in progress &#x22C6;/
  113. struct dmx_demux_s&#x22C6; parent; /&#x22C6; Back-pointer &#x22C6;/
  114. void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
  115. int (&#x22C6;set) (struct dmx_section_feed_s&#x22C6; feed,
  116. __u16 pid,
  117. size_t circular_buffer_size,
  118. int descramble,
  119. int check_crc);
  120. int (&#x22C6;allocate_filter) (struct dmx_section_feed_s&#x22C6; feed,
  121. dmx_section_filter_t&#x22C6;&#x22C6; filter);
  122. int (&#x22C6;release_filter) (struct dmx_section_feed_s&#x22C6; feed,
  123. dmx_section_filter_t&#x22C6; filter);
  124. int (&#x22C6;start_filtering) (struct dmx_section_feed_s&#x22C6; feed);
  125. int (&#x22C6;stop_filtering) (struct dmx_section_feed_s&#x22C6; feed);
  126. };
  127. typedef struct dmx_section_feed_s dmx_section_feed_t;
  128. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  129. /&#x22C6; Callback functions &#x22C6;/
  130. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  131. typedef int (&#x22C6;dmx_ts_cb) ( __u8 &#x22C6; buffer1,
  132. size_t buffer1_length,
  133. __u8 &#x22C6; buffer2,
  134. size_t buffer2_length,
  135. dmx_ts_feed_t&#x22C6; source,
  136. dmx_success_t success);
  137. typedef int (&#x22C6;dmx_section_cb) ( __u8 &#x22C6; buffer1,
  138. size_t buffer1_len,
  139. __u8 &#x22C6; buffer2,
  140. size_t buffer2_len,
  141. dmx_section_filter_t &#x22C6; source,
  142. dmx_success_t success);
  143. typedef int (&#x22C6;dmx_pes_cb) ( __u8 &#x22C6; buffer1,
  144. size_t buffer1_len,
  145. __u8 &#x22C6; buffer2,
  146. size_t buffer2_len,
  147. dmx_pes_filter_t&#x22C6; source,
  148. dmx_success_t success);
  149. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  150. /&#x22C6; DVB Front-End &#x22C6;/
  151. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  152. typedef enum {
  153. DMX_OTHER_FE = 0,
  154. DMX_SATELLITE_FE,
  155. DMX_CABLE_FE,
  156. DMX_TERRESTRIAL_FE,
  157. DMX_LVDS_FE,
  158. DMX_ASI_FE, /&#x22C6; DVB-ASI interface &#x22C6;/
  159. DMX_MEMORY_FE
  160. } dmx_frontend_source_t;
  161. typedef struct {
  162. /&#x22C6; The following char&#x22C6; fields point to NULL terminated strings &#x22C6;/
  163. char&#x22C6; id; /&#x22C6; Unique front-end identifier &#x22C6;/
  164. char&#x22C6; vendor; /&#x22C6; Name of the front-end vendor &#x22C6;/
  165. char&#x22C6; model; /&#x22C6; Name of the front-end model &#x22C6;/
  166. struct list_head connectivity_list; /&#x22C6; List of front-ends that can
  167. be connected to a particular
  168. demux &#x22C6;/
  169. void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
  170. dmx_frontend_source_t source;
  171. } dmx_frontend_t;
  172. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  173. /&#x22C6; MPEG-2 TS Demux &#x22C6;/
  174. /&#x22C6;--------------------------------------------------------------------------&#x22C6;/
  175. /&#x22C6;
  176. &#x22C6; Flags OR'ed in the capabilites field of struct dmx_demux_s.
  177. &#x22C6;/
  178. #define DMX_TS_FILTERING 1
  179. #define DMX_PES_FILTERING 2
  180. #define DMX_SECTION_FILTERING 4
  181. #define DMX_MEMORY_BASED_FILTERING 8 /&#x22C6; write() available &#x22C6;/
  182. #define DMX_CRC_CHECKING 16
  183. #define DMX_TS_DESCRAMBLING 32
  184. #define DMX_SECTION_PAYLOAD_DESCRAMBLING 64
  185. #define DMX_MAC_ADDRESS_DESCRAMBLING 128
  186. </programlisting>
  187. </section>
  188. <section id="demux_demux_t">
  189. <title>demux_demux_t</title>
  190. <programlisting>
  191. /&#x22C6;
  192. &#x22C6; DMX_FE_ENTRY(): Casts elements in the list of registered
  193. &#x22C6; front-ends from the generic type struct list_head
  194. &#x22C6; to the type &#x22C6; dmx_frontend_t
  195. &#x22C6;.
  196. &#x22C6;/
  197. #define DMX_FE_ENTRY(list) list_entry(list, dmx_frontend_t, connectivity_list)
  198. struct dmx_demux_s {
  199. /&#x22C6; The following char&#x22C6; fields point to NULL terminated strings &#x22C6;/
  200. char&#x22C6; id; /&#x22C6; Unique demux identifier &#x22C6;/
  201. char&#x22C6; vendor; /&#x22C6; Name of the demux vendor &#x22C6;/
  202. char&#x22C6; model; /&#x22C6; Name of the demux model &#x22C6;/
  203. __u32 capabilities; /&#x22C6; Bitfield of capability flags &#x22C6;/
  204. dmx_frontend_t&#x22C6; frontend; /&#x22C6; Front-end connected to the demux &#x22C6;/
  205. struct list_head reg_list; /&#x22C6; List of registered demuxes &#x22C6;/
  206. void&#x22C6; priv; /&#x22C6; Pointer to private data of the API client &#x22C6;/
  207. int users; /&#x22C6; Number of users &#x22C6;/
  208. int (&#x22C6;open) (struct dmx_demux_s&#x22C6; demux);
  209. int (&#x22C6;close) (struct dmx_demux_s&#x22C6; demux);
  210. int (&#x22C6;write) (struct dmx_demux_s&#x22C6; demux, const char&#x22C6; buf, size_t count);
  211. int (&#x22C6;allocate_ts_feed) (struct dmx_demux_s&#x22C6; demux,
  212. dmx_ts_feed_t&#x22C6;&#x22C6; feed,
  213. dmx_ts_cb callback);
  214. int (&#x22C6;release_ts_feed) (struct dmx_demux_s&#x22C6; demux,
  215. dmx_ts_feed_t&#x22C6; feed);
  216. int (&#x22C6;allocate_pes_feed) (struct dmx_demux_s&#x22C6; demux,
  217. dmx_pes_feed_t&#x22C6;&#x22C6; feed,
  218. dmx_pes_cb callback);
  219. int (&#x22C6;release_pes_feed) (struct dmx_demux_s&#x22C6; demux,
  220. dmx_pes_feed_t&#x22C6; feed);
  221. int (&#x22C6;allocate_section_feed) (struct dmx_demux_s&#x22C6; demux,
  222. dmx_section_feed_t&#x22C6;&#x22C6; feed,
  223. dmx_section_cb callback);
  224. int (&#x22C6;release_section_feed) (struct dmx_demux_s&#x22C6; demux,
  225. dmx_section_feed_t&#x22C6; feed);
  226. int (&#x22C6;descramble_mac_address) (struct dmx_demux_s&#x22C6; demux,
  227. __u8&#x22C6; buffer1,
  228. size_t buffer1_length,
  229. __u8&#x22C6; buffer2,
  230. size_t buffer2_length,
  231. __u16 pid);
  232. int (&#x22C6;descramble_section_payload) (struct dmx_demux_s&#x22C6; demux,
  233. __u8&#x22C6; buffer1,
  234. size_t buffer1_length,
  235. __u8&#x22C6; buffer2, size_t buffer2_length,
  236. __u16 pid);
  237. int (&#x22C6;add_frontend) (struct dmx_demux_s&#x22C6; demux,
  238. dmx_frontend_t&#x22C6; frontend);
  239. int (&#x22C6;remove_frontend) (struct dmx_demux_s&#x22C6; demux,
  240. dmx_frontend_t&#x22C6; frontend);
  241. struct list_head&#x22C6; (&#x22C6;get_frontends) (struct dmx_demux_s&#x22C6; demux);
  242. int (&#x22C6;connect_frontend) (struct dmx_demux_s&#x22C6; demux,
  243. dmx_frontend_t&#x22C6; frontend);
  244. int (&#x22C6;disconnect_frontend) (struct dmx_demux_s&#x22C6; demux);
  245. /&#x22C6; added because js cannot keep track of these himself &#x22C6;/
  246. int (&#x22C6;get_pes_pids) (struct dmx_demux_s&#x22C6; demux, __u16 &#x22C6;pids);
  247. };
  248. typedef struct dmx_demux_s dmx_demux_t;
  249. </programlisting>
  250. </section>
  251. <section id="demux_directory">
  252. <title>Demux directory</title>
  253. <programlisting>
  254. /&#x22C6;
  255. &#x22C6; DMX_DIR_ENTRY(): Casts elements in the list of registered
  256. &#x22C6; demuxes from the generic type struct list_head&#x22C6; to the type dmx_demux_t
  257. &#x22C6;.
  258. &#x22C6;/
  259. #define DMX_DIR_ENTRY(list) list_entry(list, dmx_demux_t, reg_list)
  260. int dmx_register_demux (dmx_demux_t&#x22C6; demux);
  261. int dmx_unregister_demux (dmx_demux_t&#x22C6; demux);
  262. struct list_head&#x22C6; dmx_get_demuxes (void);
  263. </programlisting>
  264. </section></section>
  265. <section id="demux_directory_api">
  266. <title>Demux Directory API</title>
  267. <para>The demux directory is a Linux kernel-wide facility for registering and accessing the
  268. MPEG-2 TS demuxes in the system. Run-time registering and unregistering of demux drivers
  269. is possible using this API.
  270. </para>
  271. <para>All demux drivers in the directory implement the abstract interface dmx_demux_t.
  272. </para>
  273. <section
  274. role="subsection"><title>dmx_register_demux()</title>
  275. <para>DESCRIPTION
  276. </para>
  277. <informaltable><tgroup cols="1"><tbody><row><entry
  278. align="char">
  279. <para>This function makes a demux driver interface available to the Linux kernel. It is
  280. usually called by the init_module() function of the kernel module that contains
  281. the demux driver. The caller of this function is responsible for allocating
  282. dynamic or static memory for the demux structure and for initializing its fields
  283. before calling this function. The memory allocated for the demux structure
  284. must not be freed before calling dmx_unregister_demux(),</para>
  285. </entry>
  286. </row></tbody></tgroup></informaltable>
  287. <para>SYNOPSIS
  288. </para>
  289. <informaltable><tgroup cols="1"><tbody><row><entry
  290. align="char">
  291. <para>int dmx_register_demux ( dmx_demux_t &#x22C6;demux )</para>
  292. </entry>
  293. </row></tbody></tgroup></informaltable>
  294. <para>PARAMETERS
  295. </para>
  296. <informaltable><tgroup cols="2"><tbody><row><entry
  297. align="char">
  298. <para>dmx_demux_t*
  299. demux</para>
  300. </entry><entry
  301. align="char">
  302. <para>Pointer to the demux structure.</para>
  303. </entry>
  304. </row></tbody></tgroup></informaltable>
  305. <para>RETURNS
  306. </para>
  307. <informaltable><tgroup cols="2"><tbody><row><entry
  308. align="char">
  309. <para>0</para>
  310. </entry><entry
  311. align="char">
  312. <para>The function was completed without errors.</para>
  313. </entry>
  314. </row><row><entry
  315. align="char">
  316. <para>-EEXIST</para>
  317. </entry><entry
  318. align="char">
  319. <para>A demux with the same value of the id field already stored
  320. in the directory.</para>
  321. </entry>
  322. </row><row><entry
  323. align="char">
  324. <para>-ENOSPC</para>
  325. </entry><entry
  326. align="char">
  327. <para>No space left in the directory.</para>
  328. </entry>
  329. </row></tbody></tgroup></informaltable>
  330. </section><section
  331. role="subsection"><title>dmx_unregister_demux()</title>
  332. <para>DESCRIPTION
  333. </para>
  334. <informaltable><tgroup cols="1"><tbody><row><entry
  335. align="char">
  336. <para>This function is called to indicate that the given demux interface is no
  337. longer available. The caller of this function is responsible for freeing the
  338. memory of the demux structure, if it was dynamically allocated before calling
  339. dmx_register_demux(). The cleanup_module() function of the kernel module
  340. that contains the demux driver should call this function. Note that this function
  341. fails if the demux is currently in use, i.e., release_demux() has not been called
  342. for the interface.</para>
  343. </entry>
  344. </row></tbody></tgroup></informaltable>
  345. <para>SYNOPSIS
  346. </para>
  347. <informaltable><tgroup cols="1"><tbody><row><entry
  348. align="char">
  349. <para>int dmx_unregister_demux ( dmx_demux_t &#x22C6;demux )</para>
  350. </entry>
  351. </row></tbody></tgroup></informaltable>
  352. <para>PARAMETERS
  353. </para>
  354. <informaltable><tgroup cols="2"><tbody><row><entry
  355. align="char">
  356. <para>dmx_demux_t*
  357. demux</para>
  358. </entry><entry
  359. align="char">
  360. <para>Pointer to the demux structure which is to be
  361. unregistered.</para>
  362. </entry>
  363. </row></tbody></tgroup></informaltable>
  364. <para>RETURNS
  365. </para>
  366. <informaltable><tgroup cols="2"><tbody><row><entry
  367. align="char">
  368. <para>0</para>
  369. </entry><entry
  370. align="char">
  371. <para>The function was completed without errors.</para>
  372. </entry>
  373. </row><row><entry
  374. align="char">
  375. <para>ENODEV</para>
  376. </entry><entry
  377. align="char">
  378. <para>The specified demux is not registered in the demux
  379. directory.</para>
  380. </entry>
  381. </row><row><entry
  382. align="char">
  383. <para>EBUSY</para>
  384. </entry><entry
  385. align="char">
  386. <para>The specified demux is currently in use.</para>
  387. </entry>
  388. </row></tbody></tgroup></informaltable>
  389. </section><section
  390. role="subsection"><title>dmx_get_demuxes()</title>
  391. <para>DESCRIPTION
  392. </para>
  393. <informaltable><tgroup cols="1"><tbody><row><entry
  394. align="char">
  395. <para>Provides the caller with the list of registered demux interfaces, using the
  396. standard list structure defined in the include file linux/list.h. The include file
  397. demux.h defines the macro DMX_DIR_ENTRY() for converting an element of
  398. the generic type struct list_head* to the type dmx_demux_t*. The caller must
  399. not free the memory of any of the elements obtained via this function call.</para>
  400. </entry>
  401. </row></tbody></tgroup></informaltable>
  402. <para>SYNOPSIS
  403. </para>
  404. <informaltable><tgroup cols="1"><tbody><row><entry
  405. align="char">
  406. <para>struct list_head &#x22C6;dmx_get_demuxes ()</para>
  407. </entry>
  408. </row></tbody></tgroup></informaltable>
  409. <para>PARAMETERS
  410. </para>
  411. <informaltable><tgroup cols="2"><tbody><row><entry
  412. align="char">
  413. <para>none</para>
  414. </entry>
  415. </row></tbody></tgroup></informaltable>
  416. <para>RETURNS
  417. </para>
  418. <informaltable><tgroup cols="2"><tbody><row><entry
  419. align="char">
  420. <para>struct list_head *</para>
  421. </entry><entry
  422. align="char">
  423. <para>A list of demux interfaces, or NULL in the case of an
  424. empty list.</para>
  425. </entry>
  426. </row></tbody></tgroup></informaltable>
  427. </section></section>
  428. <section id="demux_api">
  429. <title>Demux API</title>
  430. <para>The demux API should be implemented for each demux in the system. It is used to select
  431. the TS source of a demux and to manage the demux resources. When the demux
  432. client allocates a resource via the demux API, it receives a pointer to the API of that
  433. resource.
  434. </para>
  435. <para>Each demux receives its TS input from a DVB front-end or from memory, as set via the
  436. demux API. In a system with more than one front-end, the API can be used to select one of
  437. the DVB front-ends as a TS source for a demux, unless this is fixed in the HW platform. The
  438. demux API only controls front-ends regarding their connections with demuxes; the APIs
  439. used to set the other front-end parameters, such as tuning, are not defined in this
  440. document.
  441. </para>
  442. <para>The functions that implement the abstract interface demux should be defined static or
  443. module private and registered to the Demux Directory for external access. It is not necessary
  444. to implement every function in the demux_t struct, however (for example, a demux interface
  445. might support Section filtering, but not TS or PES filtering). The API client is expected to
  446. check the value of any function pointer before calling the function: the value of NULL means
  447. &#8220;function not available&#8221;.
  448. </para>
  449. <para>Whenever the functions of the demux API modify shared data, the possibilities of lost
  450. update and race condition problems should be addressed, e.g. by protecting parts of code with
  451. mutexes. This is especially important on multi-processor hosts.
  452. </para>
  453. <para>Note that functions called from a bottom half context must not sleep, at least in the 2.2.x
  454. kernels. Even a simple memory allocation can result in a kernel thread being put to sleep if
  455. swapping is needed. For example, the Linux kernel calls the functions of a network device
  456. interface from a bottom half context. Thus, if a demux API function is called from network
  457. device code, the function must not sleep.
  458. </para>
  459. <section id="kdapi_fopen">
  460. <title>open()</title>
  461. <para>DESCRIPTION
  462. </para>
  463. <informaltable><tgroup cols="1"><tbody><row><entry
  464. align="char">
  465. <para>This function reserves the demux for use by the caller and, if necessary,
  466. initializes the demux. When the demux is no longer needed, the function close()
  467. should be called. It should be possible for multiple clients to access the demux
  468. at the same time. Thus, the function implementation should increment the
  469. demux usage count when open() is called and decrement it when close() is
  470. called.</para>
  471. </entry>
  472. </row></tbody></tgroup></informaltable>
  473. <para>SYNOPSIS
  474. </para>
  475. <informaltable><tgroup cols="1"><tbody><row><entry
  476. align="char">
  477. <para>int open ( demux_t&#x22C6; demux );</para>
  478. </entry>
  479. </row></tbody></tgroup></informaltable>
  480. <para>PARAMETERS
  481. </para>
  482. <informaltable><tgroup cols="2"><tbody><row><entry
  483. align="char">
  484. <para>demux_t* demux</para>
  485. </entry><entry
  486. align="char">
  487. <para>Pointer to the demux API and instance data.</para>
  488. </entry>
  489. </row></tbody></tgroup></informaltable>
  490. <para>RETURNS
  491. </para>
  492. <informaltable><tgroup cols="2"><tbody><row><entry
  493. align="char">
  494. <para>0</para>
  495. </entry><entry
  496. align="char">
  497. <para>The function was completed without errors.</para>
  498. </entry>
  499. </row><row><entry
  500. align="char">
  501. <para>-EUSERS</para>
  502. </entry><entry
  503. align="char">
  504. <para>Maximum usage count reached.</para>
  505. </entry>
  506. </row><row><entry
  507. align="char">
  508. <para>-EINVAL</para>
  509. </entry><entry
  510. align="char">
  511. <para>Bad parameter.</para>
  512. </entry>
  513. </row></tbody></tgroup></informaltable>
  514. </section>
  515. <section id="kdapi_fclose">
  516. <title>close()</title>
  517. <para>DESCRIPTION
  518. </para>
  519. <informaltable><tgroup cols="1"><tbody><row><entry
  520. align="char">
  521. <para>This function reserves the demux for use by the caller and, if necessary,
  522. initializes the demux. When the demux is no longer needed, the function close()
  523. should be called. It should be possible for multiple clients to access the demux
  524. at the same time. Thus, the function implementation should increment the
  525. demux usage count when open() is called and decrement it when close() is
  526. called.</para>
  527. </entry>
  528. </row></tbody></tgroup></informaltable>
  529. <para>SYNOPSIS
  530. </para>
  531. <informaltable><tgroup cols="1"><tbody><row><entry
  532. align="char">
  533. <para>int close(demux_t&#x22C6; demux);</para>
  534. </entry>
  535. </row></tbody></tgroup></informaltable>
  536. <para>PARAMETERS
  537. </para>
  538. <informaltable><tgroup cols="2"><tbody><row><entry
  539. align="char">
  540. <para>demux_t* demux</para>
  541. </entry><entry
  542. align="char">
  543. <para>Pointer to the demux API and instance data.</para>
  544. </entry>
  545. </row></tbody></tgroup></informaltable>
  546. <para>RETURNS
  547. </para>
  548. <informaltable><tgroup cols="2"><tbody><row><entry
  549. align="char">
  550. <para>0</para>
  551. </entry><entry
  552. align="char">
  553. <para>The function was completed without errors.</para>
  554. </entry>
  555. </row><row><entry
  556. align="char">
  557. <para>-ENODEV</para>
  558. </entry><entry
  559. align="char">
  560. <para>The demux was not in use.</para>
  561. </entry>
  562. </row><row><entry
  563. align="char">
  564. <para>-EINVAL</para>
  565. </entry><entry
  566. align="char">
  567. <para>Bad parameter.</para>
  568. </entry>
  569. </row></tbody></tgroup></informaltable>
  570. </section>
  571. <section id="kdapi_fwrite">
  572. <title>write()</title>
  573. <para>DESCRIPTION
  574. </para>
  575. <informaltable><tgroup cols="1"><tbody><row><entry
  576. align="char">
  577. <para>This function provides the demux driver with a memory buffer containing TS
  578. packets. Instead of receiving TS packets from the DVB front-end, the demux
  579. driver software will read packets from memory. Any clients of this demux
  580. with active TS, PES or Section filters will receive filtered data via the Demux
  581. callback API (see 0). The function returns when all the data in the buffer has
  582. been consumed by the demux. Demux hardware typically cannot read TS from
  583. memory. If this is the case, memory-based filtering has to be implemented
  584. entirely in software.</para>
  585. </entry>
  586. </row></tbody></tgroup></informaltable>
  587. <para>SYNOPSIS
  588. </para>
  589. <informaltable><tgroup cols="1"><tbody><row><entry
  590. align="char">
  591. <para>int write(demux_t&#x22C6; demux, const char&#x22C6; buf, size_t
  592. count);</para>
  593. </entry>
  594. </row></tbody></tgroup></informaltable>
  595. <para>PARAMETERS
  596. </para>
  597. <informaltable><tgroup cols="2"><tbody><row><entry
  598. align="char">
  599. <para>demux_t* demux</para>
  600. </entry><entry
  601. align="char">
  602. <para>Pointer to the demux API and instance data.</para>
  603. </entry>
  604. </row><row><entry
  605. align="char">
  606. <para>const char* buf</para>
  607. </entry><entry
  608. align="char">
  609. <para>Pointer to the TS data in kernel-space memory.</para>
  610. </entry>
  611. </row><row><entry
  612. align="char">
  613. <para>size_t length</para>
  614. </entry><entry
  615. align="char">
  616. <para>Length of the TS data.</para>
  617. </entry>
  618. </row></tbody></tgroup></informaltable>
  619. <para>RETURNS
  620. </para>
  621. <informaltable><tgroup cols="2"><tbody><row><entry
  622. align="char">
  623. <para>0</para>
  624. </entry><entry
  625. align="char">
  626. <para>The function was completed without errors.</para>
  627. </entry>
  628. </row><row><entry
  629. align="char">
  630. <para>-ENOSYS</para>
  631. </entry><entry
  632. align="char">
  633. <para>The command is not implemented.</para>
  634. </entry>
  635. </row><row><entry
  636. align="char">
  637. <para>-EINVAL</para>
  638. </entry><entry
  639. align="char">
  640. <para>Bad parameter.</para>
  641. </entry>
  642. </row></tbody></tgroup></informaltable>
  643. </section><section
  644. role="subsection"><title>allocate_ts_feed()</title>
  645. <para>DESCRIPTION
  646. </para>
  647. <informaltable><tgroup cols="1"><tbody><row><entry
  648. align="char">
  649. <para>Allocates a new TS feed, which is used to filter the TS packets carrying a
  650. certain PID. The TS feed normally corresponds to a hardware PID filter on the
  651. demux chip.</para>
  652. </entry>
  653. </row></tbody></tgroup></informaltable>
  654. <para>SYNOPSIS
  655. </para>
  656. <informaltable><tgroup cols="1"><tbody><row><entry
  657. align="char">
  658. <para>int allocate_ts_feed(dmx_demux_t&#x22C6; demux,
  659. dmx_ts_feed_t&#x22C6;&#x22C6; feed, dmx_ts_cb callback);</para>
  660. </entry>
  661. </row></tbody></tgroup></informaltable>
  662. <para>PARAMETERS
  663. </para>
  664. <informaltable><tgroup cols="2"><tbody><row><entry
  665. align="char">
  666. <para>demux_t* demux</para>
  667. </entry><entry
  668. align="char">
  669. <para>Pointer to the demux API and instance data.</para>
  670. </entry>
  671. </row><row><entry
  672. align="char">
  673. <para>dmx_ts_feed_t**
  674. feed</para>
  675. </entry><entry
  676. align="char">
  677. <para>Pointer to the TS feed API and instance data.</para>
  678. </entry>
  679. </row><row><entry
  680. align="char">
  681. <para>dmx_ts_cb callback</para>
  682. </entry><entry
  683. align="char">
  684. <para>Pointer to the callback function for passing received TS
  685. packet</para>
  686. </entry>
  687. </row></tbody></tgroup></informaltable>
  688. <para>RETURNS
  689. </para>
  690. <informaltable><tgroup cols="2"><tbody><row><entry
  691. align="char">
  692. <para>0</para>
  693. </entry><entry
  694. align="char">
  695. <para>The function was completed without errors.</para>
  696. </entry>
  697. </row><row><entry
  698. align="char">
  699. <para>-EBUSY</para>
  700. </entry><entry
  701. align="char">
  702. <para>No more TS feeds available.</para>
  703. </entry>
  704. </row><row><entry
  705. align="char">
  706. <para>-ENOSYS</para>
  707. </entry><entry
  708. align="char">
  709. <para>The command is not implemented.</para>
  710. </entry>
  711. </row><row><entry
  712. align="char">
  713. <para>-EINVAL</para>
  714. </entry><entry
  715. align="char">
  716. <para>Bad parameter.</para>
  717. </entry>
  718. </row></tbody></tgroup></informaltable>
  719. </section><section
  720. role="subsection"><title>release_ts_feed()</title>
  721. <para>DESCRIPTION
  722. </para>
  723. <informaltable><tgroup cols="1"><tbody><row><entry
  724. align="char">
  725. <para>Releases the resources allocated with allocate_ts_feed(). Any filtering in
  726. progress on the TS feed should be stopped before calling this function.</para>
  727. </entry>
  728. </row></tbody></tgroup></informaltable>
  729. <para>SYNOPSIS
  730. </para>
  731. <informaltable><tgroup cols="1"><tbody><row><entry
  732. align="char">
  733. <para>int release_ts_feed(dmx_demux_t&#x22C6; demux,
  734. dmx_ts_feed_t&#x22C6; feed);</para>
  735. </entry>
  736. </row></tbody></tgroup></informaltable>
  737. <para>PARAMETERS
  738. </para>
  739. <informaltable><tgroup cols="2"><tbody><row><entry
  740. align="char">
  741. <para>demux_t* demux</para>
  742. </entry><entry
  743. align="char">
  744. <para>Pointer to the demux API and instance data.</para>
  745. </entry>
  746. </row><row><entry
  747. align="char">
  748. <para>dmx_ts_feed_t* feed</para>
  749. </entry><entry
  750. align="char">
  751. <para>Pointer to the TS feed API and instance data.</para>
  752. </entry>
  753. </row></tbody></tgroup></informaltable>
  754. <para>RETURNS
  755. </para>
  756. <informaltable><tgroup cols="2"><tbody><row><entry
  757. align="char">
  758. <para>0</para>
  759. </entry><entry
  760. align="char">
  761. <para>The function was completed without errors.</para>
  762. </entry>
  763. </row><row><entry
  764. align="char">
  765. <para>-EINVAL</para>
  766. </entry><entry
  767. align="char">
  768. <para>Bad parameter.</para>
  769. </entry>
  770. </row></tbody></tgroup></informaltable>
  771. </section><section
  772. role="subsection"><title>allocate_section_feed()</title>
  773. <para>DESCRIPTION
  774. </para>
  775. <informaltable><tgroup cols="1"><tbody><row><entry
  776. align="char">
  777. <para>Allocates a new section feed, i.e. a demux resource for filtering and receiving
  778. sections. On platforms with hardware support for section filtering, a section
  779. feed is directly mapped to the demux HW. On other platforms, TS packets are
  780. first PID filtered in hardware and a hardware section filter then emulated in
  781. software. The caller obtains an API pointer of type dmx_section_feed_t as an
  782. out parameter. Using this API the caller can set filtering parameters and start
  783. receiving sections.</para>
  784. </entry>
  785. </row></tbody></tgroup></informaltable>
  786. <para>SYNOPSIS
  787. </para>
  788. <informaltable><tgroup cols="1"><tbody><row><entry
  789. align="char">
  790. <para>int allocate_section_feed(dmx_demux_t&#x22C6; demux,
  791. dmx_section_feed_t &#x22C6;&#x22C6;feed, dmx_section_cb callback);</para>
  792. </entry>
  793. </row></tbody></tgroup></informaltable>
  794. <para>PARAMETERS
  795. </para>
  796. <informaltable><tgroup cols="2"><tbody><row><entry
  797. align="char">
  798. <para>demux_t *demux</para>
  799. </entry><entry
  800. align="char">
  801. <para>Pointer to the demux API and instance data.</para>
  802. </entry>
  803. </row><row><entry
  804. align="char">
  805. <para>dmx_section_feed_t
  806. **feed</para>
  807. </entry><entry
  808. align="char">
  809. <para>Pointer to the section feed API and instance data.</para>
  810. </entry>
  811. </row><row><entry
  812. align="char">
  813. <para>dmx_section_cb
  814. callback</para>
  815. </entry><entry
  816. align="char">
  817. <para>Pointer to the callback function for passing received
  818. sections.</para>
  819. </entry>
  820. </row></tbody></tgroup></informaltable>
  821. <para>RETURNS
  822. </para>
  823. <informaltable><tgroup cols="2"><tbody><row><entry
  824. align="char">
  825. <para>0</para>
  826. </entry><entry
  827. align="char">
  828. <para>The function was completed without errors.</para>
  829. </entry>
  830. </row><row><entry
  831. align="char">
  832. <para>-EBUSY</para>
  833. </entry><entry
  834. align="char">
  835. <para>No more section feeds available.</para>
  836. </entry>
  837. </row><row><entry
  838. align="char">
  839. <para>-ENOSYS</para>
  840. </entry><entry
  841. align="char">
  842. <para>The command is not implemented.</para>
  843. </entry>
  844. </row><row><entry
  845. align="char">
  846. <para>-EINVAL</para>
  847. </entry><entry
  848. align="char">
  849. <para>Bad parameter.</para>
  850. </entry>
  851. </row></tbody></tgroup></informaltable>
  852. </section><section
  853. role="subsection"><title>release_section_feed()</title>
  854. <para>DESCRIPTION
  855. </para>
  856. <informaltable><tgroup cols="1"><tbody><row><entry
  857. align="char">
  858. <para>Releases the resources allocated with allocate_section_feed(), including
  859. allocated filters. Any filtering in progress on the section feed should be stopped
  860. before calling this function.</para>
  861. </entry>
  862. </row></tbody></tgroup></informaltable>
  863. <para>SYNOPSIS
  864. </para>
  865. <informaltable><tgroup cols="1"><tbody><row><entry
  866. align="char">
  867. <para>int release_section_feed(dmx_demux_t&#x22C6; demux,
  868. dmx_section_feed_t &#x22C6;feed);</para>
  869. </entry>
  870. </row></tbody></tgroup></informaltable>
  871. <para>PARAMETERS
  872. </para>
  873. <informaltable><tgroup cols="2"><tbody><row><entry
  874. align="char">
  875. <para>demux_t *demux</para>
  876. </entry><entry
  877. align="char">
  878. <para>Pointer to the demux API and instance data.</para>
  879. </entry>
  880. </row><row><entry
  881. align="char">
  882. <para>dmx_section_feed_t
  883. *feed</para>
  884. </entry><entry
  885. align="char">
  886. <para>Pointer to the section feed API and instance data.</para>
  887. </entry>
  888. </row></tbody></tgroup></informaltable>
  889. <para>RETURNS
  890. </para>
  891. <informaltable><tgroup cols="2"><tbody><row><entry
  892. align="char">
  893. <para>0</para>
  894. </entry><entry
  895. align="char">
  896. <para>The function was completed without errors.</para>
  897. </entry>
  898. </row><row><entry
  899. align="char">
  900. <para>-EINVAL</para>
  901. </entry><entry
  902. align="char">
  903. <para>Bad parameter.</para>
  904. </entry>
  905. </row></tbody></tgroup></informaltable>
  906. </section><section
  907. role="subsection"><title>descramble_mac_address()</title>
  908. <para>DESCRIPTION
  909. </para>
  910. <informaltable><tgroup cols="1"><tbody><row><entry
  911. align="char">
  912. <para>This function runs a descrambling algorithm on the destination MAC
  913. address field of a DVB Datagram Section, replacing the original address
  914. with its un-encrypted version. Otherwise, the description on the function
  915. descramble_section_payload() applies also to this function.</para>
  916. </entry>
  917. </row></tbody></tgroup></informaltable>
  918. <para>SYNOPSIS
  919. </para>
  920. <informaltable><tgroup cols="1"><tbody><row><entry
  921. align="char">
  922. <para>int descramble_mac_address(dmx_demux_t&#x22C6; demux, __u8
  923. &#x22C6;buffer1, size_t buffer1_length, __u8 &#x22C6;buffer2,
  924. size_t buffer2_length, __u16 pid);</para>
  925. </entry>
  926. </row></tbody></tgroup></informaltable>
  927. <para>PARAMETERS
  928. </para>
  929. <informaltable><tgroup cols="2"><tbody><row><entry
  930. align="char">
  931. <para>dmx_demux_t
  932. *demux</para>
  933. </entry><entry
  934. align="char">
  935. <para>Pointer to the demux API and instance data.</para>
  936. </entry>
  937. </row><row><entry
  938. align="char">
  939. <para>__u8 *buffer1</para>
  940. </entry><entry
  941. align="char">
  942. <para>Pointer to the first byte of the section.</para>
  943. </entry>
  944. </row><row><entry
  945. align="char">
  946. <para>size_t buffer1_length</para>
  947. </entry><entry
  948. align="char">
  949. <para>Length of the section data, including headers and CRC,
  950. in buffer1.</para>
  951. </entry>
  952. </row><row><entry
  953. align="char">
  954. <para>__u8* buffer2</para>
  955. </entry><entry
  956. align="char">
  957. <para>Pointer to the tail of the section data, or NULL. The
  958. pointer has a non-NULL value if the section wraps past
  959. the end of a circular buffer.</para>
  960. </entry>
  961. </row><row><entry
  962. align="char">
  963. <para>size_t buffer2_length</para>
  964. </entry><entry
  965. align="char">
  966. <para>Length of the section data, including headers and CRC,
  967. in buffer2.</para>
  968. </entry>
  969. </row><row><entry
  970. align="char">
  971. <para>__u16 pid</para>
  972. </entry><entry
  973. align="char">
  974. <para>The PID on which the section was received. Useful
  975. for obtaining the descrambling key, e.g. from a DVB
  976. Common Access facility.</para>
  977. </entry>
  978. </row></tbody></tgroup></informaltable>
  979. <para>RETURNS
  980. </para>
  981. <informaltable><tgroup cols="2"><tbody><row><entry
  982. align="char">
  983. <para>0</para>
  984. </entry><entry
  985. align="char">
  986. <para>The function was completed without errors.</para>
  987. </entry>
  988. </row><row><entry
  989. align="char">
  990. <para>-ENOSYS</para>
  991. </entry><entry
  992. align="char">
  993. <para>No descrambling facility available.</para>
  994. </entry>
  995. </row><row><entry
  996. align="char">
  997. <para>-EINVAL</para>
  998. </entry><entry
  999. align="char">
  1000. <para>Bad parameter.</para>
  1001. </entry>
  1002. </row></tbody></tgroup></informaltable>
  1003. </section><section
  1004. role="subsection"><title>descramble_section_payload()</title>
  1005. <para>DESCRIPTION
  1006. </para>
  1007. <informaltable><tgroup cols="1"><tbody><row><entry
  1008. align="char">
  1009. <para>This function runs a descrambling algorithm on the payload of a DVB
  1010. Datagram Section, replacing the original payload with its un-encrypted
  1011. version. The function will be called from the demux API implementation;
  1012. the API client need not call this function directly. Section-level scrambling
  1013. algorithms are currently standardized only for DVB-RCC (return channel
  1014. over 2-directional cable TV network) systems. For all other DVB networks,
  1015. encryption schemes are likely to be proprietary to each data broadcaster. Thus,
  1016. it is expected that this function pointer will have the value of NULL (i.e.,
  1017. function not available) in most demux API implementations. Nevertheless, it
  1018. should be possible to use the function pointer as a hook for dynamically adding
  1019. a &#8220;plug-in&#8221; descrambling facility to a demux driver.</para>
  1020. </entry>
  1021. </row><row><entry
  1022. align="char">
  1023. <para>While this function is not needed with hardware-based section descrambling,
  1024. the descramble_section_payload function pointer can be used to override the
  1025. default hardware-based descrambling algorithm: if the function pointer has a
  1026. non-NULL value, the corresponding function should be used instead of any
  1027. descrambling hardware.</para>
  1028. </entry>
  1029. </row></tbody></tgroup></informaltable>
  1030. <para>SYNOPSIS
  1031. </para>
  1032. <informaltable><tgroup cols="1"><tbody><row><entry
  1033. align="char">
  1034. <para>int descramble_section_payload(dmx_demux_t&#x22C6; demux,
  1035. __u8 &#x22C6;buffer1, size_t buffer1_length, __u8 &#x22C6;buffer2,
  1036. size_t buffer2_length, __u16 pid);</para>
  1037. </entry>
  1038. </row></tbody></tgroup></informaltable>
  1039. <para>PARAMETERS
  1040. </para>
  1041. <informaltable><tgroup cols="2"><tbody><row><entry
  1042. align="char">
  1043. <para>dmx_demux_t
  1044. *demux</para>
  1045. </entry><entry
  1046. align="char">
  1047. <para>Pointer to the demux API and instance data.</para>
  1048. </entry>
  1049. </row><row><entry
  1050. align="char">
  1051. <para>__u8 *buffer1</para>
  1052. </entry><entry
  1053. align="char">
  1054. <para>Pointer to the first byte of the section.</para>
  1055. </entry>
  1056. </row><row><entry
  1057. align="char">
  1058. <para>size_t buffer1_length</para>
  1059. </entry><entry
  1060. align="char">
  1061. <para>Length of the section data, including headers and CRC,
  1062. in buffer1.</para>
  1063. </entry>
  1064. </row><row><entry
  1065. align="char">
  1066. <para>__u8 *buffer2</para>
  1067. </entry><entry
  1068. align="char">
  1069. <para>Pointer to the tail of the section data, or NULL. The
  1070. pointer has a non-NULL value if the section wraps past
  1071. the end of a circular buffer.</para>
  1072. </entry>
  1073. </row><row><entry
  1074. align="char">
  1075. <para>size_t buffer2_length</para>
  1076. </entry><entry
  1077. align="char">
  1078. <para>Length of the section data, including headers and CRC,
  1079. in buffer2.</para>
  1080. </entry>
  1081. </row><row><entry
  1082. align="char">
  1083. <para>__u16 pid</para>
  1084. </entry><entry
  1085. align="char">
  1086. <para>The PID on which the section was received. Useful
  1087. for obtaining the descrambling key, e.g. from a DVB
  1088. Common Access facility.</para>
  1089. </entry>
  1090. </row></tbody></tgroup></informaltable>
  1091. <para>RETURNS
  1092. </para>
  1093. <informaltable><tgroup cols="2"><tbody><row><entry
  1094. align="char">
  1095. <para>0</para>
  1096. </entry><entry
  1097. align="char">
  1098. <para>The function was completed without errors.</para>
  1099. </entry>
  1100. </row><row><entry
  1101. align="char">
  1102. <para>-ENOSYS</para>
  1103. </entry><entry
  1104. align="char">
  1105. <para>No descrambling facility available.</para>
  1106. </entry>
  1107. </row><row><entry
  1108. align="char">
  1109. <para>-EINVAL</para>
  1110. </entry><entry
  1111. align="char">
  1112. <para>Bad parameter.</para>
  1113. </entry>
  1114. </row></tbody></tgroup></informaltable>
  1115. </section><section
  1116. role="subsection"><title>add_frontend()</title>
  1117. <para>DESCRIPTION
  1118. </para>
  1119. <informaltable><tgroup cols="1"><tbody><row><entry
  1120. align="char">
  1121. <para>Registers a connectivity between a demux and a front-end, i.e., indicates that
  1122. the demux can be connected via a call to connect_frontend() to use the given
  1123. front-end as a TS source. The client of this function has to allocate dynamic or
  1124. static memory for the frontend structure and initialize its fields before calling
  1125. this function. This function is normally called during the driver initialization.
  1126. The caller must not free the memory of the frontend struct before successfully
  1127. calling remove_frontend().</para>
  1128. </entry>
  1129. </row></tbody></tgroup></informaltable>
  1130. <para>SYNOPSIS
  1131. </para>
  1132. <informaltable><tgroup cols="1"><tbody><row><entry
  1133. align="char">
  1134. <para>int add_frontend(dmx_demux_t &#x22C6;demux, dmx_frontend_t
  1135. &#x22C6;frontend);</para>
  1136. </entry>
  1137. </row></tbody></tgroup></informaltable>
  1138. <para>PARAMETERS
  1139. </para>
  1140. <informaltable><tgroup cols="2"><tbody><row><entry
  1141. align="char">
  1142. <para>dmx_demux_t*
  1143. demux</para>
  1144. </entry><entry
  1145. align="char">
  1146. <para>Pointer to the demux API and instance data.</para>
  1147. </entry>
  1148. </row><row><entry
  1149. align="char">
  1150. <para>dmx_frontend_t*
  1151. frontend</para>
  1152. </entry><entry
  1153. align="char">
  1154. <para>Pointer to the front-end instance data.</para>
  1155. </entry>
  1156. </row></tbody></tgroup></informaltable>
  1157. <para>RETURNS
  1158. </para>
  1159. <informaltable><tgroup cols="2"><tbody><row><entry
  1160. align="char">
  1161. <para>0</para>
  1162. </entry><entry
  1163. align="char">
  1164. <para>The function was completed without errors.</para>
  1165. </entry>
  1166. </row><row><entry
  1167. align="char">
  1168. <para>-EEXIST</para>
  1169. </entry><entry
  1170. align="char">
  1171. <para>A front-end with the same value of the id field already
  1172. registered.</para>
  1173. </entry>
  1174. </row><row><entry
  1175. align="char">
  1176. <para>-EINUSE</para>
  1177. </entry><entry
  1178. align="char">
  1179. <para>The demux is in use.</para>
  1180. </entry>
  1181. </row><row><entry
  1182. align="char">
  1183. <para>-ENOMEM</para>
  1184. </entry><entry
  1185. align="char">
  1186. <para>No more front-ends can be added.</para>
  1187. </entry>
  1188. </row><row><entry
  1189. align="char">
  1190. <para>-EINVAL</para>
  1191. </entry><entry
  1192. align="char">
  1193. <para>Bad parameter.</para>
  1194. </entry>
  1195. </row></tbody></tgroup></informaltable>
  1196. </section><section
  1197. role="subsection"><title>remove_frontend()</title>
  1198. <para>DESCRIPTION
  1199. </para>
  1200. <informaltable><tgroup cols="1"><tbody><row><entry
  1201. align="char">
  1202. <para>Indicates that the given front-end, registered by a call to add_frontend(), can
  1203. no longer be connected as a TS source by this demux. The function should be
  1204. called when a front-end driver or a demux driver is removed from the system.
  1205. If the front-end is in use, the function fails with the return value of -EBUSY.
  1206. After successfully calling this function, the caller can free the memory of
  1207. the frontend struct if it was dynamically allocated before the add_frontend()
  1208. operation.</para>
  1209. </entry>
  1210. </row></tbody></tgroup></informaltable>
  1211. <para>SYNOPSIS
  1212. </para>
  1213. <informaltable><tgroup cols="1"><tbody><row><entry
  1214. align="char">
  1215. <para>int remove_frontend(dmx_demux_t&#x22C6; demux,
  1216. dmx_frontend_t&#x22C6; frontend);</para>
  1217. </entry>
  1218. </row></tbody></tgroup></informaltable>
  1219. <para>PARAMETERS
  1220. </para>
  1221. <informaltable><tgroup cols="2"><tbody><row><entry
  1222. align="char">
  1223. <para>dmx_demux_t*
  1224. demux</para>
  1225. </entry><entry
  1226. align="char">
  1227. <para>Pointer to the demux API and instance data.</para>
  1228. </entry>
  1229. </row><row><entry
  1230. align="char">
  1231. <para>dmx_frontend_t*
  1232. frontend</para>
  1233. </entry><entry
  1234. align="char">
  1235. <para>Pointer to the front-end instance data.</para>
  1236. </entry>
  1237. </row></tbody></tgroup></informaltable>
  1238. <para>RETURNS
  1239. </para>
  1240. <informaltable><tgroup cols="2"><tbody><row><entry
  1241. align="char">
  1242. <para>0</para>
  1243. </entry><entry
  1244. align="char">
  1245. <para>The function was completed without errors.</para>
  1246. </entry>
  1247. </row><row><entry
  1248. align="char">
  1249. <para>-EINVAL</para>
  1250. </entry><entry
  1251. align="char">
  1252. <para>Bad parameter.</para>
  1253. </entry>
  1254. </row><row><entry
  1255. align="char">
  1256. <para>-EBUSY</para>
  1257. </entry><entry
  1258. align="char">
  1259. <para>The front-end is in use, i.e. a call to connect_frontend()
  1260. has not been followed by a call to disconnect_frontend().</para>
  1261. </entry>
  1262. </row></tbody></tgroup></informaltable>
  1263. </section><section
  1264. role="subsection"><title>get_frontends()</title>
  1265. <para>DESCRIPTION
  1266. </para>
  1267. <informaltable><tgroup cols="1"><tbody><row><entry
  1268. align="char">
  1269. <para>Provides the APIs of the front-ends that have been registered for this demux.
  1270. Any of the front-ends obtained with this call can be used as a parameter for
  1271. connect_frontend().</para>
  1272. </entry>
  1273. </row><row><entry
  1274. align="char">
  1275. <para>The include file demux.h contains the macro DMX_FE_ENTRY() for
  1276. converting an element of the generic type struct list_head* to the type
  1277. dmx_frontend_t*. The caller must not free the memory of any of the elements
  1278. obtained via this function call.</para>
  1279. </entry>
  1280. </row></tbody></tgroup></informaltable>
  1281. <para>SYNOPSIS
  1282. </para>
  1283. <informaltable><tgroup cols="1"><tbody><row><entry
  1284. align="char">
  1285. <para>struct list_head&#x22C6; get_frontends(dmx_demux_t&#x22C6; demux);</para>
  1286. </entry>
  1287. </row></tbody></tgroup></informaltable>
  1288. <para>PARAMETERS
  1289. </para>
  1290. <informaltable><tgroup cols="2"><tbody><row><entry
  1291. align="char">
  1292. <para>dmx_demux_t*
  1293. demux</para>
  1294. </entry><entry
  1295. align="char">
  1296. <para>Pointer to the demux API and instance data.</para>
  1297. </entry>
  1298. </row></tbody></tgroup></informaltable>
  1299. <para>RETURNS
  1300. </para>
  1301. <informaltable><tgroup cols="2"><tbody><row><entry
  1302. align="char">
  1303. <para>dmx_demux_t*</para>
  1304. </entry><entry
  1305. align="char">
  1306. <para>A list of front-end interfaces, or NULL in the case of an
  1307. empty list.</para>
  1308. </entry>
  1309. </row></tbody></tgroup></informaltable>
  1310. </section><section
  1311. role="subsection"><title>connect_frontend()</title>
  1312. <para>DESCRIPTION
  1313. </para>
  1314. <informaltable><tgroup cols="1"><tbody><row><entry
  1315. align="char">
  1316. <para>Connects the TS output of the front-end to the input of the demux. A demux
  1317. can only be connected to a front-end registered to the demux with the function
  1318. add_frontend().</para>
  1319. </entry>
  1320. </row><row><entry
  1321. align="char">
  1322. <para>It may or may not be possible to connect multiple demuxes to the same
  1323. front-end, depending on the capabilities of the HW platform. When not used,
  1324. the front-end should be released by calling disconnect_frontend().</para>
  1325. </entry>
  1326. </row></tbody></tgroup></informaltable>
  1327. <para>SYNOPSIS
  1328. </para>
  1329. <informaltable><tgroup cols="1"><tbody><row><entry
  1330. align="char">
  1331. <para>int connect_frontend(dmx_demux_t&#x22C6; demux,
  1332. dmx_frontend_t&#x22C6; frontend);</para>
  1333. </entry>
  1334. </row></tbody></tgroup></informaltable>
  1335. <para>PARAMETERS
  1336. </para>
  1337. <informaltable><tgroup cols="2"><tbody><row><entry
  1338. align="char">
  1339. <para>dmx_demux_t*
  1340. demux</para>
  1341. </entry><entry
  1342. align="char">
  1343. <para>Pointer to the demux API and instance data.</para>
  1344. </entry>
  1345. </row><row><entry
  1346. align="char">
  1347. <para>dmx_frontend_t*
  1348. frontend</para>
  1349. </entry><entry
  1350. align="char">
  1351. <para>Pointer to the front-end instance data.</para>
  1352. </entry>
  1353. </row></tbody></tgroup></informaltable>
  1354. <para>RETURNS
  1355. </para>
  1356. <informaltable><tgroup cols="2"><tbody><row><entry
  1357. align="char">
  1358. <para>0</para>
  1359. </entry><entry
  1360. align="char">
  1361. <para>The function was completed without errors.</para>
  1362. </entry>
  1363. </row><row><entry
  1364. align="char">
  1365. <para>-EINVAL</para>
  1366. </entry><entry
  1367. align="char">
  1368. <para>Bad parameter.</para>
  1369. </entry>
  1370. </row><row><entry
  1371. align="char">
  1372. <para>-EBUSY</para>
  1373. </entry><entry
  1374. align="char">
  1375. <para>The front-end is in use.</para>
  1376. </entry>
  1377. </row></tbody></tgroup></informaltable>
  1378. </section><section
  1379. role="subsection"><title>disconnect_frontend()</title>
  1380. <para>DESCRIPTION
  1381. </para>
  1382. <informaltable><tgroup cols="1"><tbody><row><entry
  1383. align="char">
  1384. <para>Disconnects the demux and a front-end previously connected by a
  1385. connect_frontend() call.</para>
  1386. </entry>
  1387. </row></tbody></tgroup></informaltable>
  1388. <para>SYNOPSIS
  1389. </para>
  1390. <informaltable><tgroup cols="1"><tbody><row><entry
  1391. align="char">
  1392. <para>int disconnect_frontend(dmx_demux_t&#x22C6; demux);</para>
  1393. </entry>
  1394. </row></tbody></tgroup></informaltable>
  1395. <para>PARAMETERS
  1396. </para>
  1397. <informaltable><tgroup cols="2"><tbody><row><entry
  1398. align="char">
  1399. <para>dmx_demux_t*
  1400. demux</para>
  1401. </entry><entry
  1402. align="char">
  1403. <para>Pointer to the demux API and instance data.</para>
  1404. </entry>
  1405. </row></tbody></tgroup></informaltable>
  1406. <para>RETURNS
  1407. </para>
  1408. <informaltable><tgroup cols="2"><tbody><row><entry
  1409. align="char">
  1410. <para>0</para>
  1411. </entry><entry
  1412. align="char">
  1413. <para>The function was completed without errors.</para>
  1414. </entry>
  1415. </row><row><entry
  1416. align="char">
  1417. <para>-EINVAL</para>
  1418. </entry><entry
  1419. align="char">
  1420. <para>Bad parameter.</para>
  1421. </entry>
  1422. </row></tbody></tgroup></informaltable>
  1423. </section></section>
  1424. <section id="demux_callback_api">
  1425. <title>Demux Callback API</title>
  1426. <para>This kernel-space API comprises the callback functions that deliver filtered data to the
  1427. demux client. Unlike the other APIs, these API functions are provided by the client and called
  1428. from the demux code.
  1429. </para>
  1430. <para>The function pointers of this abstract interface are not packed into a structure as in the
  1431. other demux APIs, because the callback functions are registered and used independent
  1432. of each other. As an example, it is possible for the API client to provide several
  1433. callback functions for receiving TS packets and no callbacks for PES packets or
  1434. sections.
  1435. </para>
  1436. <para>The functions that implement the callback API need not be re-entrant: when a demux
  1437. driver calls one of these functions, the driver is not allowed to call the function again before
  1438. the original call returns. If a callback is triggered by a hardware interrupt, it is recommended
  1439. to use the Linux &#8220;bottom half&#8221; mechanism or start a tasklet instead of making the callback
  1440. function call directly from a hardware interrupt.
  1441. </para>
  1442. <section
  1443. role="subsection"><title>dmx_ts_cb()</title>
  1444. <para>DESCRIPTION
  1445. </para>
  1446. <informaltable><tgroup cols="1"><tbody><row><entry
  1447. align="char">
  1448. <para>This function, provided by the client of the demux API, is called from the
  1449. demux code. The function is only called when filtering on this TS feed has
  1450. been enabled using the start_filtering() function.</para>
  1451. </entry>
  1452. </row><row><entry
  1453. align="char">
  1454. <para>Any TS packets that match the filter settings are copied to a circular buffer. The
  1455. filtered TS packets are delivered to the client using this callback function. The
  1456. size of the circular buffer is controlled by the circular_buffer_size parameter
  1457. of the set() function in the TS Feed API. It is expected that the buffer1 and
  1458. buffer2 callback parameters point to addresses within the circular buffer, but
  1459. other implementations are also possible. Note that the called party should not
  1460. try to free the memory the buffer1 and buffer2 parameters point to.</para>
  1461. </entry>
  1462. </row><row><entry
  1463. align="char">
  1464. <para>When this function is called, the buffer1 parameter typically points to the
  1465. start of the first undelivered TS packet within a circular buffer. The buffer2
  1466. buffer parameter is normally NULL, except when the received TS packets have
  1467. crossed the last address of the circular buffer and &#8221;wrapped&#8221; to the beginning
  1468. of the buffer. In the latter case the buffer1 parameter would contain an address
  1469. within the circular buffer, while the buffer2 parameter would contain the first
  1470. address of the circular buffer.</para>
  1471. </entry>
  1472. </row><row><entry
  1473. align="char">
  1474. <para>The number of bytes delivered with this function (i.e. buffer1_length +
  1475. buffer2_length) is usually equal to the value of callback_length parameter
  1476. given in the set() function, with one exception: if a timeout occurs before
  1477. receiving callback_length bytes of TS data, any undelivered packets are
  1478. immediately delivered to the client by calling this function. The timeout
  1479. duration is controlled by the set() function in the TS Feed API.</para>
  1480. </entry>
  1481. </row><row><entry
  1482. align="char">
  1483. <para>If a TS packet is received with errors that could not be fixed by the TS-level
  1484. forward error correction (FEC), the Transport_error_indicator flag of the TS
  1485. packet header should be set. The TS packet should not be discarded, as
  1486. the error can possibly be corrected by a higher layer protocol. If the called
  1487. party is slow in processing the callback, it is possible that the circular buffer
  1488. eventually fills up. If this happens, the demux driver should discard any TS
  1489. packets received while the buffer is full. The error should be indicated to the
  1490. client on the next callback by setting the success parameter to the value of
  1491. DMX_OVERRUN_ERROR.</para>
  1492. </entry>
  1493. </row><row><entry
  1494. align="char">
  1495. <para>The type of data returned to the callback can be selected by the new
  1496. function int (*set_type) (struct dmx_ts_feed_s* feed, int type, dmx_ts_pes_t
  1497. pes_type) which is part of the dmx_ts_feed_s struct (also cf. to the
  1498. include file ost/demux.h) The type parameter decides if the raw TS packet
  1499. (TS_PACKET) or just the payload (TS_PACKET&#8212;TS_PAYLOAD_ONLY)
  1500. should be returned. If additionally the TS_DECODER bit is set the stream
  1501. will also be sent to the hardware MPEG decoder. In this case, the second
  1502. flag decides as what kind of data the stream should be interpreted. The
  1503. possible choices are one of DMX_TS_PES_AUDIO, DMX_TS_PES_VIDEO,
  1504. DMX_TS_PES_TELETEXT, DMX_TS_PES_SUBTITLE,
  1505. DMX_TS_PES_PCR, or DMX_TS_PES_OTHER.</para>
  1506. </entry>
  1507. </row></tbody></tgroup></informaltable>
  1508. <para>SYNOPSIS
  1509. </para>
  1510. <informaltable><tgroup cols="1"><tbody><row><entry
  1511. align="char">
  1512. <para>int dmx_ts_cb(__u8&#x22C6; buffer1, size_t buffer1_length,
  1513. __u8&#x22C6; buffer2, size_t buffer2_length, dmx_ts_feed_t&#x22C6;
  1514. source, dmx_success_t success);</para>
  1515. </entry>
  1516. </row></tbody></tgroup></informaltable>
  1517. <para>PARAMETERS
  1518. </para>
  1519. <informaltable><tgroup cols="2"><tbody><row><entry
  1520. align="char">
  1521. <para>__u8* buffer1</para>
  1522. </entry><entry
  1523. align="char">
  1524. <para>Pointer to the start of the filtered TS packets.</para>
  1525. </entry>
  1526. </row><row><entry
  1527. align="char">
  1528. <para>size_t buffer1_length</para>
  1529. </entry><entry
  1530. align="char">
  1531. <para>Length of the TS data in buffer1.</para>
  1532. </entry>
  1533. </row><row><entry
  1534. align="char">
  1535. <para>__u8* buffer2</para>
  1536. </entry><entry
  1537. align="char">
  1538. <para>Pointer to the tail of the filtered TS packets, or NULL.</para>
  1539. </entry>
  1540. </row><row><entry
  1541. align="char">
  1542. <para>size_t buffer2_length</para>
  1543. </entry><entry
  1544. align="char">
  1545. <para>Length of the TS data in buffer2.</para>
  1546. </entry>
  1547. </row><row><entry
  1548. align="char">
  1549. <para>dmx_ts_feed_t*
  1550. source</para>
  1551. </entry><entry
  1552. align="char">
  1553. <para>Indicates which TS feed is the source of the callback.</para>
  1554. </entry>
  1555. </row><row><entry
  1556. align="char">
  1557. <para>dmx_success_t
  1558. success</para>
  1559. </entry><entry
  1560. align="char">
  1561. <para>Indicates if there was an error in TS reception.</para>
  1562. </entry>
  1563. </row></tbody></tgroup></informaltable>
  1564. <para>RETURNS
  1565. </para>
  1566. <informaltable><tgroup cols="2"><tbody><row><entry
  1567. align="char">
  1568. <para>0</para>
  1569. </entry><entry
  1570. align="char">
  1571. <para>Continue filtering.</para>
  1572. </entry>
  1573. </row><row><entry
  1574. align="char">
  1575. <para>-1</para>
  1576. </entry><entry
  1577. align="char">
  1578. <para>Stop filtering - has the same effect as a call to
  1579. stop_filtering() on the TS Feed API.</para>
  1580. </entry>
  1581. </row></tbody></tgroup></informaltable>
  1582. </section><section
  1583. role="subsection"><title>dmx_section_cb()</title>
  1584. <para>DESCRIPTION
  1585. </para>
  1586. <informaltable><tgroup cols="1"><tbody><row><entry
  1587. align="char">
  1588. <para>This function, provided by the client of the demux API, is called from the
  1589. demux code. The function is only called when filtering of sections has been
  1590. enabled using the function start_filtering() of the section feed API. When the
  1591. demux driver has received a complete section that matches at least one section
  1592. filter, the client is notified via this callback function. Normally this function is
  1593. called for each received section; however, it is also possible to deliver multiple
  1594. sections with one callback, for example when the system load is high. If an
  1595. error occurs while receiving a section, this function should be called with
  1596. the corresponding error type set in the success field, whether or not there is
  1597. data to deliver. The Section Feed implementation should maintain a circular
  1598. buffer for received sections. However, this is not necessary if the Section Feed
  1599. API is implemented as a client of the TS Feed API, because the TS Feed
  1600. implementation then buffers the received data. The size of the circular buffer
  1601. can be configured using the set() function in the Section Feed API. If there
  1602. is no room in the circular buffer when a new section is received, the section
  1603. must be discarded. If this happens, the value of the success parameter should
  1604. be DMX_OVERRUN_ERROR on the next callback.</para>
  1605. </entry>
  1606. </row></tbody></tgroup></informaltable>
  1607. <para>SYNOPSIS
  1608. </para>
  1609. <informaltable><tgroup cols="1"><tbody><row><entry
  1610. align="char">
  1611. <para>int dmx_section_cb(__u8&#x22C6; buffer1, size_t
  1612. buffer1_length, __u8&#x22C6; buffer2, size_t
  1613. buffer2_length, dmx_section_filter_t&#x22C6; source,
  1614. dmx_success_t success);</para>
  1615. </entry>
  1616. </row></tbody></tgroup></informaltable>
  1617. <para>PARAMETERS
  1618. </para>
  1619. <informaltable><tgroup cols="2"><tbody><row><entry
  1620. align="char">
  1621. <para>__u8* buffer1</para>
  1622. </entry><entry
  1623. align="char">
  1624. <para>Pointer to the start of the filtered section, e.g. within the
  1625. circular buffer of the demux driver.</para>
  1626. </entry>
  1627. </row><row><entry
  1628. align="char">
  1629. <para>size_t buffer1_length</para>
  1630. </entry><entry
  1631. align="char">
  1632. <para>Length of the filtered section data in buffer1, including
  1633. headers and CRC.</para>
  1634. </entry>
  1635. </row><row><entry
  1636. align="char">
  1637. <para>__u8* buffer2</para>
  1638. </entry><entry
  1639. align="char">
  1640. <para>Pointer to the tail of the filtered section data, or NULL.
  1641. Useful to handle the wrapping of a circular buffer.</para>
  1642. </entry>
  1643. </row><row><entry
  1644. align="char">
  1645. <para>size_t buffer2_length</para>
  1646. </entry><entry
  1647. align="char">
  1648. <para>Length of the filtered section data in buffer2, including
  1649. headers and CRC.</para>
  1650. </entry>
  1651. </row><row><entry
  1652. align="char">
  1653. <para>dmx_section_filter_t*
  1654. filter</para>
  1655. </entry><entry
  1656. align="char">
  1657. <para>Indicates the filter that triggered the callback.</para>
  1658. </entry>
  1659. </row><row><entry
  1660. align="char">
  1661. <para>dmx_success_t
  1662. success</para>
  1663. </entry><entry
  1664. align="char">
  1665. <para>Indicates if there was an error in section reception.</para>
  1666. </entry>
  1667. </row></tbody></tgroup></informaltable>
  1668. <para>RETURNS
  1669. </para>
  1670. <informaltable><tgroup cols="2"><tbody><row><entry
  1671. align="char">
  1672. <para>0</para>
  1673. </entry><entry
  1674. align="char">
  1675. <para>Continue filtering.</para>
  1676. </entry>
  1677. </row><row><entry
  1678. align="char">
  1679. <para>-1</para>
  1680. </entry><entry
  1681. align="char">
  1682. <para>Stop filtering - has the same effect as a call to
  1683. stop_filtering() on the Section Feed API.</para>
  1684. </entry>
  1685. </row></tbody></tgroup></informaltable>
  1686. </section></section>
  1687. <section id="ts_feed_api">
  1688. <title>TS Feed API</title>
  1689. <para>A TS feed is typically mapped to a hardware PID filter on the demux chip.
  1690. Using this API, the client can set the filtering properties to start/stop filtering TS
  1691. packets on a particular TS feed. The API is defined as an abstract interface of the type
  1692. dmx_ts_feed_t.
  1693. </para>
  1694. <para>The functions that implement the interface should be defined static or module private. The
  1695. client can get the handle of a TS feed API by calling the function allocate_ts_feed() in the
  1696. demux API.
  1697. </para>
  1698. <section
  1699. role="subsection"><title>set()</title>
  1700. <para>DESCRIPTION
  1701. </para>
  1702. <informaltable><tgroup cols="1"><tbody><row><entry
  1703. align="char">
  1704. <para>This function sets the parameters of a TS feed. Any filtering in progress on the
  1705. TS feed must be stopped before calling this function.</para>
  1706. </entry>
  1707. </row></tbody></tgroup></informaltable>
  1708. <para>SYNOPSIS
  1709. </para>
  1710. <informaltable><tgroup cols="1"><tbody><row><entry
  1711. align="char">
  1712. <para>int set ( dmx_ts_feed_t&#x22C6; feed, __u16 pid, size_t
  1713. callback_length, size_t circular_buffer_size, int
  1714. descramble, struct timespec timeout);</para>
  1715. </entry>
  1716. </row></tbody></tgroup></informaltable>
  1717. <para>PARAMETERS
  1718. </para>
  1719. <informaltable><tgroup cols="2"><tbody><row><entry
  1720. align="char">
  1721. <para>dmx_ts_feed_t* feed</para>
  1722. </entry><entry
  1723. align="char">
  1724. <para>Pointer to the TS feed API and instance data.</para>
  1725. </entry>
  1726. </row><row><entry
  1727. align="char">
  1728. <para>__u16 pid</para>
  1729. </entry><entry
  1730. align="char">
  1731. <para>PID value to filter. Only the TS packets carrying the
  1732. specified PID will be passed to the API client.</para>
  1733. </entry>
  1734. </row><row><entry
  1735. align="char">
  1736. <para>size_t
  1737. callback_length</para>
  1738. </entry><entry
  1739. align="char">
  1740. <para>Number of bytes to deliver with each call to the
  1741. dmx_ts_cb() callback function. The value of this
  1742. parameter should be a multiple of 188.</para>
  1743. </entry>
  1744. </row><row><entry
  1745. align="char">
  1746. <para>size_t
  1747. circular_buffer_size</para>
  1748. </entry><entry
  1749. align="char">
  1750. <para>Size of the circular buffer for the filtered TS packets.</para>
  1751. </entry>
  1752. </row><row><entry
  1753. align="char">
  1754. <para>int descramble</para>
  1755. </entry><entry
  1756. align="char">
  1757. <para>If non-zero, descramble the filtered TS packets.</para>
  1758. </entry>
  1759. </row><row><entry
  1760. align="char">
  1761. <para>struct timespec
  1762. timeout</para>
  1763. </entry><entry
  1764. align="char">
  1765. <para>Maximum time to wait before delivering received TS
  1766. packets to the client.</para>
  1767. </entry>
  1768. </row></tbody></tgroup></informaltable>
  1769. <para>RETURNS
  1770. </para>
  1771. <informaltable><tgroup cols="2"><tbody><row><entry
  1772. align="char">
  1773. <para>0</para>
  1774. </entry><entry
  1775. align="char">
  1776. <para>The function was completed without errors.</para>
  1777. </entry>
  1778. </row><row><entry
  1779. align="char">
  1780. <para>-ENOMEM</para>
  1781. </entry><entry
  1782. align="char">
  1783. <para>Not enough memory for the requested buffer size.</para>
  1784. </entry>
  1785. </row><row><entry
  1786. align="char">
  1787. <para>-ENOSYS</para>
  1788. </entry><entry
  1789. align="char">
  1790. <para>No descrambling facility available for TS.</para>
  1791. </entry>
  1792. </row><row><entry
  1793. align="char">
  1794. <para>-EINVAL</para>
  1795. </entry><entry
  1796. align="char">
  1797. <para>Bad parameter.</para>
  1798. </entry>
  1799. </row></tbody></tgroup></informaltable>
  1800. </section><section
  1801. role="subsection"><title>start_filtering()</title>
  1802. <para>DESCRIPTION
  1803. </para>
  1804. <informaltable><tgroup cols="1"><tbody><row><entry
  1805. align="char">
  1806. <para>Starts filtering TS packets on this TS feed, according to its settings. The PID
  1807. value to filter can be set by the API client. All matching TS packets are
  1808. delivered asynchronously to the client, using the callback function registered
  1809. with allocate_ts_feed().</para>
  1810. </entry>
  1811. </row></tbody></tgroup></informaltable>
  1812. <para>SYNOPSIS
  1813. </para>
  1814. <informaltable><tgroup cols="1"><tbody><row><entry
  1815. align="char">
  1816. <para>int start_filtering(dmx_ts_feed_t&#x22C6; feed);</para>
  1817. </entry>
  1818. </row></tbody></tgroup></informaltable>
  1819. <para>PARAMETERS
  1820. </para>
  1821. <informaltable><tgroup cols="2"><tbody><row><entry
  1822. align="char">
  1823. <para>dmx_ts_feed_t* feed</para>
  1824. </entry><entry
  1825. align="char">
  1826. <para>Pointer to the TS feed API and instance data.</para>
  1827. </entry>
  1828. </row></tbody></tgroup></informaltable>
  1829. <para>RETURNS
  1830. </para>
  1831. <informaltable><tgroup cols="2"><tbody><row><entry
  1832. align="char">
  1833. <para>0</para>
  1834. </entry><entry
  1835. align="char">
  1836. <para>The function was completed without errors.</para>
  1837. </entry>
  1838. </row><row><entry
  1839. align="char">
  1840. <para>-EINVAL</para>
  1841. </entry><entry
  1842. align="char">
  1843. <para>Bad parameter.</para>
  1844. </entry>
  1845. </row></tbody></tgroup></informaltable>
  1846. </section><section
  1847. role="subsection"><title>stop_filtering()</title>
  1848. <para>DESCRIPTION
  1849. </para>
  1850. <informaltable><tgroup cols="1"><tbody><row><entry
  1851. align="char">
  1852. <para>Stops filtering TS packets on this TS feed.</para>
  1853. </entry>
  1854. </row></tbody></tgroup></informaltable>
  1855. <para>SYNOPSIS
  1856. </para>
  1857. <informaltable><tgroup cols="1"><tbody><row><entry
  1858. align="char">
  1859. <para>int stop_filtering(dmx_ts_feed_t&#x22C6; feed);</para>
  1860. </entry>
  1861. </row></tbody></tgroup></informaltable>
  1862. <para>PARAMETERS
  1863. </para>
  1864. <informaltable><tgroup cols="2"><tbody><row><entry
  1865. align="char">
  1866. <para>dmx_ts_feed_t* feed</para>
  1867. </entry><entry
  1868. align="char">
  1869. <para>Pointer to the TS feed API and instance data.</para>
  1870. </entry>
  1871. </row></tbody></tgroup></informaltable>
  1872. <para>RETURNS
  1873. </para>
  1874. <informaltable><tgroup cols="2"><tbody><row><entry
  1875. align="char">
  1876. <para>0</para>
  1877. </entry><entry
  1878. align="char">
  1879. <para>The function was completed without errors.</para>
  1880. </entry>
  1881. </row><row><entry
  1882. align="char">
  1883. <para>-EINVAL</para>
  1884. </entry><entry
  1885. align="char">
  1886. <para>Bad parameter.</para>
  1887. </entry>
  1888. </row></tbody></tgroup></informaltable>
  1889. </section></section>
  1890. <section id="section_feed_api">
  1891. <title>Section Feed API</title>
  1892. <para>A section feed is a resource consisting of a PID filter and a set of section filters. Using this
  1893. API, the client can set the properties of a section feed and to start/stop filtering. The API is
  1894. defined as an abstract interface of the type dmx_section_feed_t. The functions that implement
  1895. the interface should be defined static or module private. The client can get the handle of
  1896. a section feed API by calling the function allocate_section_feed() in the demux
  1897. API.
  1898. </para>
  1899. <para>On demux platforms that provide section filtering in hardware, the Section Feed API
  1900. implementation provides a software wrapper for the demux hardware. Other platforms may
  1901. support only PID filtering in hardware, requiring that TS packets are converted to sections in
  1902. software. In the latter case the Section Feed API implementation can be a client of the TS
  1903. Feed API.
  1904. </para>
  1905. </section>
  1906. <section id="kdapi_set">
  1907. <title>set()</title>
  1908. <para>DESCRIPTION
  1909. </para>
  1910. <informaltable><tgroup cols="1"><tbody><row><entry
  1911. align="char">
  1912. <para>This function sets the parameters of a section feed. Any filtering in progress on
  1913. the section feed must be stopped before calling this function. If descrambling
  1914. is enabled, the payload_scrambling_control and address_scrambling_control
  1915. fields of received DVB datagram sections should be observed. If either one is
  1916. non-zero, the section should be descrambled either in hardware or using the
  1917. functions descramble_mac_address() and descramble_section_payload() of the
  1918. demux API. Note that according to the MPEG-2 Systems specification, only
  1919. the payloads of private sections can be scrambled while the rest of the section
  1920. data must be sent in the clear.</para>
  1921. </entry>
  1922. </row></tbody></tgroup></informaltable>
  1923. <para>SYNOPSIS
  1924. </para>
  1925. <informaltable><tgroup cols="1"><tbody><row><entry
  1926. align="char">
  1927. <para>int set(dmx_section_feed_t&#x22C6; feed, __u16 pid, size_t
  1928. circular_buffer_size, int descramble, int
  1929. check_crc);</para>
  1930. </entry>
  1931. </row></tbody></tgroup></informaltable>
  1932. <para>PARAMETERS
  1933. </para>
  1934. <informaltable><tgroup cols="2"><tbody><row><entry
  1935. align="char">
  1936. <para>dmx_section_feed_t*
  1937. feed</para>
  1938. </entry><entry
  1939. align="char">
  1940. <para>Pointer to the section feed API and instance data.</para>
  1941. </entry>
  1942. </row><row><entry
  1943. align="char">
  1944. <para>__u16 pid</para>
  1945. </entry><entry
  1946. align="char">
  1947. <para>PID value to filter; only the TS packets carrying the
  1948. specified PID will be accepted.</para>
  1949. </entry>
  1950. </row><row><entry
  1951. align="char">
  1952. <para>size_t
  1953. circular_buffer_size</para>
  1954. </entry><entry
  1955. align="char">
  1956. <para>Size of the circular buffer for filtered sections.</para>
  1957. </entry>
  1958. </row><row><entry
  1959. align="char">
  1960. <para>int descramble</para>
  1961. </entry><entry
  1962. align="char">
  1963. <para>If non-zero, descramble any sections that are scrambled.</para>
  1964. </entry>
  1965. </row><row><entry
  1966. align="char">
  1967. <para>int check_crc</para>
  1968. </entry><entry
  1969. align="char">
  1970. <para>If non-zero, check the CRC values of filtered sections.</para>
  1971. </entry>
  1972. </row></tbody></tgroup></informaltable>
  1973. <para>RETURNS
  1974. </para>
  1975. <informaltable><tgroup cols="2"><tbody><row><entry
  1976. align="char">
  1977. <para>0</para>
  1978. </entry><entry
  1979. align="char">
  1980. <para>The function was completed without errors.</para>
  1981. </entry>
  1982. </row><row><entry
  1983. align="char">
  1984. <para>-ENOMEM</para>
  1985. </entry><entry
  1986. align="char">
  1987. <para>Not enough memory for the requested buffer size.</para>
  1988. </entry>
  1989. </row><row><entry
  1990. align="char">
  1991. <para>-ENOSYS</para>
  1992. </entry><entry
  1993. align="char">
  1994. <para>No descrambling facility available for sections.</para>
  1995. </entry>
  1996. </row><row><entry
  1997. align="char">
  1998. <para>-EINVAL</para>
  1999. </entry><entry
  2000. align="char">
  2001. <para>Bad parameters.</para>
  2002. </entry>
  2003. </row></tbody></tgroup></informaltable>
  2004. </section><section
  2005. role="subsection"><title>allocate_filter()</title>
  2006. <para>DESCRIPTION
  2007. </para>
  2008. <informaltable><tgroup cols="1"><tbody><row><entry
  2009. align="char">
  2010. <para>This function is used to allocate a section filter on the demux. It should only be
  2011. called when no filtering is in progress on this section feed. If a filter cannot be
  2012. allocated, the function fails with -ENOSPC. See in section ?? for the format of
  2013. the section filter.</para>
  2014. </entry>
  2015. </row><row><entry
  2016. align="char">
  2017. <para>The bitfields filter_mask and filter_value should only be modified when no
  2018. filtering is in progress on this section feed. filter_mask controls which bits of
  2019. filter_value are compared with the section headers/payload. On a binary value
  2020. of 1 in filter_mask, the corresponding bits are compared. The filter only accepts
  2021. sections that are equal to filter_value in all the tested bit positions. Any changes
  2022. to the values of filter_mask and filter_value are guaranteed to take effect only
  2023. when the start_filtering() function is called next time. The parent pointer in
  2024. the struct is initialized by the API implementation to the value of the feed
  2025. parameter. The priv pointer is not used by the API implementation, and can
  2026. thus be freely utilized by the caller of this function. Any data pointed to by the
  2027. priv pointer is available to the recipient of the dmx_section_cb() function call.</para>
  2028. </entry>
  2029. </row><row><entry
  2030. align="char">
  2031. <para>While the maximum section filter length (DMX_MAX_FILTER_SIZE) is
  2032. currently set at 16 bytes, hardware filters of that size are not available on all
  2033. platforms. Therefore, section filtering will often take place first in hardware,
  2034. followed by filtering in software for the header bytes that were not covered
  2035. by a hardware filter. The filter_mask field can be checked to determine how
  2036. many bytes of the section filter are actually used, and if the hardware filter will
  2037. suffice. Additionally, software-only section filters can optionally be allocated
  2038. to clients when all hardware section filters are in use. Note that on most demux
  2039. hardware it is not possible to filter on the section_length field of the section
  2040. header &#8211; thus this field is ignored, even though it is included in filter_value and
  2041. filter_mask fields.</para>
  2042. </entry>
  2043. </row></tbody></tgroup></informaltable>
  2044. <para>SYNOPSIS
  2045. </para>
  2046. <informaltable><tgroup cols="1"><tbody><row><entry
  2047. align="char">
  2048. <para>int allocate_filter(dmx_section_feed_t&#x22C6; feed,
  2049. dmx_section_filter_t&#x22C6;&#x22C6; filter);</para>
  2050. </entry>
  2051. </row></tbody></tgroup></informaltable>
  2052. <para>PARAMETERS
  2053. </para>
  2054. <informaltable><tgroup cols="2"><tbody><row><entry
  2055. align="char">
  2056. <para>dmx_section_feed_t*
  2057. feed</para>
  2058. </entry><entry
  2059. align="char">
  2060. <para>Pointer to the section feed API and instance data.</para>
  2061. </entry>
  2062. </row><row><entry
  2063. align="char">
  2064. <para>dmx_section_filter_t**
  2065. filter</para>
  2066. </entry><entry
  2067. align="char">
  2068. <para>Pointer to the allocated filter.</para>
  2069. </entry>
  2070. </row></tbody></tgroup></informaltable>
  2071. <para>RETURNS
  2072. </para>
  2073. <informaltable><tgroup cols="2"><tbody><row><entry
  2074. align="char">
  2075. <para>0</para>
  2076. </entry><entry
  2077. align="char">
  2078. <para>The function was completed without errors.</para>
  2079. </entry>
  2080. </row><row><entry
  2081. align="char">
  2082. <para>-ENOSPC</para>
  2083. </entry><entry
  2084. align="char">
  2085. <para>No filters of given type and length available.</para>
  2086. </entry>
  2087. </row><row><entry
  2088. align="char">
  2089. <para>-EINVAL</para>
  2090. </entry><entry
  2091. align="char">
  2092. <para>Bad parameters.</para>
  2093. </entry>
  2094. </row></tbody></tgroup></informaltable>
  2095. </section><section
  2096. role="subsection"><title>release_filter()</title>
  2097. <para>DESCRIPTION
  2098. </para>
  2099. <informaltable><tgroup cols="1"><tbody><row><entry
  2100. align="char">
  2101. <para>This function releases all the resources of a previously allocated section filter.
  2102. The function should not be called while filtering is in progress on this section
  2103. feed. After calling this function, the caller should not try to dereference the
  2104. filter pointer.</para>
  2105. </entry>
  2106. </row></tbody></tgroup></informaltable>
  2107. <para>SYNOPSIS
  2108. </para>
  2109. <informaltable><tgroup cols="1"><tbody><row><entry
  2110. align="char">
  2111. <para>int release_filter ( dmx_section_feed_t&#x22C6; feed,
  2112. dmx_section_filter_t&#x22C6; filter);</para>
  2113. </entry>
  2114. </row></tbody></tgroup></informaltable>
  2115. <para>PARAMETERS
  2116. </para>
  2117. <informaltable><tgroup cols="2"><tbody><row><entry
  2118. align="char">
  2119. <para>dmx_section_feed_t*
  2120. feed</para>
  2121. </entry><entry
  2122. align="char">
  2123. <para>Pointer to the section feed API and instance data.</para>
  2124. </entry>
  2125. </row><row><entry
  2126. align="char">
  2127. <para>dmx_section_filter_t*
  2128. filter</para>
  2129. </entry><entry
  2130. align="char">
  2131. <para>I/O Pointer to the instance data of a section filter.</para>
  2132. </entry>
  2133. </row></tbody></tgroup></informaltable>
  2134. <para>RETURNS
  2135. </para>
  2136. <informaltable><tgroup cols="2"><tbody><row><entry
  2137. align="char">
  2138. <para>0</para>
  2139. </entry><entry
  2140. align="char">
  2141. <para>The function was completed without errors.</para>
  2142. </entry>
  2143. </row><row><entry
  2144. align="char">
  2145. <para>-ENODEV</para>
  2146. </entry><entry
  2147. align="char">
  2148. <para>No such filter allocated.</para>
  2149. </entry>
  2150. </row><row><entry
  2151. align="char">
  2152. <para>-EINVAL</para>
  2153. </entry><entry
  2154. align="char">
  2155. <para>Bad parameter.</para>
  2156. </entry>
  2157. </row></tbody></tgroup></informaltable>
  2158. </section><section
  2159. role="subsection"><title>start_filtering()</title>
  2160. <para>DESCRIPTION
  2161. </para>
  2162. <informaltable><tgroup cols="1"><tbody><row><entry
  2163. align="char">
  2164. <para>Starts filtering sections on this section feed, according to its settings. Sections
  2165. are first filtered based on their PID and then matched with the section
  2166. filters allocated for this feed. If the section matches the PID filter and
  2167. at least one section filter, it is delivered to the API client. The section
  2168. is delivered asynchronously using the callback function registered with
  2169. allocate_section_feed().</para>
  2170. </entry>
  2171. </row></tbody></tgroup></informaltable>
  2172. <para>SYNOPSIS
  2173. </para>
  2174. <informaltable><tgroup cols="1"><tbody><row><entry
  2175. align="char">
  2176. <para>int start_filtering ( dmx_section_feed_t&#x22C6; feed );</para>
  2177. </entry>
  2178. </row></tbody></tgroup></informaltable>
  2179. <para>PARAMETERS
  2180. </para>
  2181. <informaltable><tgroup cols="2"><tbody><row><entry
  2182. align="char">
  2183. <para>dmx_section_feed_t*
  2184. feed</para>
  2185. </entry><entry
  2186. align="char">
  2187. <para>Pointer to the section feed API and instance data.</para>
  2188. </entry>
  2189. </row></tbody></tgroup></informaltable>
  2190. <para>RETURNS
  2191. </para>
  2192. <informaltable><tgroup cols="2"><tbody><row><entry
  2193. align="char">
  2194. <para>0</para>
  2195. </entry><entry
  2196. align="char">
  2197. <para>The function was completed without errors.</para>
  2198. </entry>
  2199. </row><row><entry
  2200. align="char">
  2201. <para>-EINVAL</para>
  2202. </entry><entry
  2203. align="char">
  2204. <para>Bad parameter.</para>
  2205. </entry>
  2206. </row></tbody></tgroup></informaltable>
  2207. </section><section
  2208. role="subsection"><title>stop_filtering()</title>
  2209. <para>DESCRIPTION
  2210. </para>
  2211. <informaltable><tgroup cols="1"><tbody><row><entry
  2212. align="char">
  2213. <para>Stops filtering sections on this section feed. Note that any changes to the
  2214. filtering parameters (filter_value, filter_mask, etc.) should only be made when
  2215. filtering is stopped.</para>
  2216. </entry>
  2217. </row></tbody></tgroup></informaltable>
  2218. <para>SYNOPSIS
  2219. </para>
  2220. <informaltable><tgroup cols="1"><tbody><row><entry
  2221. align="char">
  2222. <para>int stop_filtering ( dmx_section_feed_t&#x22C6; feed );</para>
  2223. </entry>
  2224. </row></tbody></tgroup></informaltable>
  2225. <para>PARAMETERS
  2226. </para>
  2227. <informaltable><tgroup cols="2"><tbody><row><entry
  2228. align="char">
  2229. <para>dmx_section_feed_t*
  2230. feed</para>
  2231. </entry><entry
  2232. align="char">
  2233. <para>Pointer to the section feed API and instance data.</para>
  2234. </entry>
  2235. </row></tbody></tgroup></informaltable>
  2236. <para>RETURNS
  2237. </para>
  2238. <informaltable><tgroup cols="2"><tbody><row><entry
  2239. align="char">
  2240. <para>0</para>
  2241. </entry><entry
  2242. align="char">
  2243. <para>The function was completed without errors.</para>
  2244. </entry>
  2245. </row><row><entry
  2246. align="char">
  2247. <para>-EINVAL</para>
  2248. </entry><entry
  2249. align="char">
  2250. <para>Bad parameter.</para>
  2251. </entry>
  2252. </row></tbody></tgroup></informaltable>
  2253. </section>