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