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