Lines 1-201
Link Here
|
1 |
--- camlibs/canon/canon.c.orig Sun Jan 18 20:47:01 2004 |
|
|
2 |
+++ camlibs/canon/canon.c Wed Oct 20 13:25:01 2004 |
3 |
@@ -15,7 +15,7 @@ |
4 |
* and usb.c, keeping the common protocols/busses support in this |
5 |
* file. |
6 |
* |
7 |
- * $Id: canon.c,v 1.236.2.6 2004/01/15 12:30:11 hun Exp $ |
8 |
+ * $Id: canon.c,v 1.247 2004/08/14 00:24:12 hfiguiere Exp $ |
9 |
*/ |
10 |
|
11 |
#include "config.h" |
12 |
@@ -83,15 +83,17 @@ |
13 |
* detection. |
14 |
* - Newer Canon USB cameras also support a PTP mode. See ptp2 camlib. |
15 |
* - No IEEE1394 cameras supported yet. |
16 |
+ * - The size limit constants aren't used properly anywhere. We should |
17 |
+ * probably get rid of them altogether. |
18 |
**/ |
19 |
|
20 |
/* SL_* - size limit constants */ |
21 |
-#define KILOBYTE (1024) |
22 |
-#define MEGABYTE (1024 * KILOBYTE) |
23 |
-#define SL_THUMB ( 100 * KILOBYTE) |
24 |
-#define SL_PICTURE ( 10 * MEGABYTE) |
25 |
-#define SL_MOVIE_SMALL ( 100 * MEGABYTE) |
26 |
-#define SL_MOVIE_LARGE (2048 * MEGABYTE) |
27 |
+#define KILOBYTE (1024U) |
28 |
+#define MEGABYTE (1024U * KILOBYTE) |
29 |
+#define SL_THUMB ( 100U * KILOBYTE) |
30 |
+#define SL_PICTURE ( 10U * MEGABYTE) |
31 |
+#define SL_MOVIE_SMALL ( 100U * MEGABYTE) |
32 |
+#define SL_MOVIE_LARGE (2048U * MEGABYTE) |
33 |
#define NO_USB 0 |
34 |
|
35 |
const struct canonCamModelData models[] = { |
36 |
@@ -171,8 +173,9 @@ |
37 |
/* 3078 and 307a are in MacOS Info.plist, but I don't know |
38 |
* what they are --swestin. */ |
39 |
{"Canon:PowerShot unknown 5", CANON_PS_UNK5, 0x04A9, 0x307a, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL}, |
40 |
- /* MV630i seems to be a DV camcorder */ |
41 |
+ /* MV630i is a DV camcorder */ |
42 |
{"Canon:MV630i", CANON_MV630I, 0x04A9, 0x307b, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
43 |
+ {"Canon:MV650i", CANON_MV650I, 0x04A9, 0x3079, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
44 |
{"Canon:Optura 20", CANON_OPT_20, 0x04A9, 0x307f, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
45 |
{"Canon:Optura 10", CANON_OPT_10, 0x04A9, 0x3081, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
46 |
|
47 |
@@ -184,6 +187,13 @@ |
48 |
/* PS G5 uses the same ProductID for PTP and Canon, with protocol autodetection */ |
49 |
{"Canon:PowerShot G5 (normal mode)", CANON_PS_G5, 0x04A9, 0x3085, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
50 |
{"Canon:PowerShot A80 (normal mode)",CANON_PS_A80, 0x04A9, 0x309A, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
51 |
+ {"Canon:PowerShot S60 (normal mode)", CANON_PS_S60, 0x04A9, 0x30b2, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
52 |
+ {"Canon:Digital IXUS 500 (normal mode)",CANON_PS_S500, 0x04A9, 0x30b4, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
53 |
+ {"Canon:PowerShot A75", CANON_PS_A75, 0x04A9, 0x30b5, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
54 |
+ {"Canon:PowerShot A85", CANON_PS_A75, 0x04A9, 0x30b9, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
55 |
+ {"Canon:PowerShot A310", CANON_PS_A310, 0x04A9, 0x30b8, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
56 |
+ {"Canon:PowerShot S410 (normal mode)",CANON_PS_S410, 0x04A9, 0x30ba, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
57 |
+ {"Canon:Digital IXUS 430 (normal mode)",CANON_PS_S410, 0x04A9, 0x30ba, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL}, |
58 |
|
59 |
{NULL} |
60 |
/* *INDENT-ON* */ |
61 |
@@ -1535,10 +1545,13 @@ |
62 |
* @path: gphoto2 path |
63 |
* @context: context for error reporting |
64 |
* |
65 |
- * convert gphoto2 path (e.g. "/DCIM/116CANON/IMG_1240.JPG") |
66 |
+ * convert gphoto2 path (e.g. "/dcim/116CANON/img_1240.jpg") |
67 |
* into canon style path (e.g. "D:\DCIM\116CANON\IMG_1240.JPG") |
68 |
* |
69 |
- * Returns: string with converted path name |
70 |
+ * Canon cameras use FAT with upper case internally, so we convert |
71 |
+ * into that. |
72 |
+ * |
73 |
+ * Returns: immutable string with converted path name |
74 |
* |
75 |
*/ |
76 |
const char * |
77 |
@@ -1562,13 +1575,14 @@ |
78 |
|
79 |
snprintf (tmp, sizeof (tmp), "%s%s", camera->pl->cached_drive, path); |
80 |
|
81 |
- /* replace all slashes by backslashes */ |
82 |
+ /* replace all slashes by backslashes, change case to upper for FAT */ |
83 |
for (p = tmp; *p != '\0'; p++) { |
84 |
if (*p == '/') |
85 |
*p = '\\'; |
86 |
+ *p = (char) toupper(*p); |
87 |
} |
88 |
|
89 |
- /* remove trailing backslash */ |
90 |
+ /* remove trailing backslash, making sure buffer ends with \0 */ |
91 |
if ((p > tmp) && (*(p - 1) == '\\')) |
92 |
*(p - 1) = '\0'; |
93 |
|
94 |
@@ -1803,7 +1817,7 @@ |
95 |
* that is not an error for serial cameras |
96 |
* (at least the A50 adds five zero bytes at the end) |
97 |
*/ |
98 |
- for (temp_ch = pos; temp_ch < end_of_data && *temp_ch; temp_ch++) ; /* do nothing */ |
99 |
+ for (temp_ch = pos; (temp_ch < end_of_data) && (!*temp_ch); temp_ch++) ; /* do nothing */ |
100 |
|
101 |
if (temp_ch == end_of_data) { |
102 |
GP_DEBUG ("canon_int_list_dir: " |
103 |
--- camlibs/canon/canon.h.orig Sun Jan 18 20:47:01 2004 |
104 |
+++ camlibs/canon/canon.h Wed Oct 20 13:25:58 2004 |
105 |
@@ -3,7 +3,7 @@ |
106 |
* |
107 |
* Written 1999 by Wolfgang G. Reissnegger and Werner Almesberger |
108 |
* |
109 |
- * $Id: canon.h,v 1.87.2.3 2004/01/15 12:29:40 hun Exp $ |
110 |
+ * $Id: canon.h,v 1.95 2004/08/14 00:24:12 hfiguiere Exp $ |
111 |
* |
112 |
*/ |
113 |
|
114 |
@@ -68,7 +68,9 @@ |
115 |
* @CANON_PS_A50: PowerShot A50 |
116 |
* @CANON_PS_A60: PowerShot A60 |
117 |
* @CANON_PS_A70: PowerShot A70 |
118 |
+ * @CANON_PS_A75: PowerShot A75 |
119 |
* @CANON_PS_A80: PowerShot A80 |
120 |
+ * @CANON_PS_A85: PowerShot A85 |
121 |
* @CANON_PS_PRO70: PowerShot Pro70 |
122 |
* @CANON_PS_S10: PowerShot S10 |
123 |
* @CANON_PS_S20: PowerShot S20 |
124 |
@@ -91,11 +93,15 @@ |
125 |
* @CANON_PS_A300: PowerShot A300 |
126 |
* @CANON_PS_S200: PowerShot S200, Digital IXUS v2 |
127 |
* @CANON_PS_S330: Digital IXUS 330 |
128 |
+ * @CANON_PS_S410: Digital IXUS 430 |
129 |
+ * @CANON_PS_S500: Digital IXUS 500 |
130 |
* @CANON_PS_S45: PowerShot S45 |
131 |
+ * @CANON_PS_S60: PowerShot S60 |
132 |
* @CANON_PS_G3: PowerShot G3 |
133 |
* @CANON_PS_G5: PowerShot G5 |
134 |
* @CANON_PS_S230: PowerShot S230, Digital IXUS v3 |
135 |
* @CANON_MV630I: MV630i camcorder |
136 |
+ * @CANON_MV650I: MV650i camcorder |
137 |
* @CANON_EOS_10D: EOS 10D |
138 |
* @CANON_OPT_10: Optura 10 |
139 |
* @CANON_OPT_20: Optura 20 |
140 |
@@ -119,7 +125,9 @@ |
141 |
CANON_PS_A50, |
142 |
CANON_PS_A60, |
143 |
CANON_PS_A70, |
144 |
+ CANON_PS_A75, |
145 |
CANON_PS_A80, |
146 |
+ CANON_PS_A85, |
147 |
CANON_PS_S10, |
148 |
CANON_PS_S20, |
149 |
CANON_PS_S30, |
150 |
@@ -141,11 +149,13 @@ |
151 |
CANON_PS_A100, |
152 |
CANON_PS_A200, |
153 |
CANON_PS_A300, |
154 |
+ CANON_PS_A310, |
155 |
CANON_PS_S50, |
156 |
CANON_PS_S45, |
157 |
CANON_PS_G3, |
158 |
CANON_PS_S230, |
159 |
CANON_MV630I, |
160 |
+ CANON_MV650I, |
161 |
CANON_EOS_10D, |
162 |
CANON_OPT_200, |
163 |
/* In Mac OS Image Capture, but not yet seen in the wild. */ |
164 |
@@ -156,6 +166,9 @@ |
165 |
CANON_PS_UNK5, |
166 |
/* other cameras */ |
167 |
CANON_PS_S400, |
168 |
+ CANON_PS_S410, |
169 |
+ CANON_PS_S60, |
170 |
+ CANON_PS_S500, |
171 |
CANON_PS_SD100, |
172 |
CANON_EOS_300D, |
173 |
CANON_PS_G5, |
174 |
@@ -256,6 +269,7 @@ |
175 |
unsigned short usb_vendor; |
176 |
unsigned short usb_product; |
177 |
canonCaptureSupport usb_capture_support; |
178 |
+ /* these three constants aren't used properly */ |
179 |
unsigned int max_movie_size; |
180 |
unsigned int max_thumbnail_size; |
181 |
unsigned int max_picture_size; |
182 |
--- camlibs/canon/usb.c.orig Sun Jan 18 20:47:01 2004 |
183 |
+++ camlibs/canon/usb.c Wed Oct 20 13:21:24 2004 |
184 |
@@ -4,7 +4,7 @@ |
185 |
* |
186 |
* USB communication layer. |
187 |
* |
188 |
- * $Id: usb.c,v 1.83 2004/01/02 15:42:33 marcusmeissner Exp $ |
189 |
+ * $Id: usb.c,v 1.85 2004/02/03 18:24:39 hun Exp $ |
190 |
****************************************************************************/ |
191 |
|
192 |
#include "config.h" |
193 |
@@ -1178,7 +1178,7 @@ |
194 |
|
195 |
/* the 1 is to show status */ |
196 |
res = canon_usb_long_dialogue (camera, CANON_USB_FUNCTION_GET_FILE, data, length, |
197 |
- camera->pl->md->max_picture_size, payload, |
198 |
+ camera->pl->md->max_movie_size, payload, |
199 |
payload_length, 1, context); |
200 |
if (res != GP_OK) { |
201 |
GP_DEBUG ("canon_usb_get_file: canon_usb_long_dialogue() " |