blob: 15c388b8bd195efaa57ca780af1c50687194d739 [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
Hans Verkuile12ceaf2006-12-18 13:06:30 -030035 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 Chehab447d6fb2006-05-22 10:31:37 -030039Param[1]
40 PTS low
41Param[2]
42 PTS high
43
44-------------------------------------------------------------------------------
45
46Name CX2341X_DEC_SET_PLAYBACK_SPEED
47Enum 3/0x03
48Description
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.
55Param[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 Verkuile12ceaf2006-12-18 13:06:30 -030067 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 Chehab447d6fb2006-05-22 10:31:37 -030069Param[1]
70 Direction: 0=forward, 1=reverse
Hans Verkuile12ceaf2006-12-18 13:06:30 -030071 Note: to make reverse playback work you have to write full GOPs in
72 reverse order.
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -030073Param[2]
74 Picture mask:
75 1=I frames
76 3=I, P frames
77 7=I, P, B frames
78Param[3]
79 B frames per GOP (for reverse play only)
Hans Verkuile12ceaf2006-12-18 13:06:30 -030080 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 Chehab447d6fb2006-05-22 10:31:37 -030082Param[4]
83 Mute audio: 0=disable, 1=enable
84Param[5]
85 Display 0=frame, 1=field
86Param[6]
87 Specifies the number of muted audio frames to play before normal audio
88 resumes.
89
90-------------------------------------------------------------------------------
91
92Name CX2341X_DEC_STEP_VIDEO
93Enum 5/0x05
94Description
95 Each call to this API steps the playback to the next unit defined below
96 in the current playback direction.
97Param[0]
98 0=frame, 1=top field, 2=bottom field
99
100-------------------------------------------------------------------------------
101
102Name CX2341X_DEC_SET_DMA_BLOCK_SIZE
103Enum 8/0x08
104Description
105 Set DMA transfer block size. Counterpart to API 0xC9
106Param[0]
107 DMA transfer block size in bytes. A different size may be specified
108 when issuing the DMA transfer command.
109
110-------------------------------------------------------------------------------
111
112Name CX2341X_DEC_GET_XFER_INFO
113Enum 9/0x09
114Description
Matt LaPlante6c28f2c2006-10-03 22:46:31 +0200115 This API call may be used to detect an end of stream condition.
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -0300116Result[0]
117 Stream type
118Result[1]
119 Address offset
120Result[2]
121 Maximum bytes to transfer
122Result[3]
123 Buffer fullness
124
125-------------------------------------------------------------------------------
126
127Name CX2341X_DEC_GET_DMA_STATUS
128Enum 10/0x0A
129Description
130 Status of the last DMA transfer
131Result[0]
132 Bit 1 set means transfer complete
133 Bit 2 set means DMA error
134 Bit 3 set means linked list error
135Result[1]
136 DMA type: 0=MPEG, 1=OSD, 2=YUV
137
138-------------------------------------------------------------------------------
139
140Name CX2341X_DEC_SCHED_DMA_FROM_HOST
141Enum 11/0x0B
142Description
143 Setup DMA from host operation. Counterpart to API 0xCC
144Param[0]
145 Memory address of link list
146Param[1]
147 Total # of bytes to transfer
148Param[2]
149 DMA type (0=MPEG, 1=OSD, 2=YUV)
150
151-------------------------------------------------------------------------------
152
153Name CX2341X_DEC_PAUSE_PLAYBACK
154Enum 13/0x0D
155Description
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.
159Param[0]
160 Display: 0=last frame, 1=black
161
162-------------------------------------------------------------------------------
163
164Name CX2341X_DEC_HALT_FW
165Enum 14/0x0E
166Description
167 The firmware is halted and no further API calls are serviced until
168 the firmware is uploaded again.
169
170-------------------------------------------------------------------------------
171
172Name CX2341X_DEC_SET_STANDARD
173Enum 16/0x10
174Description
175 Selects display standard
176Param[0]
177 0=NTSC, 1=PAL
178
179-------------------------------------------------------------------------------
180
181Name CX2341X_DEC_GET_VERSION
182Enum 17/0x11
183Description
184 Returns decoder firmware version information
185Result[0]
186 Version bitmask:
187 Bits 0:15 build
188 Bits 16:23 minor
189 Bits 24:31 major
190
191-------------------------------------------------------------------------------
192
193Name CX2341X_DEC_SET_STREAM_INPUT
194Enum 20/0x14
195Description
196 Select decoder stream input port
197Param[0]
198 0=memory (default), 1=streaming
199
200-------------------------------------------------------------------------------
201
202Name CX2341X_DEC_GET_TIMING_INFO
203Enum 21/0x15
204Description
205 Returns timing information from start of playback
206Result[0]
207 Frame count by decode order
208Result[1]
209 Video PTS bits 0:31 by display order
210Result[2]
211 Video PTS bit 32 by display order
212Result[3]
213 SCR bits 0:31 by display order
214Result[4]
215 SCR bit 32 by display order
216
217-------------------------------------------------------------------------------
218
219Name CX2341X_DEC_SET_AUDIO_MODE
220Enum 22/0x16
221Description
222 Select audio mode
223Param[0]
224 Dual mono mode action
Hans Verkuile12ceaf2006-12-18 13:06:30 -0300225 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -0300226Param[1]
227 Stereo mode action:
228 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
229
230-------------------------------------------------------------------------------
231
232Name CX2341X_DEC_SET_EVENT_NOTIFICATION
233Enum 23/0x17
234Description
235 Setup firmware to notify the host about a particular event.
236 Counterpart to API 0xD5
237Param[0]
238 Event: 0=Audio mode change between stereo and dual channel
Hans Verkuile12ceaf2006-12-18 13:06:30 -0300239 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 Chehab447d6fb2006-05-22 10:31:37 -0300242Param[1]
243 Notification 0=disabled, 1=enabled
244Param[2]
245 Interrupt bit
246Param[3]
247 Mailbox slot, -1 if no mailbox required.
248
249-------------------------------------------------------------------------------
250
251Name CX2341X_DEC_SET_DISPLAY_BUFFERS
252Enum 24/0x18
253Description
254 Number of display buffers. To decode all frames in reverse playback you
255 must use nine buffers.
256Param[0]
257 0=six buffers, 1=nine buffers
258
259-------------------------------------------------------------------------------
260
261Name CX2341X_DEC_EXTRACT_VBI
262Enum 25/0x19
263Description
264 Extracts VBI data
265Param[0]
266 0=extract from extension & user data, 1=extract from private packets
267Result[0]
268 VBI table location
269Result[1]
270 VBI table size
271
272-------------------------------------------------------------------------------
273
274Name CX2341X_DEC_SET_DECODER_SOURCE
275Enum 26/0x1A
276Description
277 Selects decoder source. Ensure that the parameters passed to this
278 API match the encoder settings.
279Param[0]
280 Mode: 0=MPEG from host, 1=YUV from encoder, 2=YUV from host
281Param[1]
282 YUV picture width
283Param[2]
284 YUV picture height
285Param[3]
286 Bitmap: see Param[0] of API 0xBD
287
288-------------------------------------------------------------------------------
289
290Name CX2341X_DEC_SET_AUDIO_OUTPUT
291Enum 27/0x1B
292Description
293 Select audio output format
294Param[0]
295 Bitmask:
296 0:1 Data size:
Trent Piepho657de3c2006-06-20 00:30:57 -0300297 '00' 16 bit
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -0300298 '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 Piepho657de3c2006-06-20 00:30:57 -0300309 '00' right justified MSB first mode
310 '01' left justified MSB first mode
311 '10' I2S mode
Mauro Carvalho Chehab447d6fb2006-05-22 10:31:37 -0300312 14:15 Unused
313 16:21 Right justify bit count
314 22:31 Unused
315
316-------------------------------------------------------------------------------
317
318Name CX2341X_DEC_SET_AV_DELAY
319Enum 28/0x1C
320Description
321 Set audio/video delay in 90Khz ticks
322Param[0]
323 0=A/V in sync, negative=audio lags, positive=video lags
324
325-------------------------------------------------------------------------------
326
327Name CX2341X_DEC_SET_PREBUFFERING
328Enum 30/0x1E
329Description
330 Decoder prebuffering, when enabled up to 128KB are buffered for
331 streams <8mpbs or 640KB for streams >8mbps
332Param[0]
333 0=off, 1=on