<commit_before>/*
 * canon.c - Canon protocol "native" operations.
 *
 * Written 1999 by <NAME> and <NAME>
 * Additions 2000 by <NAME> and <NAME>
 * USB support, 2000, by <NAME>
 *
 * This file includes both USB and serial support for the cameras
 * manufactured by Canon. These comprise all (or at least almost all)
 * of the digital models of the IXUS and PowerShot series, and EOS
 * D30, D60, and 10D. The EOS-1D and EOS-1Ds are not supported; they
 * use a FireWire (IEEE 1394) interface.
 *
 * We are working at moving serial and USB specific stuff to serial.c
 * and usb.c, keeping the common protocols/busses support in this
 * file.
 *
 * $Id$
 */

#include "config.h"

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>

#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif

#ifdef OS2
#include <db.h>
#endif

#include <gphoto2.h>
#include <gphoto2-port-log.h>

#ifdef ENABLE_NLS
#  include <libintl.h>
#  undef _
#  define _(String) dgettext (GETTEXT_PACKAGE, String)
#  ifdef gettext_noop
#    define N_(String) gettext_noop (String)
#  else
#    define N_(String) (String)
#  endif
#else
#  define _(String) (String)
#  define N_(String) (String)
#endif

#include "usb.h"
#include "util.h"
#include "library.h"
#include "canon.h"
#include "serial.h"

/************************************************************************
 * Camera definitions
 ************************************************************************/

/**
 * models:
 *
 * Contains list of all camera models currently supported with their
 * respective USB IDs and a serial ID String for cameras with RS232
 * serial support.
 *
 * Some cameras are sold under different names in different regions,
 * but are technically the same. We treat them the same from a
 * technical point of view. To avoid unnecessary questions from users,
 * we add the other names to the camera list after the primary name,
 * such that their camera name occurs in the list of supported
 * cameras.
 *
 * Notes:
 * - At least some serial cameras require a certain name for correct
 *   detection.
 * - Newer Canon USB cameras also support a PTP mode. See ptp2 camlib.
 * - No IEEE1394 cameras supported yet.
 * - The size limit constants aren't used properly anywhere. We should
 *   probably get rid of them altogether.
 **/

/* SL_* - size limit constants */
#define KILOBYTE	(1024U)
#define MEGABYTE	(1024U * KILOBYTE)
#define SL_THUMB	( 100U * KILOBYTE)
#define SL_PICTURE	(  10U * MEGABYTE)
#define SL_MOVIE_SMALL	( 100U * MEGABYTE)
#define SL_MOVIE_LARGE	(2048U * MEGABYTE)
#define NO_USB  0

/* Models with unknown USB ID's:
  European name      North American                 Japanese             Intro date

  EOS 350D           Digital Rebel XT               EOS Kiss Digital N   February 2005
  IXUS 700           PowerShot SD500                IXY Digital 60       February 2005
  IXUS 50            PowerShot SD400                IXY Digital 55       February 2005
  PowerShot A520                                                         January 2005
  PowerShot A510                                                         January 2005
  Digital IXUS 40    PowerShot SD300                 IXY Digital 50      September 2004
  PowerShot G6                                                           August 2004
  Digital IXUS IIs   PowerShot SD110                      ???            February 2004
  PowerShot Pro1                                                         February 2004
  Digital IXUS i     PowerShot SD10 Digital ELPH    IXY Digital L        September 2003
  */
const struct canonCamModelData models[] = {
	/* *INDENT-OFF* */
	{"Canon:PowerShot A5",		CANON_CLASS_3,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "DE300 Canon Inc."},
	{"Canon:PowerShot A5 Zoom",	CANON_CLASS_3,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot A5 Zoom"},
	{"Canon:PowerShot A50",		CANON_CLASS_1,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot A50"},
	{"Canon:PowerShot Pro70",	CANON_CLASS_2,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot Pro70"},
	{"Canon:PowerShot S10",		CANON_CLASS_0,	0x04A9, 0x3041, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot S10"},
	/* 3042 is a scanner, so it will never be added here. */
	{"Canon:PowerShot S20",		CANON_CLASS_0,	0x04A9, 0x3043, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot S20"},
	{"Canon:EOS D30",		CANON_CLASS_4,	0x04A9, 0x3044, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S100",	CANON_CLASS_0,	0x04A9, 0x3045, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:IXY DIGITAL",		CANON_CLASS_0,	0x04A9, 0x3046, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS",		CANON_CLASS_0,	0x04A9, 0x3047, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot G1",		CANON_CLASS_0,	0x04A9, 0x3048, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot G1"},
	{"Canon:PowerShot Pro90 IS",	CANON_CLASS_0,	0x04A9, 0x3049, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot Pro90 IS"},

	{"Canon:IXY DIGITAL 300",	CANON_CLASS_1,	0x04A9, 0x304B, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S300",	CANON_CLASS_1,	0x04A9, 0x304C, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS 300",	CANON_CLASS_1,	0x04A9, 0x304D, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A20",		CANON_CLASS_1,	0x04A9, 0x304E, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A10",		CANON_CLASS_1,	0x04A9, 0x304F, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* Mac OS includes this as a valid ID; don't know which camera model --swestin */
	{"Canon:PowerShot unknown 1",	CANON_CLASS_1,	0x04A9, 0x3050, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* Canon IXY DIGITAL 200 here? */
	{"Canon:PowerShot S110",	CANON_CLASS_0,	0x04A9, 0x3051, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS v",	CANON_CLASS_1,	0x04A9, 0x3052, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:PowerShot G2",		CANON_CLASS_1,	0x04A9, 0x3055, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S40",		CANON_CLASS_1,	0x04A9, 0x3056, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S30",		CANON_CLASS_1,	0x04A9, 0x3057, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A40",		CANON_CLASS_1,	0x04A9, 0x3058, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A30",		CANON_CLASS_1,	0x04A9,	0x3059, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* 305b is the ZR45MC Digital Camcorder. */
	/* 305c is in MacOS Info.plist, but I don't know what it is --swestin. */
	{"Canon:PowerShot unknown 2",	CANON_CLASS_1,	0x04A9,	0x305c, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:EOS D60",		CANON_CLASS_4,	0x04A9, 0x3060, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A100",	CANON_CLASS_1,	0x04A9, 0x3061, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A200",	CANON_CLASS_1,	0x04A9, 0x3062, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:PowerShot S200",	CANON_CLASS_1,	0x04A9, 0x3065, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS v2",	CANON_CLASS_1,	0x04A9, 0x3065, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S330",	CANON_CLASS_1,	0x04A9, 0x3066, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS 330",	CANON_CLASS_1,	0x04A9, 0x3066, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* 3067  MV550i Digital Video Camera */

	/* Reported at http://www.linux-usb.org/usb.ids, we have 306E. */
	/*{"Canon:PowerShot G3",	CANON_CLASS_1,	0x04A9, 0x3069, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},*/

	/* 306a is in MacOS Info.plist, but I don't know what it is --swestin. */
	{"Canon:Digital unknown 3",	CANON_CLASS_1,	0x04A9, 0x306a, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* Apparently the MVX2i is the same as Optura 200 MC (Philippe
	 * Gramoulle), so share the code. */
	{"Canon:MVX2i",			CANON_CLASS_1,	0x04A9, 0x306B, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Optura 200 MC",		CANON_CLASS_1,	0x04A9, 0x306B, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S45 (normal mode)",	CANON_CLASS_5,	0x04A9, 0x306C, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* 0x306D is S45 in PTP mode */
	{"Canon:PowerShot G3 (normal mode)",	CANON_CLASS_5,	0x04A9, 0x306E, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* 0x306F is G3 in PTP mode */
	{"Canon:PowerShot S230 (normal mode)",	CANON_CLASS_4,	0x04A9, 0x3070, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS v3 (normal mode)",	CANON_CLASS_4,	0x04A9, 0x3070, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* 0x3071 is S230/IXUS v3 in PTP mode */

	{"Canon:PowerShot SD100 (normal mode)",	CANON_CLASS_5,	0x04A9, 0x3072, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS II (normal mode)",	CANON_CLASS_5,	0x04A9, 0x3072, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* added from report on mailinglist. XXX: assuming capture works -Marcus */
	/* PS A70 uses the same ProductID for PTP and Canon, with protocol autodetection */
	{"Canon:PowerShot A70",		CANON_CLASS_5,	0x04A9, 0x3073, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* PS A60 uses the same ProductID for PTP and Canon, with protocol autodetection */
	{"Canon:PowerShot A60",		CANON_CLASS_5,	0x04A9, 0x3074, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* reported working on SourceForge patch tracker. */
	/* PS S400 uses the same ProductID for PTP and Canon, with protocol autodetection */
	{"Canon:Digital IXUS 400",	CANON_CLASS_4,	0x04A9, 0x3075, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S400",	CANON_CLASS_4,	0x04A9, 0x3075, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:PowerShot A300",	CANON_CLASS_4,	0x04A9, 0x3076, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S50 (normal mode)",	CANON_CLASS_4,	0x04A9, 0x3077, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:ZR70MC",		CANON_CLASS_5,	0x04A9, 0x3078, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},<commit_msg>Moved PowerShot S400 (aka Digital IXUS 400) from class 4 to class 1.<commit_after>/*
 * canon.c - Canon protocol "native" operations.
 *
 * Written 1999 by <NAME> and <NAME>
 * Additions 2000 by <NAME> and <NAME>
 * USB support, 2000, by <NAME>
 *
 * This file includes both USB and serial support for the cameras
 * manufactured by Canon. These comprise all (or at least almost all)
 * of the digital models of the IXUS and PowerShot series, and EOS
 * D30, D60, and 10D. The EOS-1D and EOS-1Ds are not supported; they
 * use a FireWire (IEEE 1394) interface.
 *
 * We are working at moving serial and USB specific stuff to serial.c
 * and usb.c, keeping the common protocols/busses support in this
 * file.
 *
 * $Id$
 */

#include "config.h"

#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>

#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif

#ifdef OS2
#include <db.h>
#endif

#include <gphoto2.h>
#include <gphoto2-port-log.h>

#ifdef ENABLE_NLS
#  include <libintl.h>
#  undef _
#  define _(String) dgettext (GETTEXT_PACKAGE, String)
#  ifdef gettext_noop
#    define N_(String) gettext_noop (String)
#  else
#    define N_(String) (String)
#  endif
#else
#  define _(String) (String)
#  define N_(String) (String)
#endif

#include "usb.h"
#include "util.h"
#include "library.h"
#include "canon.h"
#include "serial.h"

/************************************************************************
 * Camera definitions
 ************************************************************************/

/**
 * models:
 *
 * Contains list of all camera models currently supported with their
 * respective USB IDs and a serial ID String for cameras with RS232
 * serial support.
 *
 * Some cameras are sold under different names in different regions,
 * but are technically the same. We treat them the same from a
 * technical point of view. To avoid unnecessary questions from users,
 * we add the other names to the camera list after the primary name,
 * such that their camera name occurs in the list of supported
 * cameras.
 *
 * Notes:
 * - At least some serial cameras require a certain name for correct
 *   detection.
 * - Newer Canon USB cameras also support a PTP mode. See ptp2 camlib.
 * - No IEEE1394 cameras supported yet.
 * - The size limit constants aren't used properly anywhere. We should
 *   probably get rid of them altogether.
 **/

/* SL_* - size limit constants */
#define KILOBYTE	(1024U)
#define MEGABYTE	(1024U * KILOBYTE)
#define SL_THUMB	( 100U * KILOBYTE)
#define SL_PICTURE	(  10U * MEGABYTE)
#define SL_MOVIE_SMALL	( 100U * MEGABYTE)
#define SL_MOVIE_LARGE	(2048U * MEGABYTE)
#define NO_USB  0

/* Models with unknown USB ID's:
  European name      North American                 Japanese             Intro date

  EOS 350D           Digital Rebel XT               EOS Kiss Digital N   February 2005
  IXUS 700           PowerShot SD500                IXY Digital 60       February 2005
  IXUS 50            PowerShot SD400                IXY Digital 55       February 2005
  PowerShot A520                                                         January 2005
  PowerShot A510                                                         January 2005
  Digital IXUS 40    PowerShot SD300                 IXY Digital 50      September 2004
  PowerShot G6                                                           August 2004
  Digital IXUS IIs   PowerShot SD110                      ???            February 2004
  PowerShot Pro1                                                         February 2004
  Digital IXUS i     PowerShot SD10 Digital ELPH    IXY Digital L        September 2003
  */
const struct canonCamModelData models[] = {
	/* *INDENT-OFF* */
	{"Canon:PowerShot A5",		CANON_CLASS_3,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "DE300 Canon Inc."},
	{"Canon:PowerShot A5 Zoom",	CANON_CLASS_3,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot A5 Zoom"},
	{"Canon:PowerShot A50",		CANON_CLASS_1,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot A50"},
	{"Canon:PowerShot Pro70",	CANON_CLASS_2,	NO_USB, NO_USB, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot Pro70"},
	{"Canon:PowerShot S10",		CANON_CLASS_0,	0x04A9, 0x3041, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot S10"},
	/* 3042 is a scanner, so it will never be added here. */
	{"Canon:PowerShot S20",		CANON_CLASS_0,	0x04A9, 0x3043, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot S20"},
	{"Canon:EOS D30",		CANON_CLASS_4,	0x04A9, 0x3044, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S100",	CANON_CLASS_0,	0x04A9, 0x3045, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:IXY DIGITAL",		CANON_CLASS_0,	0x04A9, 0x3046, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS",		CANON_CLASS_0,	0x04A9, 0x3047, CAP_NON, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot G1",		CANON_CLASS_0,	0x04A9, 0x3048, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot G1"},
	{"Canon:PowerShot Pro90 IS",	CANON_CLASS_0,	0x04A9, 0x3049, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, "Canon PowerShot Pro90 IS"},

	{"Canon:IXY DIGITAL 300",	CANON_CLASS_1,	0x04A9, 0x304B, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S300",	CANON_CLASS_1,	0x04A9, 0x304C, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS 300",	CANON_CLASS_1,	0x04A9, 0x304D, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A20",		CANON_CLASS_1,	0x04A9, 0x304E, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A10",		CANON_CLASS_1,	0x04A9, 0x304F, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* Mac OS includes this as a valid ID; don't know which camera model --swestin */
	{"Canon:PowerShot unknown 1",	CANON_CLASS_1,	0x04A9, 0x3050, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* Canon IXY DIGITAL 200 here? */
	{"Canon:PowerShot S110",	CANON_CLASS_0,	0x04A9, 0x3051, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS v",	CANON_CLASS_1,	0x04A9, 0x3052, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:PowerShot G2",		CANON_CLASS_1,	0x04A9, 0x3055, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S40",		CANON_CLASS_1,	0x04A9, 0x3056, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S30",		CANON_CLASS_1,	0x04A9, 0x3057, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A40",		CANON_CLASS_1,	0x04A9, 0x3058, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A30",		CANON_CLASS_1,	0x04A9,	0x3059, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* 305b is the ZR45MC Digital Camcorder. */
	/* 305c is in MacOS Info.plist, but I don't know what it is --swestin. */
	{"Canon:PowerShot unknown 2",	CANON_CLASS_1,	0x04A9,	0x305c, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:EOS D60",		CANON_CLASS_4,	0x04A9, 0x3060, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A100",	CANON_CLASS_1,	0x04A9, 0x3061, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot A200",	CANON_CLASS_1,	0x04A9, 0x3062, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:PowerShot S200",	CANON_CLASS_1,	0x04A9, 0x3065, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS v2",	CANON_CLASS_1,	0x04A9, 0x3065, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S330",	CANON_CLASS_1,	0x04A9, 0x3066, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS 330",	CANON_CLASS_1,	0x04A9, 0x3066, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* 3067  MV550i Digital Video Camera */

	/* Reported at http://www.linux-usb.org/usb.ids, we have 306E. */
	/*{"Canon:PowerShot G3",	CANON_CLASS_1,	0x04A9, 0x3069, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},*/

	/* 306a is in MacOS Info.plist, but I don't know what it is --swestin. */
	{"Canon:Digital unknown 3",	CANON_CLASS_1,	0x04A9, 0x306a, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
	/* Apparently the MVX2i is the same as Optura 200 MC (Philippe
	 * Gramoulle), so share the code. */
	{"Canon:MVX2i",			CANON_CLASS_1,	0x04A9, 0x306B, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Optura 200 MC",		CANON_CLASS_1,	0x04A9, 0x306B, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S45 (normal mode)",	CANON_CLASS_5,	0x04A9, 0x306C, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* 0x306D is S45 in PTP mode */
	{"Canon:PowerShot G3 (normal mode)",	CANON_CLASS_5,	0x04A9, 0x306E, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* 0x306F is G3 in PTP mode */
	{"Canon:PowerShot S230 (normal mode)",	CANON_CLASS_4,	0x04A9, 0x3070, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS v3 (normal mode)",	CANON_CLASS_4,	0x04A9, 0x3070, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* 0x3071 is S230/IXUS v3 in PTP mode */

	{"Canon:PowerShot SD100 (normal mode)",	CANON_CLASS_5,	0x04A9, 0x3072, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:Digital IXUS II (normal mode)",	CANON_CLASS_5,	0x04A9, 0x3072, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* added from report on mailinglist. XXX: assuming capture works -Marcus */
	/* PS A70 uses the same ProductID for PTP and Canon, with protocol autodetection */
	{"Canon:PowerShot A70",		CANON_CLASS_5,	0x04A9, 0x3073, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* PS A60 uses the same ProductID for PTP and Canon, with protocol autodetection */
	{"Canon:PowerShot A60",		CANON_CLASS_5,	0x04A9, 0x3074, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	/* reported working on SourceForge patch tracker. */
	/* PS S400 uses the same ProductID for PTP and Canon, with protocol autodetection */
	{"Canon:Digital IXUS 400",	CANON_CLASS_1,	0x04A9, 0x3075, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S400",	CANON_CLASS_1,	0x04A9, 0x3075, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},

	{"Canon:PowerShot A300",	CANON_CLASS_4,	0x04A9, 0x3076, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:PowerShot S50 (normal mode)",	CANON_CLASS_4,	0x04A9, 0x3077, CAP_SUP, SL_MOVIE_LARGE, SL_THUMB, SL_PICTURE, NULL},
	{"Canon:ZR70MC",		CANON_CLASS_5,	0x04A9, 0x3078, CAP_SUP, SL_MOVIE_SMALL, SL_THUMB, SL_PICTURE, NULL},
{'fraction_non_alphanumeric': 0.11912949267511423, 'fraction_numerical': 0.07169438032879552, 'mean_word_length': 4.347607052896725, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1639791', 'n_tokens_mistral': 9953, 'n_tokens_neox': 8883, 'n_words': 2263}