summaryrefslogtreecommitdiffstats
path: root/Documentation/video4linux/cx2341x/fw-osd-api.txt
blob: da98ae30a37a2ecd62c3d304115eb91483029625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
OSD firmware API description
============================

Note: this API is part of the decoder firmware, so it's cx23415 only.

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_FRAMEBUFFER
Enum 	65/0x41
Description
	Return base and length of contiguous OSD memory.
Result[0]
	OSD base address
Result[1]
	OSD length

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_PIXEL_FORMAT
Enum 	66/0x42
Description
	Query OSD format
Result[0]
	0=8bit index, 4=AlphaRGB 8:8:8:8

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_PIXEL_FORMAT
Enum 	67/0x43
Description
	Assign pixel format
Param[0]
	0=8bit index, 4=AlphaRGB 8:8:8:8

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_STATE
Enum 	68/0x44
Description
	Query OSD state
Result[0]
	Bit  0   0=off, 1=on
	Bits 1:2 alpha control
	Bits 3:5 pixel format

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_STATE
Enum 	69/0x45
Description
	OSD switch
Param[0]
	0=off, 1=on

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_OSD_COORDS
Enum 	70/0x46
Description
	Retrieve coordinates of OSD area blended with video
Result[0]
	OSD buffer address
Result[1]
	Stride in pixels
Result[2]
	Lines in OSD buffer
Result[3]
	Horizontal offset in buffer
Result[4]
	Vertical offset in buffer

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_OSD_COORDS
Enum 	71/0x47
Description
	Assign the coordinates of the OSD area to blend with video
Param[0]
	buffer address
Param[1]
	buffer stride in pixels
Param[2]
	lines in buffer
Param[3]
	horizontal offset
Param[4]
	vertical offset

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_SCREEN_COORDS
Enum 	72/0x48
Description
	Retrieve OSD screen area coordinates
Result[0]
	top left horizontal offset
Result[1]
	top left vertical offset
Result[2]
	bottom right hotizontal offset
Result[3]
	bottom right vertical offset

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_SCREEN_COORDS
Enum 	73/0x49
Description
	Assign the coordinates of the screen area to blend with video
Param[0]
	top left horizontal offset
Param[1]
	top left vertical offset
Param[2]
	bottom left horizontal offset
Param[3]
	bottom left vertical offset

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_GLOBAL_ALPHA
Enum 	74/0x4A
Description
	Retrieve OSD global alpha
Result[0]
	global alpha: 0=off, 1=on
Result[1]
	bits 0:7 global alpha

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_GLOBAL_ALPHA
Enum 	75/0x4B
Description
	Update global alpha
Param[0]
	global alpha: 0=off, 1=on
Param[1]
	global alpha (8 bits)
Param[2]
	local alpha: 0=on, 1=off

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_BLEND_COORDS
Enum 	78/0x4C
Description
	Move start of blending area within display buffer
Param[0]
	horizontal offset in buffer
Param[1]
	vertical offset in buffer

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_FLICKER_STATE
Enum 	79/0x4F
Description
	Retrieve flicker reduction module state
Result[0]
	flicker state: 0=off, 1=on

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_FLICKER_STATE
Enum 	80/0x50
Description
	Set flicker reduction module state
Param[0]
	State: 0=off, 1=on

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_BLT_COPY
Enum 	82/0x52
Description
	BLT copy
Param[0]
'0000'  zero
'0001' ~destination AND ~source
'0010' ~destination AND  source
'0011' ~destination
'0100'  destination AND ~source
'0101'                  ~source
'0110'  destination XOR  source
'0111' ~destination OR  ~source
'1000' ~destination AND ~source
'1001'  destination XNOR source
'1010'                   source
'1011' ~destination OR   source
'1100'  destination
'1101'  destination OR  ~source
'1110'  destination OR   source
'1111'  one

Param[1]
	Resulting alpha blending
	    '01' source_alpha
	    '10' destination_alpha
	    '11' source_alpha*destination_alpha+1
		 (zero if both source and destination alpha are zero)
Param[2]
	'00' output_pixel = source_pixel

	'01' if source_alpha=0:
		 output_pixel = destination_pixel
	     if 256 > source_alpha > 1:
		 output_pixel = ((source_alpha + 1)*source_pixel +
				 (255 - source_alpha)*destination_pixel)/256

	'10' if destination_alpha=0:
		 output_pixel = source_pixel
	      if 255 > destination_alpha > 0:
		 output_pixel = ((255 - destination_alpha)*source_pixel +
				 (destination_alpha + 1)*destination_pixel)/256

	'11' if source_alpha=0:
		 source_temp = 0
	     if source_alpha=255:
		 source_temp = source_pixel*256
	     if 255 > source_alpha > 0:
		 source_temp = source_pixel*(source_alpha + 1)
	     if destination_alpha=0:
		 destination_temp = 0
	     if destination_alpha=255:
		 destination_temp = destination_pixel*256
	     if 255 > destination_alpha > 0:
		 destination_temp = destination_pixel*(destination_alpha + 1)
	     output_pixel = (source_temp + destination_temp)/256
Param[3]
	width
Param[4]
	height
Param[5]
	destination pixel mask
Param[6]
	destination rectangle start address
Param[7]
	destination stride in dwords
Param[8]
	source stride in dwords
Param[9]
	source rectangle start address

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_BLT_FILL
Enum 	83/0x53
Description
	BLT fill color
Param[0]
	Same as Param[0] on API 0x52
Param[1]
	Same as Param[1] on API 0x52
Param[2]
	Same as Param[2] on API 0x52
Param[3]
	width
Param[4]
	height
Param[5]
	destination pixel mask
Param[6]
	destination rectangle start address
Param[7]
	destination stride in dwords
Param[8]
	color fill value

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_BLT_TEXT
Enum 	84/0x54
Description
	BLT for 8 bit alpha text source
Param[0]
	Same as Param[0] on API 0x52
Param[1]
	Same as Param[1] on API 0x52
Param[2]
	Same as Param[2] on API 0x52
Param[3]
	width
Param[4]
	height
Param[5]
	destination pixel mask
Param[6]
	destination rectangle start address
Param[7]
	destination stride in dwords
Param[8]
	source stride in dwords
Param[9]
	source rectangle start address
Param[10]
	color fill value

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_FRAMEBUFFER_WINDOW
Enum 	86/0x56
Description
	Positions the main output window on the screen. The coordinates must be
	such that the entire window fits on the screen.
Param[0]
	window width
Param[1]
	window height
Param[2]
	top left window corner horizontal offset
Param[3]
	top left window corner vertical offset

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_CHROMA_KEY
Enum 	96/0x60
Description
	Chroma key switch and color
Param[0]
	state: 0=off, 1=on
Param[1]
	color

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_GET_ALPHA_CONTENT_INDEX
Enum 	97/0x61
Description
	Retrieve alpha content index
Result[0]
	alpha content index, Range 0:15

-------------------------------------------------------------------------------

Name 	CX2341X_OSD_SET_ALPHA_CONTENT_INDEX
Enum 	98/0x62
Description
	Assign alpha content index
Param[0]
	alpha content index, range 0:15
OpenPOWER on IntegriCloud