===================================================================
RCS file: /cvsroot/gphoto/libgphoto2/camlibs/canon/canon.c,v
retrieving revision 1.227
retrieving revision 1.233
diff -u -r1.227 -r1.233
--- gphoto/libgphoto2/camlibs/canon/canon.c	2003/10/10 10:54:32	1.227
+++ gphoto/libgphoto2/camlibs/canon/canon.c	2003/11/08 11:55:27	1.233
 #include "config.h"
@@ -78,11 +78,11 @@
  * such that their camera name occurs in the list of supported
  * cameras.
  *
- * Note:
- * - at least some serial cameras require a certain name for correct
+ * Notes:
+ * - At least some serial cameras require a certain name for correct
  *   detection.
- * - newer Canon cameras USB also support a PTP mode. see ptp/ptp2 camlibs.
- * - no IEEE1394 cameras supported yet
+ * - Newer Canon USB cameras also support a PTP mode. See ptp2 camlib.
+ * - No IEEE1394 cameras supported yet.
  **/
 
 #define S32K	(32 * 1024)
@@ -135,36 +135,35 @@
 	{"Canon:PowerShot S200",	CANON_PS_S200,		0x04A9, 0x3065, CAP_SUP, S10M, S32K, S2M, NULL},
 	{"Canon:Digital IXUS v2",	CANON_PS_S200,		0x04A9, 0x3065, CAP_SUP, S10M, S32K, S2M, NULL},
 	{"Canon:Digital IXUS 330",	CANON_PS_S330,		0x04A9, 0x3066, CAP_SUP, S10M, S32K, S2M, NULL},
-	/* Canon MVX2i in some mode is 0x3067 - probably PTP */
 
 	/* 306a is in MacOS Info.plist, but I don't know what it is --swestin. */
 	{"Canon:Digital unknown 3",	CANON_PS_UNK3,		0x04A9, 0x306a, CAP_SUP, S10M, S32K, S2M, NULL},
-	/* Apparently the MVX2i is the same as Optura 200 MC (Philippe
-	 * Gramoulle), so share the code. */
+	/* Canon MVX2i in some mode is 0x3067 - probably PTP */
 	{"Canon:MVX2i",			CANON_OPT_200,		0x04A9, 0x306B, CAP_SUP, S99M, S32K, S2M, NULL},
 	{"Canon:Optura 200 MC",		CANON_OPT_200,		0x04A9, 0x306B, CAP_SUP, S99M, S32K, S2M, NULL},
 	{"Canon:PowerShot S45 (normal mode)",	CANON_PS_S45,	0x04A9, 0x306C, CAP_SUP, S99M, S32K, S2M, NULL},
-        /* 0x306D is S45 in PTP mode */
+	/* 0x306D is S45 in PTP mode */
 	{"Canon:PowerShot G3 (normal mode)",	CANON_PS_G3,	0x04A9, 0x306E, CAP_SUP, S99M, S32K, S2M, NULL},
-        /* 0x306F is G3 in PTP mode */
+	/* 0x306F is G3 in PTP mode */
 	{"Canon:PowerShot S230 (normal mode)",	CANON_PS_S230,	0x04A9, 0x3070, CAP_SUP, S99M, S32K, S2M, NULL},
 	{"Canon:Digital IXUS v3 (normal mode)",	CANON_PS_S230,	0x04A9, 0x3070, CAP_SUP, S99M, S32K, S2M, NULL},
-        /* 0x3071 is S230/IXUS v3 in PTP mode */
+	/* 0x3071 is S230/IXUS v3 in PTP mode */
 
 	{"Canon:PowerShot SD100 (normal mode)",	CANON_PS_SD100,	0x04A9, 0x3072, CAP_SUP, S99M, S32K, S2M, NULL},
 	{"Canon:Digital IXUS II (normal mode)",	CANON_PS_SD100,	0x04A9, 0x3072, CAP_SUP, S99M, S32K, S2M, NULL},
 	/* added from report on mailinglist. XXX: assuming capture works -Marcus */
-	/* reports suggest that they provide 1 interface which does
-	 * both PTP and Canon access modes.
-	 */
+	/* PS A70 uses the same ProductID for PTP and Canon, with protocol autodetection */
 	{"Canon:PowerShot A70",         CANON_PS_A70,           0x04A9, 0x3073, CAP_SUP, S99M, S32K, S2M, NULL},
+	/* PS A60 uses the same ProductID for PTP and Canon, with protocol autodetection */
 	{"Canon:PowerShot A60",         CANON_PS_A60,           0x04A9, 0x3074, CAP_SUP, S99M, S32K, S2M, NULL},
 	/* reported working on SourceForge patch tracker. */
-	/* S400 product ID is 0x3075; this responds both to Canon
-	 * protocol and PTP. */
 	{"Canon:Digital IXUS 400",      CANON_PS_S400,		0x04A9, 0x3075, CAP_SUP, S99M, S32K, S2M, NULL},
+	/* PS S400 used the same ProductID for PTP and Canon, with protocol autodetection */
 	{"Canon:PowerShot S400",        CANON_PS_S400,		0x04A9, 0x3075, CAP_SUP, S99M, S32K, S2M, NULL},
 
+	{"Canon:PowerShot A300",        CANON_PS_A300,          0x04A9, 0x3076, CAP_SUP, S99M, S32K, S2M, NULL},
+	{"Canon:PowerShot S50 (normal mode)",   CANON_PS_S50,   0x04A9, 0x3077, CAP_SUP, S99M, S32K, S2M, NULL},
+
 	/* 3078 and 307a are in MacOS Info.plist, but I don't know
 	 * what they are --swestin. */
 	{"Canon:PowerShot unknown 4",		CANON_PS_UNK4,	0x04A9, 0x3078, CAP_SUP, S10M, S32K, S2M, NULL},
@@ -172,13 +171,16 @@
 	{"Canon:PowerShot unknown 5",		CANON_PS_UNK5,	0x04A9, 0x307a, CAP_SUP, S10M, S32K, S2M, NULL},
 	/* MV630i seems to be a DV camcorder */
 	{"Canon:MV630i",		CANON_MV630I,		0x04A9, 0x307b, CAP_SUP, S99M, S32K, S2M, NULL},
+	{"Canon:Optura 20",		CANON_OPT_20,		0x04A9, 0x307f, CAP_SUP, S99M, S32K, S2M, NULL},
 
 	{"Canon:EOS 10D",		CANON_EOS_10D,		0x04A9, 0x3083, CAP_SUP, S10M, S32K, S2M, NULL},
 	/* 0x3099 is the EOS 300D/Digital Rebel in PTP mode */
 	{"Canon:EOS 300D (normal mode)",	CANON_EOS_300D, 0x04A9, 0x3084, CAP_SUP, S10M, S32K, S2M, NULL},
 	{"Canon:EOS Digital Rebel (normal mode)",CANON_EOS_300D,0x04A9, 0x3084, CAP_SUP, S10M, S32K, S2M, NULL},
 	{"Canon:EOS Kiss Digital (normal mode)",CANON_EOS_300D, 0x04A9, 0x3084, CAP_SUP, S10M, S32K, S2M, NULL},
-	{"Canon:PowerShot A80 (normal mode)",CANON_PS_A80,      0x04A9, 0x309A, CAP_SUP,  S99M, S32K, S2M, NULL},
+	/* PS G5 uses the same ProductID for PTP and Canon, with protocol autodetection */
+	{"Canon:PowerShot G5 (normal mode)",	CANON_PS_G5,	0x04A9, 0x3085, CAP_SUP, S99M, S32K, S2M, NULL},
+	{"Canon:PowerShot A80 (normal mode)",CANON_PS_A80,      0x04A9, 0x309A, CAP_SUP, S99M, S32K, S2M, NULL},
 
 	{NULL}
 	/* *INDENT-ON* */
@@ -312,6 +314,7 @@
 	case CANON_PS_S45:
 	case CANON_PS_S400:
 	case CANON_PS_G3:
+	case CANON_PS_G5:
 		break;
 	default:
 		GP_DEBUG ("canon_int_filename2audioname: camera model doesn't support audio files",
@@ -864,10 +867,10 @@
 }
 
 /**
- * canon_int_find_new_image
- * @camera Camera * to this camera
- * @initial_state Camera directory dump before image capture
- * @final_state Directory dump after image capture
+ * canon_int_find_new_image:
+ * @camera: Camera * to this camera
+ * @initial_state: Camera directory dump before image capture
+ * @final_state: Directory dump after image capture
  * @path: Will be filled in with the path and filename of the captured
  *        image, in canonical gphoto2 format.
  *
@@ -957,7 +960,7 @@
 }
 
 /**
- * canon_int_capture_image
+ * canon_int_capture_image:
  * @camera: camera to work with
  * @path: gets filled in with the path and filename of the captured
  *   image, in canonical gphoto2 format.
@@ -1095,8 +1098,8 @@
 /**
  * canon_int_set_file_attributes:
  * @camera: camera to work with
+ * @dir: directory to work in
  * @file: file to work on
- *�@dir: directory to work in
  * @attrs: #canonDirentAttributeBits with the bits to set
  * @context: context for error reporting
  *
--- gphoto/libgphoto2/camlibs/canon/canon.h	2003/10/10 10:54:32	1.83
+++ gphoto/libgphoto2/camlibs/canon/canon.h	2003/11/08 11:55:27	1.86
@@ -32,6 +32,12 @@
 /* #define CAMERA_ON_AC       16 obsolete; we now just use*/
 /* #define CAMERA_ON_BATTERY  48 the bit that makes the difference */
 
+/**
+ * CAMERA_MASK_BATTERY
+ *
+ * Bit mask to use to find battery/AC flag
+ *
+ */
 #define CAMERA_MASK_BATTERY  32
 
 /**
@@ -87,17 +93,21 @@
  * @CANON_PS_S330: Digital IXUS 330
  * @CANON_PS_S45: PowerShot S45
  * @CANON_PS_G3: PowerShot G3
+ * @CANON_PS_G5: PowerShot G5
  * @CANON_PS_S230: PowerShot S230, Digital IXUS v3
- * @CANON_PS_A60: PowerShot A60
  * @CANON_MV630I: MV630i camcorder
  * @CANON_EOS_10D: EOS 10D
  * @CANON_OPT_200: Optura 200 MC, MVX2i
+ * @CANON_OPT_20: Optura 20
  * @CANON_PS_UNK1: Unknown camera seen in Mac OS X Image Capture
  * @CANON_PS_UNK2: Unknown camera seen in Mac OS X Image Capture
  * @CANON_PS_UNK3: Unknown camera seen in Mac OS X Image Capture
  * @CANON_PS_UNK4: Unknown camera seen in Mac OS X Image Capture
  * @CANON_PS_UNK5: Unknown camera seen in Mac OS X Image Capture
  * @CANON_EOS_300D: EOS 300D / Digital Rebel / KISS Rebel
+ * @CANON_PS_S50: PowerShot S50
+ * @CANON_PS_S400: PowerShot S400, Digital IXUS 400
+ * @CANON_PS_SD100: PowerShot SD100, Digital IXUS II
  *
  * Enumeration of all camera types currently supported.
  *
@@ -146,7 +156,9 @@
 	/* other cameras */
 	CANON_PS_S400,
 	CANON_PS_SD100,
-	CANON_EOS_300D
+	CANON_EOS_300D,
+	CANON_PS_G5,
+	CANON_OPT_20
 } canonCamModel;
 
 /**
@@ -273,10 +285,8 @@
 	 */
 	int list_all_files; /* whether to list all files, not just know types */
 
-#ifdef CANON_EXPERIMENTAL_UPLOAD
 	int upload_keep_filename; /* 0=DCIF compatible filenames (AUT_*), 
 				     1=keep original filename */
-#endif /* CANON_EXPERIMENTAL_UPLOAD */
 
 	char *cached_drive;	/* usually something like C: */
 	int cached_ready;       /* whether the camera is ready to rock */