summaryrefslogtreecommitdiff
path: root/graphics/gphoto2
diff options
context:
space:
mode:
authorveego <veego@pkgsrc.org>2001-07-08 21:45:33 +0000
committerveego <veego@pkgsrc.org>2001-07-08 21:45:33 +0000
commit91563c65c9055a91a429ef93410694bc85aad67e (patch)
tree3e1b24acd6a9e17d52ba4efcea442323c0ea6386 /graphics/gphoto2
parentec8244251d7e788958ab44f607cd230da839c185 (diff)
downloadpkgsrc-91563c65c9055a91a429ef93410694bc85aad67e.tar.gz
Patch from bugtracking system of gphoto:
http://sourceforge.net/tracker/index.php?func=detail&aid=438529&group_id=8874&atid=108874 Summary: DC240 USB driver only handle DC240 DC240 driver is compatible with DC280, DC3400 and DC5000 camera. While serial connection should work as is, USB connection is fixed to DC240 as the USB driver only looks for device 0x0120 while the 3 other have another USB device id. See dc240.c, camera_init() and camera_abilities(). Not yet applied to the gphoto2 source tree, but this patch makes it possible to use my Kodak DC280.
Diffstat (limited to 'graphics/gphoto2')
-rw-r--r--graphics/gphoto2/patches/patch-af104
1 files changed, 104 insertions, 0 deletions
diff --git a/graphics/gphoto2/patches/patch-af b/graphics/gphoto2/patches/patch-af
new file mode 100644
index 00000000000..2e13ec65707
--- /dev/null
+++ b/graphics/gphoto2/patches/patch-af
@@ -0,0 +1,104 @@
+$NetBSD: patch-af,v 1.1 2001/07/08 21:45:33 veego Exp $
+
+--- camlibs/kodak/dc240/dc240.c Mon Mar 26 19:25:46 2001
++++ camlibs/kodak/dc240/dc240.c Sun Jul 8 23:35:55 2001
+@@ -29,13 +29,33 @@
+ return (GP_OK);
+ }
+
++struct camera_to_usb {
++ char *name;
++ unsigned short idVendor;
++ unsigned short idProduct;
++} camera_to_usb[] = {
++ { "Kodak DC240", 0x040A, 0x0120 },
++ { "Kodak DC280", 0x040A, 0x0130 },
++ { "Kodak DC3400", 0x040A, 0x0132 },
++ { "Kodak DC5000", 0x040A, 0x0131 },
++ { NULL, 0, 0 }
++};
++
++/*
++ Abilities are based upon what we can do with a DC240.
++ Later cameras have a superset of the DC240 feature and are not
++ currently supported.
++ */
+ int camera_abilities (CameraAbilitiesList *list)
+ {
+ CameraAbilities *a;
++ int i;
+
++ for (i = 0; camera_to_usb[i].name; i++)
++ {
+ a = gp_abilities_new();
+
+- strcpy(a->model, "Kodak DC240");
++ strcpy(a->model, camera_to_usb[i].name);
+ a->port = GP_PORT_SERIAL | GP_PORT_USB;
+ a->speed[0] = 9600;
+ a->speed[1] = 19200;
+@@ -43,20 +63,38 @@
+ a->speed[3] = 57600;
+ a->speed[4] = 115200;
+ a->speed[5] = 0;
+- a->usb_vendor = 0x040A;
+- a->usb_product = 0x0120;
++ a->usb_vendor = camera_to_usb[i].idVendor;
++ a->usb_product = camera_to_usb[i].idProduct;
+ a->operations = GP_OPERATION_CAPTURE_IMAGE;
+ a->file_operations = GP_FILE_OPERATION_DELETE |
+ GP_FILE_OPERATION_PREVIEW;
+ a->folder_operations = GP_FOLDER_OPERATION_NONE;
+
+ gp_abilities_list_append(list, a);
+-
++ }
+ return (GP_OK);
+ }
+
++static short find_usb_device_id (const char *model, unsigned short *idVendor,
++ unsigned short *idProduct)
++{
++ short i;
++ for (i = 0; i < sizeof (camera_to_usb) / sizeof (struct camera_to_usb); i++)
++ {
++ if (strcmp (model, camera_to_usb[i].name) == 0)
++ {
++ *idVendor = camera_to_usb[i].idVendor;
++ *idProduct = camera_to_usb[i].idProduct;
++ return 1;
++ }
++ }
++
++ return 0;
++}
++
+ int camera_init (Camera *camera)
+ {
++ unsigned short usb_vendor, usb_product;
+ int ret;
+ gp_port_settings settings;
+ DC240Data *dd;
+@@ -100,7 +138,12 @@
+ free(dd);
+ return (GP_ERROR);
+ }
+- if (gp_port_usb_find_device(dd->dev, 0x040A, 0x0120) == GP_ERROR) {
++ if (find_usb_device_id (camera->model, &usb_vendor, &usb_product) == 0) {
++ gp_port_free(dd->dev);
++ free (dd);
++ return (GP_ERROR);
++ }
++ if (gp_port_usb_find_device(dd->dev, usb_vendor, usb_product) == GP_ERROR) {
+ gp_port_free(dd->dev);
+ free (dd);
+ return (GP_ERROR);
+@@ -260,7 +303,7 @@
+ strcpy (about->text,
+ _("Kodak DC240 Camera Library\n"
+ "Scott Fritzinger <scottf@gphoto.net>\n"
+- "Camera Library for the Kodak DC240 camera.\n"
++ "Camera Library for the Kodak DC240, DC260, DC3400 and DC5000 cameras.\n"
+ "Rewritten and updated for gPhoto2."));
+
+ return (GP_OK);