summaryrefslogtreecommitdiff
blob: df9a82e8d936d3b480586043c87c09a396f898e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
diff -ur avifile-0.7-0.7.38/ffmpeg/libavformat/grab.c avifile-0.7-0.7.38.plasmaroo/ffmpeg/libavformat/grab.c
--- avifile-0.7-0.7.38/ffmpeg/libavformat/grab.c	2003-06-26 20:14:31.000000000 +0100
+++ avifile-0.7-0.7.38.plasmaroo/ffmpeg/libavformat/grab.c	2003-12-26 21:41:48.000000000 +0000
@@ -16,14 +16,24 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+
 #include "avformat.h"
+
+#if defined(__linux__) 
+	#include <linux/version.h>
+	#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) 
+		#include <sys/time.h>
+	#endif
+#else
+	#include <sys/time.h>
+#endif
+#include <time.h>
+
 #include <linux/videodev.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <sys/time.h>
-#include <time.h>
 
 typedef struct {
     int fd;
diff -ur avifile-0.7-0.7.38/plugins/libwin32/loader/ldt_keeper.c avifile-0.7-0.7.38.plasmaroo/plugins/libwin32/loader/ldt_keeper.c
--- avifile-0.7-0.7.38/plugins/libwin32/loader/ldt_keeper.c	2002-08-08 10:05:51.000000000 +0100
+++ avifile-0.7-0.7.38.plasmaroo/plugins/libwin32/loader/ldt_keeper.c	2003-12-26 21:54:33.000000000 +0000
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #ifdef __linux__
+#include <linux/version.h>
 #include <asm/unistd.h>
 #include <asm/ldt.h>
 /* prototype it here, so we won't depend on kernel headers */
@@ -109,8 +110,13 @@
 #ifdef __linux__
 /* XXX: why is this routine from libc redefined here? */
 /* NOTE: the redefined version ignores the count param, count is hardcoded as 16 */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+static int LDT_Modify( int func, struct user_desc *ptr,
+		       unsigned long count )
+#else
 static int LDT_Modify( int func, struct modify_ldt_ldt_s *ptr,
 		       unsigned long count )
+#endif
 {
     int res;
 #ifdef __PIC__
@@ -141,7 +147,15 @@
 #endif
 
 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
-static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
+#if defined(__linux__) 
+	#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+		static void LDT_EntryToBytes( unsigned long *buffer, const struct user_desc *content )
+	#else
+		static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
+	#endif
+#else
+	static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
+#endif
 {
     *buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
 	(content->limit & 0x0ffff);
@@ -158,7 +172,15 @@
 
 ldt_fs_t* Setup_LDT_Keeper(void)
 {
-    struct modify_ldt_ldt_s array;
+    #if defined(__linux__) 
+	#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ 	    struct user_desc array;
+	#else
+	    struct modify_ldt_ldt_s array;
+	#endif
+    #else
+	    struct modify_ldt_ldt_s array;
+    #endif
     int ret;
     ldt_fs_t* ldt_fs = (ldt_fs_t*) malloc(sizeof(ldt_fs_t));
 
@@ -190,7 +212,11 @@
     array.limit_in_pages=0;
 #ifdef __linux__
     //ret=LDT_Modify(0x1, &array, sizeof(struct modify_ldt_ldt_s));
-    ret=modify_ldt(0x1, &array, sizeof(struct modify_ldt_ldt_s));
+    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	ret=modify_ldt(0x1, &array, sizeof(struct user_desc));
+    #else
+	ret=modify_ldt(0x1, &array, sizeof(struct modify_ldt_ldt_s));
+    #endif
     if(ret<0)
     {
 	perror("install_fs");
diff -ur avifile-0.7-0.7.38/samples/qtvidcap/main.cpp avifile-0.7-0.7.38.plasmaroo/samples/qtvidcap/main.cpp
--- avifile-0.7-0.7.38/samples/qtvidcap/main.cpp	2003-06-08 18:26:04.000000000 +0100
+++ avifile-0.7-0.7.38.plasmaroo/samples/qtvidcap/main.cpp	2003-12-26 19:21:20.000000000 +0000
@@ -1,9 +1,6 @@
-
-#include "v4lwindow.h"
 #include "vidconf.h"
 
 #include <aviplay.h>
-#include "v4lxif.h"
 #include <avm_except.h>
 #include <avm_cpuinfo.h>
 #include <videoencoder.h>
@@ -27,6 +24,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include "v4lwindow.h"
+#include "v4lxif.h"
 
 unsigned int m_iMemory;
 const char* g_pcProgramName = "AviCap";