]> gitweb @ CieloNegro.org - pkgsrc-cinelerra-cv.git/blob - patches/patch-vdevicebuz_C
shmmax patch
[pkgsrc-cinelerra-cv.git] / patches / patch-vdevicebuz_C
1 $NetBSD$
2
3 --- cinelerra/vdevicebuz.C.orig 2010-02-01 08:26:23.000000000 +0000
4 +++ cinelerra/vdevicebuz.C
5 @@ -24,6 +24,8 @@
6  #undef _LARGEFILE64_SOURCE
7  #undef _FILE_OFFSET_BITS
8  
9 +#include "config.h"
10 +
11  #include "assets.h"
12  #include "bcsignals.h"
13  #include "channel.h"
14 @@ -43,9 +45,11 @@
15  
16  #include <errno.h>
17  #include <stdint.h>
18 +#if defined(HAVE_LINUX_VIDEODEV_H)
19  #include <linux/kernel.h>
20  //#include <linux/videodev2.h>
21  #include <linux/videodev.h>
22 +#endif
23  #include <fcntl.h>
24  #include <sys/ioctl.h>
25  #include <sys/mman.h>
26 @@ -107,6 +111,7 @@ void VDeviceBUZInput::start()
27         Thread::start();
28  }
29  
30 +#if defined(HAVE_LINUX_VIDEODEV_H)
31  void VDeviceBUZInput::run()
32  {
33      struct buz_sync bsync;
34 @@ -117,7 +122,7 @@ void VDeviceBUZInput::run()
35                 Thread::enable_cancel();
36                 if(ioctl(device->jvideo_fd, BUZIOC_SYNC, &bsync) < 0)
37                 {
38 -                       perror("VDeviceBUZInput::run BUZIOC_SYNC");
39 +                       fprintf(stderr, "VDeviceBUZInput::run BUZIOC_SYNC\n");
40                         if(done) return;
41                         Thread::disable_cancel();
42                 }
43 @@ -152,6 +157,11 @@ void VDeviceBUZInput::run()
44                 }
45         }
46  }
47 +#else
48 +void VDeviceBUZInput::run() {
49 +    fprintf(stderr, "VDeviceBUZInput::run (Warning: unavailable for this platform)\n");
50 +}
51 +#endif
52  
53  void VDeviceBUZInput::get_buffer(char **ptr, int *size)
54  {
55 @@ -444,6 +454,7 @@ int VDeviceBUZ::set_picture(PictureConfi
56         return 0;
57  }
58  
59 +#if defined(HAVE_LINUX_VIDEODEV_H)
60  int VDeviceBUZ::get_norm(int norm)
61  {
62         switch(norm)
63 @@ -453,6 +464,11 @@ int VDeviceBUZ::get_norm(int norm)
64                 case SECAM:         return VIDEO_MODE_SECAM;     break;
65         }
66  }
67 +#else
68 +int VDeviceBUZ::get_norm(int norm) {
69 +    return -1;
70 +}
71 +#endif
72  
73  int VDeviceBUZ::read_buffer(VFrame *frame)
74  {
75 @@ -500,6 +516,7 @@ int VDeviceBUZ::read_buffer(VFrame *fram
76         return 0;
77  }
78  
79 +#if defined(HAVE_LINUX_VIDEODEV_H)
80  int VDeviceBUZ::open_input_core(Channel *channel)
81  {
82         jvideo_fd = open(device->in_config->buz_in_device, O_RDONLY);
83 @@ -621,7 +638,15 @@ int VDeviceBUZ::open_input_core(Channel 
84  //printf("VDeviceBUZ::open_input_core 2\n");
85         return 0;
86  }
87 +#else
88 +int VDeviceBUZ::open_input_core(Channel *channel) {
89 +    fprintf(stderr, "VDeviceBUZ::open_input (Warning: unavailable feature on this platform)\n");
90 +    jvideo_fd = 0;
91 +    return 1;
92 +}
93 +#endif
94  
95 +#if defined(HAVE_LINUX_VIDEODEV_H)
96  int VDeviceBUZ::open_output_core(Channel *channel)
97  {
98  //printf("VDeviceBUZ::open_output 1\n");
99 @@ -677,9 +702,15 @@ int VDeviceBUZ::open_output_core(Channel
100  //printf("VDeviceBUZ::open_output 2\n");
101         return 0;
102  }
103 +#else
104 +int VDeviceBUZ::open_output_core(Channel *channel) {
105 +    fprintf(stderr, "VDeviceBUZ::open_output (Warning: unavailable feature on this platform)\n");
106 +    jvideo_fd = 0;
107 +    return 1;
108 +}
109 +#endif
110  
111 -
112 -
113 +#if defined(HAVE_LINUX_VIDEODEV_H)
114  int VDeviceBUZ::write_buffer(VFrame *frame, EDL *edl)
115  {
116  //printf("VDeviceBUZ::write_buffer 1\n");
117 @@ -753,6 +784,12 @@ int VDeviceBUZ::write_buffer(VFrame *fra
118  
119         return 0;
120  }
121 +#else
122 +int VDeviceBUZ::write_buffer(VFrame *frame, EDL *edl) {
123 +    fprintf(stderr, "VDeviceBUZ::write_buffer (Warning: unavailable feature on this platform)\n");
124 +    return 0;
125 +}
126 +#endif
127  
128  void VDeviceBUZ::new_output_buffer(VFrame *output,
129         int colormodel)