~ubuntu-branches/debian/sid/v4l-utils/sid

« back to all changes in this revision

Viewing changes to lib/libv4lconvert/libv4lconvert-priv.h

  • Committer: Bazaar Package Importer
  • Author(s): Gregor Jasny
  • Date: 2010-05-07 20:48:34 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100507204834-ga01cxhz3fekk47r
Tags: 0.8.0-1
* New upstream version
* Switch to 3.0 (quilt) source format
* Re-enable pristine-tar
* Split utils package into command line and the Qt based qv4l2
  (Closes: #576422)
* Update upstream URL

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# You should have received a copy of the GNU Lesser General Public License
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
 
*/
 
17
 */
18
18
 
19
19
#ifndef __LIBV4LCONVERT_PRIV_H
20
20
#define __LIBV4LCONVERT_PRIV_H
32
32
#define V4LCONVERT_MAX_FRAMESIZES 16
33
33
 
34
34
#define V4LCONVERT_ERR(...) \
35
 
  snprintf(data->error_msg, V4LCONVERT_ERROR_MSG_SIZE, \
36
 
  "v4l-convert: error " __VA_ARGS__)
 
35
        snprintf(data->error_msg, V4LCONVERT_ERROR_MSG_SIZE, \
 
36
                        "v4l-convert: error " __VA_ARGS__)
37
37
 
38
38
/* Card flags */
39
39
#define V4LCONVERT_IS_UVC                0x01
45
45
#define V4LCONVERT_COMPRESSED_AND_NEEDS_CONVERSION 0x03
46
46
 
47
47
struct v4lconvert_data {
48
 
  int fd;
49
 
  int flags; /* bitfield */
50
 
  int control_flags; /* bitfield */
51
 
  int supported_src_formats; /* bitfield */
52
 
  unsigned int no_formats;
53
 
  char error_msg[V4LCONVERT_ERROR_MSG_SIZE];
54
 
  struct jdec_private *jdec;
55
 
  struct v4l2_frmsizeenum framesizes[V4LCONVERT_MAX_FRAMESIZES];
56
 
  unsigned int no_framesizes;
57
 
  int convert1_buf_size;
58
 
  int convert2_buf_size;
59
 
  int rotate90_buf_size;
60
 
  int flip_buf_size;
61
 
  int convert_pixfmt_buf_size;
62
 
  unsigned char *convert1_buf;
63
 
  unsigned char *convert2_buf;
64
 
  unsigned char *rotate90_buf;
65
 
  unsigned char *flip_buf;
66
 
  unsigned char *convert_pixfmt_buf;
67
 
  struct v4lcontrol_data *control;
68
 
  struct v4lprocessing_data *processing;
69
 
 
70
 
  /* Data for external decompression helpers code */
71
 
  pid_t decompress_pid;
72
 
  int decompress_in_pipe[2];  /* Data from helper to us */
73
 
  int decompress_out_pipe[2]; /* Data from us to helper */
74
 
 
75
 
  /* For mr97310a decoder */
76
 
  int frames_dropped;
77
 
 
78
 
  /* For cpia1 decoder */
79
 
  unsigned char* previous_frame;
 
48
        int fd;
 
49
        int flags; /* bitfield */
 
50
        int control_flags; /* bitfield */
 
51
        int supported_src_formats; /* bitfield */
 
52
        unsigned int no_formats;
 
53
        char error_msg[V4LCONVERT_ERROR_MSG_SIZE];
 
54
        struct jdec_private *jdec;
 
55
        struct v4l2_frmsizeenum framesizes[V4LCONVERT_MAX_FRAMESIZES];
 
56
        unsigned int no_framesizes;
 
57
        int convert1_buf_size;
 
58
        int convert2_buf_size;
 
59
        int rotate90_buf_size;
 
60
        int flip_buf_size;
 
61
        int convert_pixfmt_buf_size;
 
62
        unsigned char *convert1_buf;
 
63
        unsigned char *convert2_buf;
 
64
        unsigned char *rotate90_buf;
 
65
        unsigned char *flip_buf;
 
66
        unsigned char *convert_pixfmt_buf;
 
67
        struct v4lcontrol_data *control;
 
68
        struct v4lprocessing_data *processing;
 
69
 
 
70
        /* Data for external decompression helpers code */
 
71
        pid_t decompress_pid;
 
72
        int decompress_in_pipe[2];  /* Data from helper to us */
 
73
        int decompress_out_pipe[2]; /* Data from us to helper */
 
74
 
 
75
        /* For mr97310a decoder */
 
76
        int frames_dropped;
 
77
 
 
78
        /* For cpia1 decoder */
 
79
        unsigned char *previous_frame;
80
80
};
81
81
 
82
82
struct v4lconvert_pixfmt {
83
 
  unsigned int fmt;
84
 
  int flags;
 
83
        unsigned int fmt;
 
84
        int flags;
85
85
};
86
86
 
87
87
void v4lconvert_fixup_fmt(struct v4l2_format *fmt);
88
88
 
89
89
unsigned char *v4lconvert_alloc_buffer(int needed,
90
 
  unsigned char **buf, int *buf_size);
 
90
                unsigned char **buf, int *buf_size);
91
91
 
92
92
void v4lconvert_rgb24_to_yuv420(const unsigned char *src, unsigned char *dest,
93
 
  const struct v4l2_format *src_fmt, int bgr, int yvu);
 
93
                const struct v4l2_format *src_fmt, int bgr, int yvu);
94
94
 
95
95
void v4lconvert_yuv420_to_rgb24(const unsigned char *src, unsigned char *dst,
96
 
  int width, int height, int yvu);
 
96
                int width, int height, int yvu);
97
97
 
98
98
void v4lconvert_yuv420_to_bgr24(const unsigned char *src, unsigned char *dst,
99
 
  int width, int height, int yvu);
 
99
                int width, int height, int yvu);
100
100
 
101
101
void v4lconvert_yuyv_to_rgb24(const unsigned char *src, unsigned char *dst,
102
 
  int width, int height);
 
102
                int width, int height);
103
103
 
104
104
void v4lconvert_yuyv_to_bgr24(const unsigned char *src, unsigned char *dst,
105
 
  int width, int height);
 
105
                int width, int height);
106
106
 
107
107
void v4lconvert_yuyv_to_yuv420(const unsigned char *src, unsigned char *dst,
108
 
  int width, int height, int yvu);
 
108
                int width, int height, int yvu);
109
109
 
110
110
void v4lconvert_yvyu_to_rgb24(const unsigned char *src, unsigned char *dst,
111
 
  int width, int height);
 
111
                int width, int height);
112
112
 
113
113
void v4lconvert_yvyu_to_bgr24(const unsigned char *src, unsigned char *dst,
114
 
  int width, int height);
 
114
                int width, int height);
115
115
 
116
116
void v4lconvert_uyvy_to_rgb24(const unsigned char *src, unsigned char *dst,
117
 
  int width, int height);
 
117
                int width, int height);
118
118
 
119
119
void v4lconvert_uyvy_to_bgr24(const unsigned char *src, unsigned char *dst,
120
 
  int width, int height);
 
120
                int width, int height);
121
121
 
122
122
void v4lconvert_uyvy_to_yuv420(const unsigned char *src, unsigned char *dst,
123
 
  int width, int height, int yvu);
 
123
                int width, int height, int yvu);
124
124
 
125
125
void v4lconvert_swap_rgb(const unsigned char *src, unsigned char *dst,
126
 
  int width, int height);
 
126
                int width, int height);
127
127
 
128
128
void v4lconvert_swap_uv(const unsigned char *src, unsigned char *dst,
129
 
  const struct v4l2_format *src_fmt);
 
129
                const struct v4l2_format *src_fmt);
130
130
 
131
131
void v4lconvert_rgb565_to_rgb24(const unsigned char *src, unsigned char *dest,
132
 
  int width, int height);
 
132
                int width, int height);
133
133
 
134
134
void v4lconvert_rgb565_to_bgr24(const unsigned char *src, unsigned char *dest,
135
 
  int width, int height);
 
135
                int width, int height);
136
136
 
137
137
void v4lconvert_rgb565_to_yuv420(const unsigned char *src, unsigned char *dest,
138
 
  const struct v4l2_format *src_fmt, int yvu);
 
138
                const struct v4l2_format *src_fmt, int yvu);
139
139
 
140
140
void v4lconvert_spca501_to_yuv420(const unsigned char *src, unsigned char *dst,
141
 
  int width, int height, int yvu);
 
141
                int width, int height, int yvu);
142
142
 
143
143
void v4lconvert_spca505_to_yuv420(const unsigned char *src, unsigned char *dst,
144
 
  int width, int height, int yvu);
 
144
                int width, int height, int yvu);
145
145
 
146
146
void v4lconvert_spca508_to_yuv420(const unsigned char *src, unsigned char *dst,
147
 
  int width, int height, int yvu);
 
147
                int width, int height, int yvu);
148
148
 
149
149
int v4lconvert_cpia1_to_yuv420(struct v4lconvert_data *data,
150
 
  const unsigned char *src, int src_size,
151
 
  unsigned char *dst, int width, int height, int yvu);
 
150
                const unsigned char *src, int src_size,
 
151
                unsigned char *dst, int width, int height, int yvu);
152
152
 
153
153
void v4lconvert_sn9c20x_to_yuv420(const unsigned char *src, unsigned char *dst,
154
 
  int width, int height, int yvu);
 
154
                int width, int height, int yvu);
155
155
 
156
156
void v4lconvert_decode_spca561(const unsigned char *src, unsigned char *dst,
157
 
  int width, int height);
 
157
                int width, int height);
158
158
 
159
159
void v4lconvert_decode_sn9c10x(const unsigned char *src, unsigned char *dst,
160
 
  int width, int height);
 
160
                int width, int height);
161
161
 
162
162
int v4lconvert_decode_pac207(struct v4lconvert_data *data,
163
 
  const unsigned char *inp, int src_size, unsigned char *outp,
164
 
  int width, int height);
 
163
                const unsigned char *inp, int src_size, unsigned char *outp,
 
164
                int width, int height);
165
165
 
166
166
int v4lconvert_decode_mr97310a(struct v4lconvert_data *data,
167
 
  const unsigned char *src, int src_size, unsigned char *dst,
168
 
  int width, int height);
 
167
                const unsigned char *src, int src_size, unsigned char *dst,
 
168
                int width, int height);
169
169
 
170
170
void v4lconvert_decode_sn9c2028(const unsigned char *src, unsigned char *dst,
171
 
  int width, int height);
 
171
                int width, int height);
172
172
 
173
173
void v4lconvert_decode_sq905c(const unsigned char *src, unsigned char *dst,
174
 
  int width, int height);
 
174
                int width, int height);
175
175
 
176
176
void v4lconvert_decode_stv0680(const unsigned char *src, unsigned char *dst,
177
 
  int width, int height);
 
177
                int width, int height);
178
178
 
179
179
void v4lconvert_bayer_to_rgb24(const unsigned char *bayer,
180
 
  unsigned char *rgb, int width, int height, unsigned int pixfmt);
 
180
                unsigned char *rgb, int width, int height, unsigned int pixfmt);
181
181
 
182
182
void v4lconvert_bayer_to_bgr24(const unsigned char *bayer,
183
 
  unsigned char *rgb, int width, int height, unsigned int pixfmt);
 
183
                unsigned char *rgb, int width, int height, unsigned int pixfmt);
184
184
 
185
185
void v4lconvert_bayer_to_yuv420(const unsigned char *bayer, unsigned char *yuv,
186
 
  int width, int height, unsigned int src_pixfmt, int yvu);
 
186
                int width, int height, unsigned int src_pixfmt, int yvu);
187
187
 
188
188
void v4lconvert_hm12_to_rgb24(const unsigned char *src,
189
 
  unsigned char *dst, int width, int height);
 
189
                unsigned char *dst, int width, int height);
190
190
 
191
191
void v4lconvert_hm12_to_bgr24(const unsigned char *src,
192
 
  unsigned char *dst, int width, int height);
 
192
                unsigned char *dst, int width, int height);
193
193
 
194
194
void v4lconvert_hm12_to_yuv420(const unsigned char *src,
195
 
  unsigned char *dst, int width, int height, int yvu);
 
195
                unsigned char *dst, int width, int height, int yvu);
196
196
 
197
197
void v4lconvert_rotate90(unsigned char *src, unsigned char *dest,
198
 
  struct v4l2_format *fmt);
 
198
                struct v4l2_format *fmt);
199
199
 
200
200
void v4lconvert_flip(unsigned char *src, unsigned char *dest,
201
 
  struct v4l2_format *fmt, int hflip, int vflip);
 
201
                struct v4l2_format *fmt, int hflip, int vflip);
202
202
 
203
203
void v4lconvert_crop(unsigned char *src, unsigned char *dest,
204
 
  const struct v4l2_format *src_fmt, const struct v4l2_format *dest_fmt);
 
204
                const struct v4l2_format *src_fmt, const struct v4l2_format *dest_fmt);
205
205
 
206
206
int v4lconvert_helper_decompress(struct v4lconvert_data *data,
207
 
  const char *helper, const unsigned char *src, int src_size,
208
 
  unsigned char *dest, int dest_size, int width, int height, int command);
 
207
                const char *helper, const unsigned char *src, int src_size,
 
208
                unsigned char *dest, int dest_size, int width, int height, int command);
209
209
 
210
210
void v4lconvert_helper_cleanup(struct v4lconvert_data *data);
211
211