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