3 --- cinelerra/vdevicev4l.C.orig 2010-01-29 08:22:11.000000000 +0000
4 +++ cinelerra/vdevicev4l.C
6 #undef _LARGEFILE_SOURCE
7 #undef _LARGEFILE64_SOURCE
12 #include "bcsignals.h"
13 @@ -108,6 +109,7 @@ int VDeviceV4L::close_v4l()
15 int VDeviceV4L::unmap_v4l_shmem()
17 +#if defined(HAVE_LINUX_VIDEODEV_H)
21 @@ -116,9 +118,11 @@ int VDeviceV4L::unmap_v4l_shmem()
22 delete capture_buffer;
29 +#if defined(HAVE_LINUX_VIDEODEV_H)
30 int VDeviceV4L::v4l_init()
33 @@ -179,11 +183,20 @@ int VDeviceV4L::v4l_init()
38 +int VDeviceV4L::v4l_init() {
39 + fprintf(stderr, "VDeviceV4L::v4l_init (Warning: unavailble feature on this platform)\n");
45 void VDeviceV4L::v4l1_start_capture()
47 +#if defined(HAVE_LINUX_VIDEODEV_H)
48 for(int i = 0; i < MIN(capture_params.frames, device->in_config->capture_length); i++)
54 @@ -195,6 +208,7 @@ void VDeviceV4L::v4l1_start_capture()
56 int VDeviceV4L::v4l1_get_inputs()
58 +#if defined(HAVE_LINUX_VIDEODEV_H)
59 struct video_channel channel_struct;
62 @@ -215,6 +229,7 @@ int VDeviceV4L::v4l1_get_inputs()
70 @@ -227,6 +242,7 @@ int VDeviceV4L::set_mute(int muted)
72 int VDeviceV4L::v4l1_set_mute(int muted)
74 +#if defined(HAVE_LINUX_VIDEODEV_H)
75 struct video_audio audio;
77 if(ioctl(input_fd, VIDIOCGAUDIO, &audio))
78 @@ -244,6 +260,7 @@ int VDeviceV4L::v4l1_set_mute(int muted)
79 if(ioctl(input_fd, VIDIOCSAUDIO, &audio) < 0)
80 perror("VDeviceV4L::ioctl VIDIOCSAUDIO");
86 @@ -288,6 +305,7 @@ int VDeviceV4L::get_best_colormodel(Asse
90 +#if defined(HAVE_LINUX_VIDEODEV_H)
91 unsigned long VDeviceV4L::translate_colormodel(int colormodel)
93 unsigned long result = 0;
94 @@ -303,12 +321,18 @@ unsigned long VDeviceV4L::translate_colo
95 //printf("VDeviceV4L::translate_colormodel %d\n", result);
99 +unsigned long VDeviceV4L::translate_colormodel(int) {
104 int VDeviceV4L::set_channel(Channel *channel)
106 return v4l1_set_channel(channel);
109 +#if defined(HAVE_LINUX_VIDEODEV_H)
110 int VDeviceV4L::v4l1_set_channel(Channel *channel)
112 struct video_channel channel_struct;
113 @@ -352,7 +376,13 @@ int VDeviceV4L::v4l1_set_channel(Channel
118 +int VDeviceV4L::v4l1_set_channel(Channel*) {
123 +#if defined(HAVE_LINUX_VIDEODEV_H)
124 int VDeviceV4L::v4l1_get_norm(int norm)
127 @@ -363,13 +393,18 @@ int VDeviceV4L::v4l1_get_norm(int norm)
132 +int VDeviceV4L::v4l1_get_norm(int) {
137 int VDeviceV4L::set_picture(PictureConfig *picture)
139 v4l1_set_picture(picture);
143 +#if defined(HAVE_LINUX_VIDEODEV_H)
144 int VDeviceV4L::v4l1_set_picture(PictureConfig *picture)
146 int brightness = (int)((float)picture->brightness / 100 * 32767 + 32768);
147 @@ -394,8 +429,13 @@ int VDeviceV4L::v4l1_set_picture(Picture
148 perror("VDeviceV4L::v4l1_set_picture VIDIOCGPICT");
152 +int VDeviceV4L::v4l1_set_picture(PictureConfig*) {
158 +#if defined(HAVE_LINUX_VIDEODEV_H)
159 int VDeviceV4L::capture_frame(int capture_frame_number)
161 struct video_mmap params;
162 @@ -409,7 +449,13 @@ int VDeviceV4L::capture_frame(int captur
163 perror("VDeviceV4L::capture_frame VIDIOCMCAPTURE");
167 +int VDeviceV4L::capture_frame(int) {
172 +#if defined(HAVE_LINUX_VIDEODEV_H)
173 int VDeviceV4L::wait_v4l_frame()
175 //printf("VDeviceV4L::wait_v4l_frame 1 %d\n", capture_frame_number);
176 @@ -418,17 +464,29 @@ int VDeviceV4L::wait_v4l_frame()
177 //printf("VDeviceV4L::wait_v4l_frame 2 %d\n", capture_frame_number);
181 +int VDeviceV4L::wait_v4l_frame() {
186 +#if defined(HAVE_LINUX_VIDEODEV_H)
187 int VDeviceV4L::read_v4l_frame(VFrame *frame)
189 frame_to_vframe(frame, (unsigned char*)capture_buffer + capture_params.offsets[capture_frame_number]);
193 +int VDeviceV4L::read_v4l_frame(VFrame *) {
199 #define MIN(x, y) ((x) < (y) ? (x) : (y))
202 +#if defined(HAVE_LINUX_VIDEODEV_H)
203 int VDeviceV4L::frame_to_vframe(VFrame *frame, unsigned char *input)
205 int inwidth, inheight;
206 @@ -525,9 +583,13 @@ int VDeviceV4L::frame_to_vframe(VFrame *
211 +int VDeviceV4L::frame_to_vframe(VFrame *, unsigned char *) {
218 +#if defined(HAVE_LINUX_VIDEODEV_H)
219 int VDeviceV4L::next_frame(int previous_frame)
221 int result = previous_frame + 1;
222 @@ -535,7 +597,13 @@ int VDeviceV4L::next_frame(int previous_
223 if(result >= MIN(capture_params.frames, device->in_config->capture_length)) result = 0;
227 +int VDeviceV4L::next_frame(int) {
232 +#if defined(HAVE_LINUX_VIDEODEV_H)
233 int VDeviceV4L::read_buffer(VFrame *frame)
236 @@ -561,7 +629,11 @@ SET_TRACE
242 +int VDeviceV4L::read_buffer(VFrame *) {