fw-osd-api.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. OSD firmware API description
  2. ============================
  3. Note: this API is part of the decoder firmware, so it's cx23415 only.
  4. -------------------------------------------------------------------------------
  5. Name CX2341X_OSD_GET_FRAMEBUFFER
  6. Enum 65/0x41
  7. Description
  8. Return base and length of contiguous OSD memory.
  9. Result[0]
  10. OSD base address
  11. Result[1]
  12. OSD length
  13. -------------------------------------------------------------------------------
  14. Name CX2341X_OSD_GET_PIXEL_FORMAT
  15. Enum 66/0x42
  16. Description
  17. Query OSD format
  18. Result[0]
  19. 0=8bit index, 4=AlphaRGB 8:8:8:8
  20. -------------------------------------------------------------------------------
  21. Name CX2341X_OSD_SET_PIXEL_FORMAT
  22. Enum 67/0x43
  23. Description
  24. Assign pixel format
  25. Param[0]
  26. 0=8bit index, 4=AlphaRGB 8:8:8:8
  27. -------------------------------------------------------------------------------
  28. Name CX2341X_OSD_GET_STATE
  29. Enum 68/0x44
  30. Description
  31. Query OSD state
  32. Result[0]
  33. Bit 0 0=off, 1=on
  34. Bits 1:2 alpha control
  35. Bits 3:5 pixel format
  36. -------------------------------------------------------------------------------
  37. Name CX2341X_OSD_SET_STATE
  38. Enum 69/0x45
  39. Description
  40. OSD switch
  41. Param[0]
  42. 0=off, 1=on
  43. -------------------------------------------------------------------------------
  44. Name CX2341X_OSD_GET_OSD_COORDS
  45. Enum 70/0x46
  46. Description
  47. Retrieve coordinates of OSD area blended with video
  48. Result[0]
  49. OSD buffer address
  50. Result[1]
  51. Stride in pixels
  52. Result[2]
  53. Lines in OSD buffer
  54. Result[3]
  55. Horizontal offset in buffer
  56. Result[4]
  57. Vertical offset in buffer
  58. -------------------------------------------------------------------------------
  59. Name CX2341X_OSD_SET_OSD_COORDS
  60. Enum 71/0x47
  61. Description
  62. Assign the coordinates of the OSD area to blend with video
  63. Param[0]
  64. buffer address
  65. Param[1]
  66. buffer stride in pixels
  67. Param[2]
  68. lines in buffer
  69. Param[3]
  70. horizontal offset
  71. Param[4]
  72. vertical offset
  73. -------------------------------------------------------------------------------
  74. Name CX2341X_OSD_GET_SCREEN_COORDS
  75. Enum 72/0x48
  76. Description
  77. Retrieve OSD screen area coordinates
  78. Result[0]
  79. top left horizontal offset
  80. Result[1]
  81. top left vertical offset
  82. Result[2]
  83. bottom right hotizontal offset
  84. Result[3]
  85. bottom right vertical offset
  86. -------------------------------------------------------------------------------
  87. Name CX2341X_OSD_SET_SCREEN_COORDS
  88. Enum 73/0x49
  89. Description
  90. Assign the coordinates of the screen area to blend with video
  91. Param[0]
  92. top left horizontal offset
  93. Param[1]
  94. top left vertical offset
  95. Param[2]
  96. bottom left horizontal offset
  97. Param[3]
  98. bottom left vertical offset
  99. -------------------------------------------------------------------------------
  100. Name CX2341X_OSD_GET_GLOBAL_ALPHA
  101. Enum 74/0x4A
  102. Description
  103. Retrieve OSD global alpha
  104. Result[0]
  105. global alpha: 0=off, 1=on
  106. Result[1]
  107. bits 0:7 global alpha
  108. -------------------------------------------------------------------------------
  109. Name CX2341X_OSD_SET_GLOBAL_ALPHA
  110. Enum 75/0x4B
  111. Description
  112. Update global alpha
  113. Param[0]
  114. global alpha: 0=off, 1=on
  115. Param[1]
  116. global alpha (8 bits)
  117. Param[2]
  118. local alpha: 0=on, 1=off
  119. -------------------------------------------------------------------------------
  120. Name CX2341X_OSD_SET_BLEND_COORDS
  121. Enum 78/0x4C
  122. Description
  123. Move start of blending area within display buffer
  124. Param[0]
  125. horizontal offset in buffer
  126. Param[1]
  127. vertical offset in buffer
  128. -------------------------------------------------------------------------------
  129. Name CX2341X_OSD_GET_FLICKER_STATE
  130. Enum 79/0x4F
  131. Description
  132. Retrieve flicker reduction module state
  133. Result[0]
  134. flicker state: 0=off, 1=on
  135. -------------------------------------------------------------------------------
  136. Name CX2341X_OSD_SET_FLICKER_STATE
  137. Enum 80/0x50
  138. Description
  139. Set flicker reduction module state
  140. Param[0]
  141. State: 0=off, 1=on
  142. -------------------------------------------------------------------------------
  143. Name CX2341X_OSD_BLT_COPY
  144. Enum 82/0x52
  145. Description
  146. BLT copy
  147. Param[0]
  148. '0000' zero
  149. '0001' ~destination AND ~source
  150. '0010' ~destination AND source
  151. '0011' ~destination
  152. '0100' destination AND ~source
  153. '0101' ~source
  154. '0110' destination XOR source
  155. '0111' ~destination OR ~source
  156. '1000' ~destination AND ~source
  157. '1001' destination XNOR source
  158. '1010' source
  159. '1011' ~destination OR source
  160. '1100' destination
  161. '1101' destination OR ~source
  162. '1110' destination OR source
  163. '1111' one
  164. Param[1]
  165. Resulting alpha blending
  166. '01' source_alpha
  167. '10' destination_alpha
  168. '11' source_alpha*destination_alpha+1
  169. (zero if both source and destination alpha are zero)
  170. Param[2]
  171. '00' output_pixel = source_pixel
  172. '01' if source_alpha=0:
  173. output_pixel = destination_pixel
  174. if 256 > source_alpha > 1:
  175. output_pixel = ((source_alpha + 1)*source_pixel +
  176. (255 - source_alpha)*destination_pixel)/256
  177. '10' if destination_alpha=0:
  178. output_pixel = source_pixel
  179. if 255 > destination_alpha > 0:
  180. output_pixel = ((255 - destination_alpha)*source_pixel +
  181. (destination_alpha + 1)*destination_pixel)/256
  182. '11' if source_alpha=0:
  183. source_temp = 0
  184. if source_alpha=255:
  185. source_temp = source_pixel*256
  186. if 255 > source_alpha > 0:
  187. source_temp = source_pixel*(source_alpha + 1)
  188. if destination_alpha=0:
  189. destination_temp = 0
  190. if destination_alpha=255:
  191. destination_temp = destination_pixel*256
  192. if 255 > destination_alpha > 0:
  193. destination_temp = destination_pixel*(destination_alpha + 1)
  194. output_pixel = (source_temp + destination_temp)/256
  195. Param[3]
  196. width
  197. Param[4]
  198. height
  199. Param[5]
  200. destination pixel mask
  201. Param[6]
  202. destination rectangle start address
  203. Param[7]
  204. destination stride in dwords
  205. Param[8]
  206. source stride in dwords
  207. Param[9]
  208. source rectangle start address
  209. -------------------------------------------------------------------------------
  210. Name CX2341X_OSD_BLT_FILL
  211. Enum 83/0x53
  212. Description
  213. BLT fill color
  214. Param[0]
  215. Same as Param[0] on API 0x52
  216. Param[1]
  217. Same as Param[1] on API 0x52
  218. Param[2]
  219. Same as Param[2] on API 0x52
  220. Param[3]
  221. width
  222. Param[4]
  223. height
  224. Param[5]
  225. destination pixel mask
  226. Param[6]
  227. destination rectangle start address
  228. Param[7]
  229. destination stride in dwords
  230. Param[8]
  231. color fill value
  232. -------------------------------------------------------------------------------
  233. Name CX2341X_OSD_BLT_TEXT
  234. Enum 84/0x54
  235. Description
  236. BLT for 8 bit alpha text source
  237. Param[0]
  238. Same as Param[0] on API 0x52
  239. Param[1]
  240. Same as Param[1] on API 0x52
  241. Param[2]
  242. Same as Param[2] on API 0x52
  243. Param[3]
  244. width
  245. Param[4]
  246. height
  247. Param[5]
  248. destination pixel mask
  249. Param[6]
  250. destination rectangle start address
  251. Param[7]
  252. destination stride in dwords
  253. Param[8]
  254. source stride in dwords
  255. Param[9]
  256. source rectangle start address
  257. Param[10]
  258. color fill value
  259. -------------------------------------------------------------------------------
  260. Name CX2341X_OSD_SET_FRAMEBUFFER_WINDOW
  261. Enum 86/0x56
  262. Description
  263. Positions the main output window on the screen. The coordinates must be
  264. such that the entire window fits on the screen.
  265. Param[0]
  266. window width
  267. Param[1]
  268. window height
  269. Param[2]
  270. top left window corner horizontal offset
  271. Param[3]
  272. top left window corner vertical offset
  273. -------------------------------------------------------------------------------
  274. Name CX2341X_OSD_SET_CHROMA_KEY
  275. Enum 96/0x60
  276. Description
  277. Chroma key switch and color
  278. Param[0]
  279. state: 0=off, 1=on
  280. Param[1]
  281. color
  282. -------------------------------------------------------------------------------
  283. Name CX2341X_OSD_GET_ALPHA_CONTENT_INDEX
  284. Enum 97/0x61
  285. Description
  286. Retrieve alpha content index
  287. Result[0]
  288. alpha content index, Range 0:15
  289. -------------------------------------------------------------------------------
  290. Name CX2341X_OSD_SET_ALPHA_CONTENT_INDEX
  291. Enum 98/0x62
  292. Description
  293. Assign alpha content index
  294. Param[0]
  295. alpha content index, range 0:15