fw-osd-api.txt 7.7 KB

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