Annotation of margi2/cvdvtypes.h, revision 1.4
1.1 cvs 1: /*
2: cvdvtypes.h
3:
4: Copyright (C) Christian Wolff for convergence integrated media.
5:
6: This program is free software; you can redistribute it and/or modify
7: it under the terms of the GNU General Public License as published by
8: the Free Software Foundation; either version 2 of the License, or
9: (at your option) any later version.
10:
11: This program is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with this program; if not, write to the Free Software
18: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19: */
20:
21: /////////////////////////////////////////////////
22: // //
23: // Convergence Digital Video Decoder Card //
24: // External Definitions for the Char-Driver //
25: // Copyright (c) 1999 Christian Wolff / //
26: // convergence integrated media GmbH Berlin //
27: // //
28: /////////////////////////////////////////////////
29:
30: // As of 1999-11-09
31:
32: #ifndef _CVDVTYPE_H_
33: #define _CVDVTYPE_H_
34:
35: // our ioctl number: _IOC_TYPE() is 0xA2 (162) and the range of _IOC_NR() is 0x00 to 0x0F.
36: // submitted 99/10/15 to mec@shout.net
37: #define CVDV_IOCTL_MAGIC 0xA2
38:
39: // command numbers _IOC_NR() for ioctl
40: typedef enum {
41: IOCTL_DRAW = 0x01,
42: IOCTL_DECODER = 0x02
43: } IOCTL_Command;
44:
45:
46: // supported Videosystems
47: // everything but PAL and NTSC is untested and probably won't work.
48: typedef enum {
49: NTSC = 1, // NTSC 29.97 fps
50: NTSC60, // NTSC 30 fps
51: PAL, // PAL-B, D, G, H, I, 25 fps
52: PALM, // PAL-M 29.97 fps
53: PALM60, // PAL-M 30 fps
54: PALN, // PAL-N 25 fps
55: PALNc, // PAL-Nc 25 fps
56: PAL60 // PAL 30 fps (doesn't work, yet...)
57: } videosystem;
58:
59: typedef enum {
60: stream_none = 0, // unknown
61: stream_ES,
62: stream_PES,
63: stream_PS,
64: stream_DVD
65: } stream_type;
66:
67: typedef enum {
68: audio_disable = -1,
69: audio_none = 0, // unknown
70: audio_MPEG,
71: audio_MPEG_EXT,
72: audio_LPCM,
73: audio_AC3,
74: audio_DTS,
75: audio_SDDS
76: } audio_type;
77:
1.4 ! mocm 78: #if 0
1.1 cvs 79: typedef enum {
80: // All functions return -2 on "not open"
81: OSD_Close = 1, // ()
82: // Disables OSD and releases the buffers
83: // returns 0 on success
84: OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0))
85: // Opens OSD with this size and bit depth
86: // returns 0 on success, -1 on DRAM allocation error, -2 on "already open"
87: OSD_Show, // ()
88: // enables OSD mode
89: // returns 0 on success
90: OSD_Hide, // ()
91: // disables OSD mode
92: // returns 0 on success
93: OSD_Clear, // ()
94: // Sets all pixel to color 0
95: // returns 0 on success
96: OSD_Fill, // (color)
97: // Sets all pixel to color <col>
98: // returns 0 on success
99: OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1})
100: // set palette entry <num> to <r,g,b>, <mix> and <trans> apply
101: // R,G,B: 0..255
102: // R=Red, G=Green, B=Blue
103: // opacity=0: pixel opacity 0% (only video pixel shows)
104: // opacity=1..254: pixel opacity as specified in header
105: // opacity=255: pixel opacity 100% (only OSD pixel shows)
106: // returns 0 on success, -1 on error
107: OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data)
108: // Set a number of entries in the palette
109: // sets the entries "firstcolor" through "lastcolor" from the array "data"
110: // data has 4 byte for each color:
111: // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel
112: OSD_SetTrans, // (transparency{color})
113: // Sets transparency of mixed pixel (0..15)
114: // returns 0 on success
115: OSD_SetPixel, // (x0,y0,color)
116: // sets pixel <x>,<y> to color number <col>
117: // returns 0 on success, -1 on error
118: OSD_GetPixel, // (x0,y0)
119: // returns color number of pixel <x>,<y>, or -1
120: OSD_SetRow, // (x0,y0,x1,data)
121: // fills pixels x0,y through x1,y with the content of data[]
122: // returns 0 on success, -1 on clipping all pixel (no pixel drawn)
123: OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data)
124: // fills pixels x0,y0 through x1,y1 with the content of data[]
125: // inc contains the width of one line in the data block,
126: // inc<=0 uses blockwidth as linewidth
127: // returns 0 on success, -1 on clipping all pixel
128: OSD_FillRow, // (x0,y0,x1,color)
129: // fills pixels x0,y through x1,y with the color <col>
130: // returns 0 on success, -1 on clipping all pixel
131: OSD_FillBlock, // (x0,y0,x1,y1,color)
132: // fills pixels x0,y0 through x1,y1 with the color <col>
133: // returns 0 on success, -1 on clipping all pixel
134: OSD_Line, // (x0,y0,x1,y1,color)
135: // draw a line from x0,y0 to x1,y1 with the color <col>
136: // returns 0 on success
137: OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11
138: // fills parameters with the picture dimensions and the pixel aspect ratio
139: // returns 0 on success
140: OSD_Test // ()
141: // draws a test picture. for debugging purposes only
142: // returns 0 on success
143: // TODO: remove "test" in final version
144: } OSD_Command;
1.4 ! mocm 145:
1.1 cvs 146:
147: struct drawcmd {
148: OSD_Command cmd;
149: int x0;
150: int y0;
151: int x1;
152: int y1;
153: int color;
154: void *data;
155: };
1.4 ! mocm 156: #endif
1.1 cvs 157:
158: typedef enum {
159: Decoder_Pause, // pause{param1} 0=run 1=pause 2=toggle
160: Decoder_Still_Put, // (width{param1}, height{param2}, luma{data1}, chroma{data2})
161: // show still picture of specified size
162: // width; width of the image
163: // height; height of the image
164: // luma; Y values, one byte per pixel, width*height bytes
165: // chroma; 4:2:0 U and V values, interlaced, one byte each U, one byte each V, width*height/2 bytes
166: Decoder_Still_Get, // (width{param1}, height{param2}, luma{data1}, chroma{data2})
167: // grab current showing image
168: // width and height will be set to current picture size
169: // if luma and croma are NULL, only width and height will be reported
170: // otherwise the pixel data is filled in there, same format as Still_put
171: Decoder_Set_Videosystem, // (videosystem{param1})
172: // videosystem: see enum {} videosystem;
173: Decoder_Set_Streamtype, // (streamtype{param1})
174: // streamtype: according to enum {} stream_type;
175: // This has to be set BEFORE you send data to the device
176: // For ES and PES streams, Audio has to go into the first device (e.g.minor 0) and video into the second (e.g.minor 16)
177: Decoder_Set_Audiotype, // (audiotype{param1})
178: // audiotype: see enum {} audio_type, +16 for IEC956 on S/PDIF out
179: Decoder_Set_VideoStreamID, // (video stream ID {param1})
180: // video stream ID: MPEG ID 0..15 of video stream to display (E0..EF), -1 for any/auto
181: Decoder_Set_AudioStreamID, // (audio stream ID {param1}, audio extension stream ID {param2})
182: // audio stream ID: MPEG ID 0..31 of audio stream to display (C0..DF), -1 for any/auto
183: // audio extension stream ID: MPEG ID 0..31 of audio extension stream (C0..DF), -1 for none
184: Decoder_CSS, // Passes CSS information to and from the decoder
185: // action{param1},
186: // data block{data1} MSB first
187: // execute 1 to 4 once for each disc, then 5 to 8 for each title
188: // returns 0 on success, <0 on error
189: // -1: timeout reading data from card
190: // -2: data pointer not initialized
191: // -3: invalid action number
192: // action=0 -> disable and bypass CSS
193: // Disk key:
194: // action=1 -> retreive drive challenge (10 byte) from card
195: // action=2 -> post drive response (5 byte) to card
196: // action=3 -> post card challenge (10 byte) and retreive card response (5 byte)
197: // action=4 -> post disk key (2048 byte) into the card
198: // Title key:
199: // action=5 -> retreive title challenge (10 byte) from card
200: // action=6 -> post title response (5 byte) to card
201: // action=7 -> post card challenge (10 byte) and retreive card response (5 byte)
202: // action=8 -> post encrypted title key (5 byte) into the card
203: Decoder_Highlight, // post SPU Highlight information,
204: // active{param1}
205: // 1=show highlight, 0=hide highlight
206: // color information(SL_COLI or AC_COLI){data1[4]} MSB first
207: // bits: descr.
208: // 31-28 Emphasis pixel-2 color
209: // 27-24 Emphasis pixel-1 color
210: // 23-20 Pattern pixel color
211: // 19-16 Background pixel color
212: // 15-12 Emphasis pixel-2 contrast
213: // 11- 8 Emphasis pixel-1 contrast
214: // 7- 4 Pattern pixel contrast
215: // 3- 0 Background pixel contrast
216: // button position(BTN_POSI){data2[6]} MSB first
217: // bits: descr.
218: // 47-46 button color number
219: // 45-36 start x
220: // 33-24 end x
221: // 23-22 auto action mode
222: // 21-12 start y
223: // 9- 0 end y
224: Decoder_SPU, // Activate SPU decoding and select SPU stream ID
225: // stream{param1}
226: // active{param2}
227: Decoder_SPU_Palette, // post SPU Palette information
228: // length{param1}
229: // palette{data1}
230: Decoder_GetNavi, // Retreives CSS-decrypted navigational information from the stream.
231: // data1 will be filled with PCI or DSI pack (private stream 2 stream_id),
232: // and the length of data1 (1024 or 0) will be returned
233: Decoder_SetKaraoke, // Vocal1{param1}, Vocal2{param2}, Melody{param3}
234: // if Vocal1 or Vocal2 are non-zero, they get mixed into left and right at 70% each
235: // if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets mixed into the left channel and
236: // Vocal2 into the right channel at 100% each.
237: // if Melody is non-zero, the melody channel gets mixed into left and right
238: Decoder_Set_Videoattribute, // Set the video parameters
239: // attribute{param1} (2 byte V_ATR)
240: // bits: descr.
241: // 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2)
242: // 13-12 TV system (0=525/60, 1=625/50)
243: // 11-10 Aspect ratio (0=4:3, 3=16:9)
244: // 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-scan, 2=only letterbox)
245: // 7 line 21-1 data present in GOP (1=yes, 0=no)
246: // 6 line 21-2 data present in GOP (1=yes, 0=no)
247: // 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/576, 3=352x240/288)
248: // 2 source letterboxed (1=yes, 0=no)
249: // 0 film/camera mode (0=camera, 1=film (625/50 only))
250: Decoder_Set_Audioattribute, // Set the audio parameters
251: // attribute{param1} (2 most significan bytes of A_ATR (bit 63 through 48))
252: // bits: descr.
253: // 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, 7=SDDS)
254: // 12 multichannel extension
255: // 11-10 audio type (0=not spec, 1=language included)
256: // 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround)
257: // 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, 1=20bit, 2=24bit)
258: // 5- 4 Sample frequency fs (0=48kHz, 1=96kHz)
259: // 2- 0 number of audio channels (n+1 channels)
1.2 mocm 260: Decoder_WriteBlock, // Post one block of data, e.g. one DVD sector of 2048 byte, into the decoder queue
1.1 cvs 261: // sectordata{data1}
262: // length{param1}
263: // is_initial_block{param2}
264: // set_SCR{param3}
1.2 mocm 265: /*
266: Decoder_FFWD, // ffwd{param1} 0=normal 1=ffwd 2=toggle
267: Decoder_Slow // slow{param1} 0=normal 1=slow 2=toggle
268: */
1.1 cvs 269: } Decoder_Command;
270:
271: struct decodercmd {
272: Decoder_Command cmd;
273: int param1;
274: int param2;
275: int param3;
276: int param4;
277: int param5;
278: void *data1;
279: void *data2;
280: };
281:
282: #endif // _CVDVTYPE_H_
LinuxTV legacy CVS <linuxtv.org/cvs>