fw-decoder-api.txt 8.0 KB

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