fw-decoder-api.txt 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. Decoder firmware API description
  2. ================================
  3. Note: this API is part of the decoder firmware, so it's cx23415 only.
  4. -------------------------------------------------------------------------------
  5. Name CX2341X_DEC_PING_FW
  6. Enum 0/0x00
  7. Description
  8. This API call does nothing. It may be used to check if the firmware
  9. is responding.
  10. -------------------------------------------------------------------------------
  11. Name CX2341X_DEC_START_PLAYBACK
  12. Enum 1/0x01
  13. Description
  14. Begin or resume playback.
  15. Param[0]
  16. 0 based frame number in GOP to begin playback from.
  17. Param[1]
  18. Specifies the number of muted audio frames to play before normal
  19. audio resumes.
  20. -------------------------------------------------------------------------------
  21. Name CX2341X_DEC_STOP_PLAYBACK
  22. Enum 2/0x02
  23. Description
  24. Ends playback and clears all decoder buffers. If PTS is not zero,
  25. playback stops at specified PTS.
  26. Param[0]
  27. Display 0=last frame, 1=black
  28. Param[1]
  29. PTS low
  30. Param[2]
  31. PTS high
  32. -------------------------------------------------------------------------------
  33. Name CX2341X_DEC_SET_PLAYBACK_SPEED
  34. Enum 3/0x03
  35. Description
  36. Playback stream at speed other than normal. There are two modes of
  37. operation:
  38. Smooth: host transfers entire stream and firmware drops unused
  39. frames.
  40. Coarse: host drops frames based on indexing as required to achieve
  41. desired speed.
  42. Param[0]
  43. Bitmap:
  44. 0:7 0 normal
  45. 1 fast only "1.5 times"
  46. n nX fast, 1/nX slow
  47. 30 Framedrop:
  48. '0' during 1.5 times play, every other B frame is dropped
  49. '1' during 1.5 times play, stream is unchanged (bitrate
  50. must not exceed 8mbps)
  51. 31 Speed:
  52. '0' slow
  53. '1' fast
  54. Param[1]
  55. Direction: 0=forward, 1=reverse
  56. Param[2]
  57. Picture mask:
  58. 1=I frames
  59. 3=I, P frames
  60. 7=I, P, B frames
  61. Param[3]
  62. B frames per GOP (for reverse play only)
  63. Param[4]
  64. Mute audio: 0=disable, 1=enable
  65. Param[5]
  66. Display 0=frame, 1=field
  67. Param[6]
  68. Specifies the number of muted audio frames to play before normal audio
  69. resumes.
  70. -------------------------------------------------------------------------------
  71. Name CX2341X_DEC_STEP_VIDEO
  72. Enum 5/0x05
  73. Description
  74. Each call to this API steps the playback to the next unit defined below
  75. in the current playback direction.
  76. Param[0]
  77. 0=frame, 1=top field, 2=bottom field
  78. -------------------------------------------------------------------------------
  79. Name CX2341X_DEC_SET_DMA_BLOCK_SIZE
  80. Enum 8/0x08
  81. Description
  82. Set DMA transfer block size. Counterpart to API 0xC9
  83. Param[0]
  84. DMA transfer block size in bytes. A different size may be specified
  85. when issuing the DMA transfer command.
  86. -------------------------------------------------------------------------------
  87. Name CX2341X_DEC_GET_XFER_INFO
  88. Enum 9/0x09
  89. Description
  90. This API call may be used to detect an end of stream condtion.
  91. Result[0]
  92. Stream type
  93. Result[1]
  94. Address offset
  95. Result[2]
  96. Maximum bytes to transfer
  97. Result[3]
  98. Buffer fullness
  99. -------------------------------------------------------------------------------
  100. Name CX2341X_DEC_GET_DMA_STATUS
  101. Enum 10/0x0A
  102. Description
  103. Status of the last DMA transfer
  104. Result[0]
  105. Bit 1 set means transfer complete
  106. Bit 2 set means DMA error
  107. Bit 3 set means linked list error
  108. Result[1]
  109. DMA type: 0=MPEG, 1=OSD, 2=YUV
  110. -------------------------------------------------------------------------------
  111. Name CX2341X_DEC_SCHED_DMA_FROM_HOST
  112. Enum 11/0x0B
  113. Description
  114. Setup DMA from host operation. Counterpart to API 0xCC
  115. Param[0]
  116. Memory address of link list
  117. Param[1]
  118. Total # of bytes to transfer
  119. Param[2]
  120. DMA type (0=MPEG, 1=OSD, 2=YUV)
  121. -------------------------------------------------------------------------------
  122. Name CX2341X_DEC_PAUSE_PLAYBACK
  123. Enum 13/0x0D
  124. Description
  125. Freeze playback immediately. In this mode, when internal buffers are
  126. full, no more data will be accepted and data request IRQs will be
  127. masked.
  128. Param[0]
  129. Display: 0=last frame, 1=black
  130. -------------------------------------------------------------------------------
  131. Name CX2341X_DEC_HALT_FW
  132. Enum 14/0x0E
  133. Description
  134. The firmware is halted and no further API calls are serviced until
  135. the firmware is uploaded again.
  136. -------------------------------------------------------------------------------
  137. Name CX2341X_DEC_SET_STANDARD
  138. Enum 16/0x10
  139. Description
  140. Selects display standard
  141. Param[0]
  142. 0=NTSC, 1=PAL
  143. -------------------------------------------------------------------------------
  144. Name CX2341X_DEC_GET_VERSION
  145. Enum 17/0x11
  146. Description
  147. Returns decoder firmware version information
  148. Result[0]
  149. Version bitmask:
  150. Bits 0:15 build
  151. Bits 16:23 minor
  152. Bits 24:31 major
  153. -------------------------------------------------------------------------------
  154. Name CX2341X_DEC_SET_STREAM_INPUT
  155. Enum 20/0x14
  156. Description
  157. Select decoder stream input port
  158. Param[0]
  159. 0=memory (default), 1=streaming
  160. -------------------------------------------------------------------------------
  161. Name CX2341X_DEC_GET_TIMING_INFO
  162. Enum 21/0x15
  163. Description
  164. Returns timing information from start of playback
  165. Result[0]
  166. Frame count by decode order
  167. Result[1]
  168. Video PTS bits 0:31 by display order
  169. Result[2]
  170. Video PTS bit 32 by display order
  171. Result[3]
  172. SCR bits 0:31 by display order
  173. Result[4]
  174. SCR bit 32 by display order
  175. -------------------------------------------------------------------------------
  176. Name CX2341X_DEC_SET_AUDIO_MODE
  177. Enum 22/0x16
  178. Description
  179. Select audio mode
  180. Param[0]
  181. Dual mono mode action
  182. Param[1]
  183. Stereo mode action:
  184. 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
  185. -------------------------------------------------------------------------------
  186. Name CX2341X_DEC_SET_EVENT_NOTIFICATION
  187. Enum 23/0x17
  188. Description
  189. Setup firmware to notify the host about a particular event.
  190. Counterpart to API 0xD5
  191. Param[0]
  192. Event: 0=Audio mode change between stereo and dual channel
  193. Param[1]
  194. Notification 0=disabled, 1=enabled
  195. Param[2]
  196. Interrupt bit
  197. Param[3]
  198. Mailbox slot, -1 if no mailbox required.
  199. -------------------------------------------------------------------------------
  200. Name CX2341X_DEC_SET_DISPLAY_BUFFERS
  201. Enum 24/0x18
  202. Description
  203. Number of display buffers. To decode all frames in reverse playback you
  204. must use nine buffers.
  205. Param[0]
  206. 0=six buffers, 1=nine buffers
  207. -------------------------------------------------------------------------------
  208. Name CX2341X_DEC_EXTRACT_VBI
  209. Enum 25/0x19
  210. Description
  211. Extracts VBI data
  212. Param[0]
  213. 0=extract from extension & user data, 1=extract from private packets
  214. Result[0]
  215. VBI table location
  216. Result[1]
  217. VBI table size
  218. -------------------------------------------------------------------------------
  219. Name CX2341X_DEC_SET_DECODER_SOURCE
  220. Enum 26/0x1A
  221. Description
  222. Selects decoder source. Ensure that the parameters passed to this
  223. API match the encoder settings.
  224. Param[0]
  225. Mode: 0=MPEG from host, 1=YUV from encoder, 2=YUV from host
  226. Param[1]
  227. YUV picture width
  228. Param[2]
  229. YUV picture height
  230. Param[3]
  231. Bitmap: see Param[0] of API 0xBD
  232. -------------------------------------------------------------------------------
  233. Name CX2341X_DEC_SET_AUDIO_OUTPUT
  234. Enum 27/0x1B
  235. Description
  236. Select audio output format
  237. Param[0]
  238. Bitmask:
  239. 0:1 Data size:
  240. '00' 16 bit
  241. '01' 20 bit
  242. '10' 24 bit
  243. 2:7 Unused
  244. 8:9 Mode:
  245. '00' 2 channels
  246. '01' 4 channels
  247. '10' 6 channels
  248. '11' 6 channels with one line data mode
  249. (for left justified MSB first mode, 20 bit only)
  250. 10:11 Unused
  251. 12:13 Channel format:
  252. '00' right justified MSB first mode
  253. '01' left justified MSB first mode
  254. '10' I2S mode
  255. 14:15 Unused
  256. 16:21 Right justify bit count
  257. 22:31 Unused
  258. -------------------------------------------------------------------------------
  259. Name CX2341X_DEC_SET_AV_DELAY
  260. Enum 28/0x1C
  261. Description
  262. Set audio/video delay in 90Khz ticks
  263. Param[0]
  264. 0=A/V in sync, negative=audio lags, positive=video lags
  265. -------------------------------------------------------------------------------
  266. Name CX2341X_DEC_SET_PREBUFFERING
  267. Enum 30/0x1E
  268. Description
  269. Decoder prebuffering, when enabled up to 128KB are buffered for
  270. streams <8mpbs or 640KB for streams >8mbps
  271. Param[0]
  272. 0=off, 1=on