VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / usb / media / pwc-uncompress.h
1 /* (C) 1999-2003 Nemosoft Unv. (webcam@smcc.demon.nl)
2
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; either version 2 of the License, or
6    (at your option) any later version.
7
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.
12
13    You should have received a copy of the GNU General Public License
14    along with this program; if not, write to the Free Software
15    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16 */
17
18 /* This file is the bridge between the kernel module and the plugin; it
19    describes the structures and datatypes used in both modules. Any
20    significant change should be reflected by increasing the 
21    pwc_decompressor_version major number.
22  */
23 #ifndef PWC_UNCOMPRESS_H
24 #define PWC_UNCOMPRESS_H
25
26 #include <linux/config.h>
27 #include <linux/linkage.h>
28 #include <linux/list.h>
29
30 #include "pwc-ioctl.h"
31
32 /* from pwc-dec.h */
33 #define PWCX_FLAG_PLANAR        0x0001
34 /* */
35
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /* The decompressor structure. 
42    Every type of decompressor registers itself with the main module. 
43    When a device is opened, it looks up the correct compressor, and
44    uses that when a compressed video mode is requested.
45  */
46 struct pwc_decompressor
47 {
48         int  type;              /* type of camera (645, 680, etc) */
49         int  table_size;        /* memory needed */
50
51         void (* init)(int type, int release, void *buffer, void *table);        /* Initialization routine; should be called after each set_video_mode */
52         void (* exit)(void);    /* Cleanup routine */
53         void (* decompress)(struct pwc_coord *image, struct pwc_coord *view,
54                             struct pwc_coord *offset,
55                             void *src, void *dst, int flags,
56                             void *table, int bandlength);
57         void (* lock)(void);    /* make sure module cannot be unloaded */
58         void (* unlock)(void);  /* release lock on module */
59
60         struct list_head pwcd_list;
61 };
62
63
64 /* Our structure version number. Is set to the version number major */
65 extern const int pwc_decompressor_version;
66
67 /* Adds decompressor to list, based on its 'type' field (which matches the 'type' field in pwc_device; ignores any double requests */
68 extern void pwc_register_decompressor(struct pwc_decompressor *pwcd);
69 /* Removes decompressor, based on the type number */
70 extern void pwc_unregister_decompressor(int type);
71 /* Returns pointer to decompressor struct, or NULL if it doesn't exist */
72 extern struct pwc_decompressor *pwc_find_decompressor(int type);
73
74 #ifdef CONFIG_USB_PWCX
75 /* If the decompressor is compiled in, we must call these manually */
76 extern int usb_pwcx_init(void);
77 extern void usb_pwcx_exit(void);
78 #endif
79
80 #ifdef __cplusplus
81 }
82 #endif
83
84 #endif