From: <mar...@us...> - 2007-10-25 20:59:11
|
Revision: 10818 http://gphoto.svn.sourceforge.net/gphoto/?rev=10818&view=rev Author: marcusmeissner Date: 2007-10-25 13:59:14 -0700 (Thu, 25 Oct 2007) Log Message: ----------- mark cameras with broken nikon capture, use the regular initiatecapture for the DSLRs and newer ones Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2007-10-23 19:05:15 UTC (rev 10817) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2007-10-25 20:59:14 UTC (rev 10818) @@ -1,3 +1,9 @@ +2007-10-25 Marcus Meissner <ma...@je...> + + * library.c, ptp-bugs.h: The newer Nikons have the regular + capture events just fine, just the old ones suck a bit here. + Mark them broken for now. + 2007-09-18 Linus Walleij <tr...@df...> * usb.c, library.c, ptp.c, ptp.h: Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2007-10-23 19:05:15 UTC (rev 10817) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2007-10-25 20:59:14 UTC (rev 10818) @@ -478,25 +478,25 @@ /* Nikon Coolpix SQ: M. Holzbauer, 07 Jul 2003 */ {"Nikon:Coolpix 4100 (PTP mode)", 0x04b0, 0x012d, 0}, /* Nikon Coolpix 5600: Andy Shevchenko, 11 Aug 2005 */ - {"Nikon:Coolpix 5600 (PTP mode)", 0x04b0, 0x012e, PTP_CAP}, + {"Nikon:Coolpix 5600 (PTP mode)", 0x04b0, 0x012e, PTP_CAP|PTP_NIKON_BROKEN_CAP}, /* 4600: Martin Klaffenboeck <mar...@gm...> */ {"Nikon:Coolpix 4600 (PTP mode)", 0x04b0, 0x0130, 0}, /* 4600: Roberto Costa <rob...@en...>, 22 Oct 2006 */ {"Nikon:Coolpix 4600a (PTP mode)", 0x04b0, 0x0131, 0}, - {"Nikon:Coolpix 5900 (PTP mode)", 0x04b0, 0x0135, PTP_CAP}, - {"Nikon:Coolpix P1 (PTP mode)", 0x04b0, 0x0140, PTP_CAP}, + {"Nikon:Coolpix 5900 (PTP mode)", 0x04b0, 0x0135, PTP_CAP|PTP_NIKON_BROKEN_CAP}, + {"Nikon:Coolpix P1 (PTP mode)", 0x04b0, 0x0140, PTP_CAP|PTP_NIKON_BROKEN_CAP}, /* Marcus Meissner */ - {"Nikon:Coolpix P2 (PTP mode)", 0x04b0, 0x0142, PTP_CAP}, + {"Nikon:Coolpix P2 (PTP mode)", 0x04b0, 0x0142, PTP_CAP|PTP_NIKON_BROKEN_CAP}, /* Richard SCHNEIDER <Ric...@ti...> */ {"Nikon:Coolpix S4 (PTP mode)", 0x04b0, 0x0144, 0}, /* Lowe, John Michael <jo...@iu...> */ {"Nikon:Coolpix S2 (PTP mode)", 0x04b0, 0x014e, 0}, {"Nikon:Coolpix S6 (PTP mode)", 0x04b0, 0x014e, 0}, /* Ole Aamot <ol...@gn...> */ - {"Nikon:Coolpix P5000 (PTP mode)",0x04b0, 0x015b, PTP_CAP}, + {"Nikon:Coolpix P5000 (PTP mode)",0x04b0, 0x015b, PTP_CAP|PTP_NIKON_BROKEN_CAP}, {"Nikon:Coolpix L12 (PTP mode)", 0x04b0, 0x015f, 0}, /* Marius Groeger <mar...@we...> */ - {"Nikon:Coolpix S200 (PTP mode)", 0x04b0, 0x0161, PTP_CAP}, + {"Nikon:Coolpix S200 (PTP mode)", 0x04b0, 0x0161, PTP_CAP|PTP_NIKON_BROKEN_CAP}, {"Nikon:Coolpix SQ (PTP mode)", 0x04b0, 0x0202, 0}, /* lars marowski bree, 16.8.2004 */ {"Nikon:Coolpix 4200 (PTP mode)", 0x04b0, 0x0204, 0}, @@ -1765,10 +1765,13 @@ */ /* The Nikon way: Does not send AddObject event ... so try else */ - if (params->deviceinfo.VendorExtensionID==PTP_VENDOR_NIKON) { + if ((params->deviceinfo.VendorExtensionID==PTP_VENDOR_NIKON) && + NIKON_BROKEN_CAP(camera->pl) + ) { PTPObjectHandles handles; int tries = 5; + GP_DEBUG("PTPBUG_NIKON_BROKEN_CAPTURE bug workaround"); while (tries--) { int i; uint16_t ret = ptp_getobjecthandles (params, 0xffffffff, 0x000000, 0x000000, &handles); @@ -1809,7 +1812,6 @@ /* we're not setting *path on error! */ return GP_ERROR; } - fprintf (stderr, "event %x\n", event.Code); switch (event.Code) { case PTP_EC_ObjectRemoved: /* Perhaps from previous Canon based capture + delete. Ignore. */ Modified: trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h 2007-10-23 19:05:15 UTC (rev 10817) +++ trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h 2007-10-25 20:59:14 UTC (rev 10818) @@ -30,6 +30,7 @@ #define PTP_CAP (1<<4) #define PTP_CAP_PREVIEW (1<<5) #define PTP_MTP_PROPLIST_WORKS (1<<6) +#define PTP_NIKON_BROKEN_CAP (1<<7) #define DCIM_WRONG_PARENT_BUG(x) \ ((x)->bugs & PTPBUG_DCIM_WRONG_PARENT) @@ -37,5 +38,7 @@ ((x)->bugs & PTPBUG_DELETE_SENDS_EVENT) #define CAN_HAVE_DUPE_FILE(x) \ ((x)->bugs & (PTPBUG_DUPE_FILE | PTP_MTP)) +#define NIKON_BROKEN_CAP(x) \ + ((x)->bugs & (PTP_NIKON_BROKEN_CAP)) #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |