aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/media/v4l-drivers/cx2341x.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/media/v4l-drivers/cx2341x.rst')
-rw-r--r--Documentation/media/v4l-drivers/cx2341x.rst564
1 files changed, 564 insertions, 0 deletions
diff --git a/Documentation/media/v4l-drivers/cx2341x.rst b/Documentation/media/v4l-drivers/cx2341x.rst
new file mode 100644
index 000000000000..6f4ac07f52cd
--- /dev/null
+++ b/Documentation/media/v4l-drivers/cx2341x.rst
@@ -0,0 +1,564 @@
1The cx2341x driver
2==================
3
4Decoder firmware API description
5--------------------------------
6
7.. note:: this API is part of the decoder firmware, so it's cx23415 only.
8
9
10
11CX2341X_DEC_PING_FW
12-------------------
13
14Enum: 0/0x00
15
16Description
17~~~~~~~~~~~
18
19This API call does nothing. It may be used to check if the firmware
20is responding.
21
22
23
24CX2341X_DEC_START_PLAYBACK
25--------------------------
26
27Enum: 1/0x01
28
29Description
30~~~~~~~~~~~
31
32Begin or resume playback.
33
34Param[0]
35~~~~~~~~
36
370 based frame number in GOP to begin playback from.
38
39Param[1]
40~~~~~~~~
41
42Specifies the number of muted audio frames to play before normal
43audio resumes. (This is not implemented in the firmware, leave at 0)
44
45
46
47CX2341X_DEC_STOP_PLAYBACK
48-------------------------
49
50Enum: 2/0x02
51
52Description
53~~~~~~~~~~~
54
55Ends playback and clears all decoder buffers. If PTS is not zero,
56playback stops at specified PTS.
57
58Param[0]
59~~~~~~~~
60
61Display 0=last frame, 1=black
62
63.. note::
64
65 this takes effect immediately, so if you want to wait for a PTS,
66 then use '0', otherwise the screen goes to black at once.
67 You can call this later (even if there is no playback) with a 1 value
68 to set the screen to black.
69
70Param[1]
71~~~~~~~~
72
73PTS low
74
75Param[2]
76~~~~~~~~
77
78PTS high
79
80
81
82CX2341X_DEC_SET_PLAYBACK_SPEED
83------------------------------
84
85Enum: 3/0x03
86
87Description
88~~~~~~~~~~~
89
90Playback stream at speed other than normal. There are two modes of
91operation:
92
93 - Smooth: host transfers entire stream and firmware drops unused
94 frames.
95 - Coarse: host drops frames based on indexing as required to achieve
96 desired speed.
97
98Param[0]
99~~~~~~~~
100
101.. code-block:: none
102
103 Bitmap:
104 0:7 0 normal
105 1 fast only "1.5 times"
106 n nX fast, 1/nX slow
107 30 Framedrop:
108 '0' during 1.5 times play, every other B frame is dropped
109 '1' during 1.5 times play, stream is unchanged (bitrate
110 must not exceed 8mbps)
111 31 Speed:
112 '0' slow
113 '1' fast
114
115.. note::
116
117 n is limited to 2. Anything higher does not result in
118 faster playback. Instead the host should start dropping frames.
119
120Param[1]
121~~~~~~~~
122
123Direction: 0=forward, 1=reverse
124
125.. note::
126
127 to make reverse playback work you have to write full GOPs in
128 reverse order.
129
130Param[2]
131~~~~~~~~
132
133.. code-block:: none
134
135 Picture mask:
136 1=I frames
137 3=I, P frames
138 7=I, P, B frames
139
140Param[3]
141~~~~~~~~
142
143B frames per GOP (for reverse play only)
144
145.. note::
146
147 for reverse playback the Picture Mask should be set to I or I, P.
148 Adding B frames to the mask will result in corrupt video. This field
149 has to be set to the correct value in order to keep the timing correct.
150
151Param[4]
152~~~~~~~~
153
154Mute audio: 0=disable, 1=enable
155
156Param[5]
157~~~~~~~~
158
159Display 0=frame, 1=field
160
161Param[6]
162~~~~~~~~
163
164Specifies the number of muted audio frames to play before normal audio
165resumes. (Not implemented in the firmware, leave at 0)
166
167
168
169CX2341X_DEC_STEP_VIDEO
170----------------------
171
172Enum: 5/0x05
173
174Description
175~~~~~~~~~~~
176
177Each call to this API steps the playback to the next unit defined below
178in the current playback direction.
179
180Param[0]
181~~~~~~~~
182
1830=frame, 1=top field, 2=bottom field
184
185
186
187CX2341X_DEC_SET_DMA_BLOCK_SIZE
188------------------------------
189
190Enum: 8/0x08
191
192Description
193~~~~~~~~~~~
194
195Set DMA transfer block size. Counterpart to API 0xC9
196
197Param[0]
198~~~~~~~~
199
200DMA transfer block size in bytes. A different size may be specified
201when issuing the DMA transfer command.
202
203
204
205CX2341X_DEC_GET_XFER_INFO
206-------------------------
207
208Enum: 9/0x09
209
210Description
211~~~~~~~~~~~
212
213This API call may be used to detect an end of stream condition.
214
215Result[0]
216~~~~~~~~~
217
218Stream type
219
220Result[1]
221~~~~~~~~~
222
223Address offset
224
225Result[2]
226~~~~~~~~~
227
228Maximum bytes to transfer
229
230Result[3]
231~~~~~~~~~
232
233Buffer fullness
234
235
236
237CX2341X_DEC_GET_DMA_STATUS
238--------------------------
239
240Enum: 10/0x0A
241
242Description
243~~~~~~~~~~~
244
245Status of the last DMA transfer
246
247Result[0]
248~~~~~~~~~
249
250Bit 1 set means transfer complete
251Bit 2 set means DMA error
252Bit 3 set means linked list error
253
254Result[1]
255~~~~~~~~~
256
257DMA type: 0=MPEG, 1=OSD, 2=YUV
258
259
260
261CX2341X_DEC_SCHED_DMA_FROM_HOST
262-------------------------------
263
264Enum: 11/0x0B
265
266Description
267~~~~~~~~~~~
268
269Setup DMA from host operation. Counterpart to API 0xCC
270
271Param[0]
272~~~~~~~~
273
274Memory address of link list
275
276Param[1]
277~~~~~~~~
278
279Total # of bytes to transfer
280
281Param[2]
282~~~~~~~~
283
284DMA type (0=MPEG, 1=OSD, 2=YUV)
285
286
287
288CX2341X_DEC_PAUSE_PLAYBACK
289--------------------------
290
291Enum: 13/0x0D
292
293Description
294~~~~~~~~~~~
295
296Freeze playback immediately. In this mode, when internal buffers are
297full, no more data will be accepted and data request IRQs will be
298masked.
299
300Param[0]
301~~~~~~~~
302
303Display: 0=last frame, 1=black
304
305
306
307CX2341X_DEC_HALT_FW
308-------------------
309
310Enum: 14/0x0E
311
312Description
313~~~~~~~~~~~
314
315The firmware is halted and no further API calls are serviced until
316the firmware is uploaded again.
317
318
319
320CX2341X_DEC_SET_STANDARD
321------------------------
322
323Enum: 16/0x10
324
325Description
326~~~~~~~~~~~
327
328Selects display standard
329
330Param[0]
331~~~~~~~~
332
3330=NTSC, 1=PAL
334
335
336
337CX2341X_DEC_GET_VERSION
338-----------------------
339
340Enum: 17/0x11
341
342Description
343~~~~~~~~~~~
344
345Returns decoder firmware version information
346
347Result[0]
348~~~~~~~~~
349
350Version bitmask:
351 - Bits 0:15 build
352 - Bits 16:23 minor
353 - Bits 24:31 major
354
355
356
357CX2341X_DEC_SET_STREAM_INPUT
358----------------------------
359
360Enum: 20/0x14
361
362Description
363~~~~~~~~~~~
364
365Select decoder stream input port
366
367Param[0]
368~~~~~~~~
369
3700=memory (default), 1=streaming
371
372
373
374CX2341X_DEC_GET_TIMING_INFO
375---------------------------
376
377Enum: 21/0x15
378
379Description
380~~~~~~~~~~~
381
382Returns timing information from start of playback
383
384Result[0]
385~~~~~~~~~
386
387Frame count by decode order
388
389Result[1]
390~~~~~~~~~
391
392Video PTS bits 0:31 by display order
393
394Result[2]
395~~~~~~~~~
396
397Video PTS bit 32 by display order
398
399Result[3]
400~~~~~~~~~
401
402SCR bits 0:31 by display order
403
404Result[4]
405~~~~~~~~~
406
407SCR bit 32 by display order
408
409
410
411CX2341X_DEC_SET_AUDIO_MODE
412--------------------------
413
414Enum: 22/0x16
415
416Description
417~~~~~~~~~~~
418
419Select audio mode
420
421Param[0]
422~~~~~~~~
423
424Dual mono mode action
425 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
426
427Param[1]
428~~~~~~~~
429
430Stereo mode action:
431 0=Stereo, 1=Left, 2=Right, 3=Mono, 4=Swap, -1=Unchanged
432
433
434
435CX2341X_DEC_SET_EVENT_NOTIFICATION
436----------------------------------
437
438Enum: 23/0x17
439
440Description
441~~~~~~~~~~~
442
443Setup firmware to notify the host about a particular event.
444Counterpart to API 0xD5
445
446Param[0]
447~~~~~~~~
448
449Event:
450 - 0=Audio mode change between mono, (joint) stereo and dual channel.
451 - 3=Decoder started
452 - 4=Unknown: goes off 10-15 times per second while decoding.
453 - 5=Some sync event: goes off once per frame.
454
455Param[1]
456~~~~~~~~
457
458Notification 0=disabled, 1=enabled
459
460Param[2]
461~~~~~~~~
462
463Interrupt bit
464
465Param[3]
466~~~~~~~~
467
468Mailbox slot, -1 if no mailbox required.
469
470
471
472CX2341X_DEC_SET_DISPLAY_BUFFERS
473-------------------------------
474
475Enum: 24/0x18
476
477Description
478~~~~~~~~~~~
479
480Number of display buffers. To decode all frames in reverse playback you
481must use nine buffers.
482
483Param[0]
484~~~~~~~~
485
4860=six buffers, 1=nine buffers
487
488
489
490CX2341X_DEC_EXTRACT_VBI
491-----------------------
492
493Enum: 25/0x19
494
495Description
496~~~~~~~~~~~
497
498Extracts VBI data
499
500Param[0]
501~~~~~~~~
502
5030=extract from extension & user data, 1=extract from private packets
504
505Result[0]
506~~~~~~~~~
507
508VBI table location
509
510Result[1]
511~~~~~~~~~
512
513VBI table size
514
515
516
517CX2341X_DEC_SET_DECODER_SOURCE
518------------------------------
519
520Enum: 26/0x1A
521
522Description
523~~~~~~~~~~~
524
525Selects decoder source. Ensure that the parameters passed to this
526API match the encoder settings.
527
528Param[0]
529~~~~~~~~
530
531Mode: 0=MPEG from host, 1=YUV from encoder, 2=YUV from host
532
533Param[1]
534~~~~~~~~
535
536YUV picture width
537
538Param[2]
539~~~~~~~~
540
541YUV picture height
542
543Param[3]
544~~~~~~~~
545
546Bitmap: see Param[0] of API 0xBD
547
548
549
550CX2341X_DEC_SET_PREBUFFERING
551----------------------------
552
553Enum: 30/0x1E
554
555Description
556~~~~~~~~~~~
557
558Decoder prebuffering, when enabled up to 128KB are buffered for
559streams <8mpbs or 640KB for streams >8mbps
560
561Param[0]
562~~~~~~~~
563
5640=off, 1=on