From: <mar...@us...> - 2008-07-18 07:26:47
|
Revision: 11241 http://gphoto.svn.sourceforge.net/gphoto/?rev=11241&view=rev Author: marcusmeissner Date: 2008-07-18 07:26:56 +0000 (Fri, 18 Jul 2008) Log Message: ----------- added Canon EOS 1D Mark III Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-07-15 21:19:09 UTC (rev 11240) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-07-18 07:26:56 UTC (rev 11241) @@ -1,3 +1,9 @@ +2008-07-18 Marcus Meissner <ma...@je...> + + * library.c: Added the Canon EOS 1D Mark III (reported by jholt) + + * library.c: Disabled more 0x2372 panasonic mass storage ids. + 2008-07-03 Marcus Meissner <ma...@je...> * config.c: allow capture=off Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-07-15 21:19:09 UTC (rev 11240) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-07-18 07:26:56 UTC (rev 11241) @@ -762,6 +762,10 @@ {"Canon:EOS 450D (PTP mode)", 0x04a9, 0x3145, PTP_CAP}, /* reported by Ferry Huberts */ {"Canon:EOS 40D (PTP mode)", 0x04a9, 0x3146, PTP_CAP}, /* user had it working without problem */ + + /* reported by: gp...@lu... */ + {"Canon:EOS 1D Mark III (PTP mode)", 0x04a9, 0x3147, PTPBUG_DCIM_WRONG_PARENT|PTP_CAP}, + {"Canon:PowerShot S5 IS (PTP mode)", 0x04a9, 0x3148, PTP_CAP|PTP_CAP_PREVIEW}, /* AlannY <al...@st...> */ {"Canon:PowerShot A460 (PTP mode)", 0x04a9, 0x3149, PTP_CAP|PTP_CAP_PREVIEW}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-08-26 12:45:26
|
Revision: 11290 http://gphoto.svn.sourceforge.net/gphoto/?rev=11290&view=rev Author: marcusmeissner Date: 2008-08-26 12:45:33 +0000 (Tue, 26 Aug 2008) Log Message: ----------- merged from libmtp. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/device-flags.h trunk/libgphoto2/camlibs/ptp2/music-players.h trunk/libgphoto2/camlibs/ptp2/ptp.c Modified: trunk/libgphoto2/camlibs/ptp2/device-flags.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/device-flags.h 2008-08-24 20:24:18 UTC (rev 11289) +++ trunk/libgphoto2/camlibs/ptp2/device-flags.h 2008-08-26 12:45:33 UTC (rev 11290) @@ -41,7 +41,14 @@ * DEVICE_FLAG_BROKEN_MTPGETOBJECTPROPLIST which only signify * that it's broken when getting metadata for a SINGLE object. * A typical way the implementation may be broken is that it - * may not return a proper count of the objects. + * may not return a proper count of the objects, and sometimes + * (like on the ZENs) objects are simply missing from the list + * if you use this. Sometimes it has been used incorrectly to + * mask bugs in the code (like handling transactions of data + * with size given to -1 (0xFFFFFFFFU), in that case please + * help us remove it now the code is fixed. Sometimes this is + * used because getting all the objects is just too slow and + * the USB transaction will time out if you use this command. */ #define DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL 0x00000001 /** @@ -89,6 +96,10 @@ * The error has only been seen on iriver devices. Turning this * flag on won't hurt anything, just that the check against * filename extension will be done for files of "unknown" type. + * If the player does not even know (reports) that it supports + * ogg even though it does, please use the stronger + * OGG_IS_UNKNOWN flag, which will forcedly support ogg on + * anything with the .ogg filename extension. */ #define DEVICE_FLAG_IRIVER_OGG_ALZHEIMER 0x00000010 /** @@ -127,7 +138,7 @@ * this device, but the metadata is plain ignored on * tracks, though e.g. playlist names can be set.) */ -#define DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST 0x000000100 +#define DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST 0x00000100 /** * The Samsung YP-T10 think Ogg files shall be sent with * the "unknown" (PTP_OFC_Undefined) file type, this gives a @@ -136,9 +147,11 @@ * and a need to report the Ogg support (the device itself does * not properly claim to support it) and need to set filetype * to unknown when storing Ogg files, even though they're not - * actually unknown. + * actually unknown. Later iRivers seem to need this flag since + * they do not report to support OGG even though they actually + * do. */ -#define DEVICE_FLAG_OGG_IS_UNKNOWN 0x000000200 +#define DEVICE_FLAG_OGG_IS_UNKNOWN 0x00000200 /** * The Creative Zen is quite unstable in libmtp but seems to * be better with later firmware versions. However, it still @@ -146,4 +159,27 @@ * flag disables setting the dimensions (which seems to make * no difference to how the graphic is displayed). */ -#define DEVICE_FLAG_BROKEN_SET_SAMPLE_DIMENSIONS 0x000000400 +#define DEVICE_FLAG_BROKEN_SET_SAMPLE_DIMENSIONS 0x00000400 +/** + * Some devices, particularly SanDisk Sansas, need to always + * have their "OS Descriptor" probed in order to work correctly. + * This flag provides that extra massage. + */ +#define DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR 0x00000800 +/** + * Samsung has implimented its own playlist format as a .spl file + * stored in the normal file system, rather than a proper mtp + * playlist. There are multiple versions of the .spl format + * identified by a line in the file: VERSION X.XX + * Version 1.00 is just a simple playlist. + */ +#define DEVICE_FLAG_PLAYLIST_SPL_V1 0x00001000 +/** + * Samsung has implimented its own playlist format as a .spl file + * stored in the normal file system, rather than a proper mtp + * playlist. There are multiple versions of the .spl format + * identified by a line in the file: VERSION X.XX + * Version 2.00 is playlist but allows DNSe sound settings + * to be stored, per playlist. + */ +#define DEVICE_FLAG_PLAYLIST_SPL_V2 0x00002000 Modified: trunk/libgphoto2/camlibs/ptp2/music-players.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/music-players.h 2008-08-24 20:24:18 UTC (rev 11289) +++ trunk/libgphoto2/camlibs/ptp2/music-players.h 2008-08-26 12:45:33 UTC (rev 11290) @@ -25,7 +25,6 @@ * This file is supposed to be included within a struct from both libmtp * and libgphoto2. */ - /* * MTP device list, trying real bad to get all devices into * this list by stealing from everyone I know. @@ -67,31 +66,42 @@ { "Creative", 0x041e, "ZEN", 0x4157, DEVICE_FLAG_IGNORE_HEADER_ERRORS | DEVICE_FLAG_BROKEN_SET_SAMPLE_DIMENSIONS }, // Reported by Ringofan <mc...@us...> { "Creative", 0x041e, "ZEN V 2GB", 0x4158, DEVICE_FLAG_NONE }, + // Reported by Aaron F. Gonzalez <su...@us...> + { "Creative", 0x041e, "ZEN X-Fi", 0x4162, DEVICE_FLAG_NONE }, /* * Samsung * We suspect that more of these are dual mode. * We suspect more of these might need DEVICE_FLAG_NO_ZERO_READS + * We suspect more of these might need DEVICE_FLAG_PLAYLIST_SPL_V1 + * or DEVICE_FLAG_PLAYLIST_SPL_V2 to get playlists working. * YP-NEU, YP-NDU, YP-20, YP-800, YP-MF Series, YP-100, YP-30 * YP-700 and YP-90 are NOT MTP, but use a Samsung custom protocol. */ // From anonymous SourceForge user, not verified { "Samsung", 0x04e8, "YP-900", 0x0409, DEVICE_FLAG_NONE }, + // From MItch <db...@us...> + { "Samsung", 0x04e8, "I550W Phone", 0x04a4, DEVICE_FLAG_NONE }, + // From Gabriel Nunes <gab...@ya...> + { "Samsung", 0x04e8, "YH-920 (501d)", 0x501d, DEVICE_FLAG_UNLOAD_DRIVER }, // From Soren O'Neill - { "Samsung", 0x04e8, "YH-920", 0x5022, DEVICE_FLAG_UNLOAD_DRIVER }, + { "Samsung", 0x04e8, "YH-920 (5022)", 0x5022, DEVICE_FLAG_UNLOAD_DRIVER }, // Contributed by aronvanammers on SourceForge { "Samsung", 0x04e8, "YH-925GS", 0x5024, DEVICE_FLAG_NONE }, // From libgphoto2, according to tests by Stephan Fabel it cannot // get all objects with the getobjectproplist command.. { "Samsung", 0x04e8, "YH-820", 0x502e, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, // Contributed by pol...@us... - { "Samsung", 0x04e8, "YH-925(-GS)", 0x502f, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, + { "Samsung", 0x04e8, "YH-925(-GS)", 0x502f, DEVICE_FLAG_UNLOAD_DRIVER | + DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, // Contributed by anonymous person on SourceForge { "Samsung", 0x04e8, "YH-J70J", 0x5033, DEVICE_FLAG_UNLOAD_DRIVER }, // From XNJB user - { "Samsung", 0x04e8, "YP-Z5", 0x503c, DEVICE_FLAG_UNLOAD_DRIVER }, + // Guessing on .spl flag + { "Samsung", 0x04e8, "YP-Z5", 0x503c, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // From XNJB user - { "Samsung", 0x04e8, "YP-Z5 2GB", 0x5041, DEVICE_FLAG_NONE }, + // Guessing on .spl flag + { "Samsung", 0x04e8, "YP-Z5 2GB", 0x5041, DEVICE_FLAG_NONE | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // Contributed by anonymous person on SourceForge { "Samsung", 0x04e8, "YP-T7J", 0x5047, DEVICE_FLAG_NONE }, // Reported by cst...@gm... @@ -99,23 +109,33 @@ // Reported by Andrew Benson { "Samsung", 0x04e8, "YP-F2J", 0x5057, DEVICE_FLAG_UNLOAD_DRIVER }, // Reported by Patrick <sk...@gm...> - { "Samsung", 0x04e8, "YP-K5", 0x505a, DEVICE_FLAG_NO_ZERO_READS }, + // Just guessing but looks like .spl v1 http://www.anythingbutipod.com/forum/showthread.php?t=14160 + { "Samsung", 0x04e8, "YP-K5", 0x505a, DEVICE_FLAG_NO_ZERO_READS | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // From dev...@gm... - 0x4e8/0x507c is the UMS mode, apparently // do not add that device. // From m.eik michalke - { "Samsung", 0x04e8, "YP-U3", 0x507d, DEVICE_FLAG_NONE }, + // Guessing on .spl flag + { "Samsung", 0x04e8, "YP-U3", 0x507d, DEVICE_FLAG_NONE | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // Reported by Matthew Wilcox <ma...@wi...> // Sergio <sf...@ti...> reports this device need the BROKEN ALL flag. - { "Samsung", 0x04e8, "YP-T9", 0x507f, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, + // Guessing on .spl flag + { "Samsung", 0x04e8, "YP-T9", 0x507f, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // From Paul Clinch - { "Samsung", 0x04e8, "YP-K3", 0x5081, DEVICE_FLAG_NONE }, + // Just guessing but looks like .spl v1 http://www.anythingbutipod.com/forum/showthread.php?t=14160 + { "Samsung", 0x04e8, "YP-K3", 0x5081, DEVICE_FLAG_NONE | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // From XNJB user - { "Samsung", 0x04e8, "YP-P2", 0x5083, DEVICE_FLAG_NO_ZERO_READS }, + // From Alistair Boyle, .spl v2 required for playlists + { "Samsung", 0x04e8, "YP-P2", 0x5083, DEVICE_FLAG_NO_ZERO_READS | DEVICE_FLAG_PLAYLIST_SPL_V2 }, // From Paul Clinch - { "Samsung", 0x04e8, "YP-T10", 0x508a, DEVICE_FLAG_OGG_IS_UNKNOWN | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, + // Guessing on .spl flag + { "Samsung", 0x04e8, "YP-T10", 0x508a, DEVICE_FLAG_OGG_IS_UNKNOWN | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // From Wim Verwimp <wim...@gm...> // Not sure about the Ogg and broken proplist flags here. Just guessing. - { "Samsung", 0x04e8, "YP-S5", 0x508b, DEVICE_FLAG_OGG_IS_UNKNOWN | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, + // Guessing on .spl flag + { "Samsung", 0x04e8, "YP-S5", 0x508b, DEVICE_FLAG_OGG_IS_UNKNOWN | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_PLAYLIST_SPL_V1 }, + // From Ludovic Danigo + // Guessing on .spl flag + { "Samsung", 0x04e8, "YP-S3", 0x5091, DEVICE_FLAG_OGG_IS_UNKNOWN | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_PLAYLIST_SPL_V1 }, // From a rouge .INF file, // this device ID seems to have been recycled for: // the Samsung SGH-A707 Cingular cellphone @@ -136,6 +156,11 @@ * Intel */ { "Intel", 0x045e, "Bandon Portable Media Center", 0x00c9, DEVICE_FLAG_NONE }, + // Reported by Tadimarri Sarath <sar...@gm...> + // No idea why this use an Intel PID, perhaps a leftover from + // the early PMC development days when Intel and Microsoft were + // partnering. + { "Microsoft", 0x045e, "Windows MTP Simulator", 0x0622, DEVICE_FLAG_NONE }, /* * JVC @@ -180,8 +205,17 @@ * several devices (c150 for sure) are definately dual-mode and must * have the USB mass storage driver that hooks them unloaded first. * They all have problematic dual-mode making the device unload effect - * uncertain on these devices. All except for the Linux based ones seem - * to need DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL. + * uncertain on these devices. + * + * All older devices seem to need DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL. + * Old chipsets: e200/c200 use PP5024 from Nvidia (formerly PortalPlayer). + * m200 use TCC770 from Telechips. + * + * The newer Sansa v2 chipset, AD3525 from Austriamicrosystems (AMS) found + * in e280 v2 c200 v2, Clip, Fuze etc require DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST + * and DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR to work properly. + * + * For more info see: http://daniel.haxx.se/sansa/v2.html */ // Reported by Brian Robison { "SanDisk", 0x0781, "Sansa m230/m240", 0x7400, @@ -203,15 +237,16 @@ DEVICE_FLAG_NO_RELEASE_INTERFACE }, // Reported by XNJB user { "SanDisk", 0x0781, "Sansa e280 v2", 0x7422, - DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR }, // Reported by XNJB user { "SanDisk", 0x0781, "Sansa m240", 0x7430, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | DEVICE_FLAG_NO_RELEASE_INTERFACE }, // Reported by Eugene Brevdo <eb...@pr...> - { "SanDisk", 0x0781, "Sansa Clip", 0x7432, DEVICE_FLAG_UNLOAD_DRIVER | - DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, + { "SanDisk", 0x0781, "Sansa Clip", 0x7432, + DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR }, // Reported by anonymous user at sourceforge.net { "SanDisk", 0x0781, "Sansa c240/c250", 0x7450, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | @@ -231,8 +266,8 @@ // Reported by Patrick <sk...@gm...> // There are apparently problems with this device. { "SanDisk", 0x0781, "Sansa Fuze", 0x74c0, - DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR }, /* * iRiver @@ -297,13 +332,25 @@ { "iRiver", 0x4102, "T60", 0x1134, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS | DEVICE_FLAG_IRIVER_OGG_ALZHEIMER }, + // Reported by two anonymous SourceForge users + // Needs the stronger OGG_IS_UNKNOWN flag to support OGG properly, + // be aware of newer players that may be needing this too. + { "iRiver", 0x4102, "E100", 0x1141, + DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS | + DEVICE_FLAG_OGG_IS_UNKNOWN }, + // Reported by anonymous SourceForge user + // Need verification of whether this firmware really need all these flags + { "iRiver", 0x4102, "E100 v2", 0x1142, + DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS | + DEVICE_FLAG_OGG_IS_UNKNOWN }, // Reported by Scott Call + // Assume this actually supports OGG though it reports it doesn't. { "iRiver", 0x4102, "H10 20GB", 0x2101, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS | - DEVICE_FLAG_IRIVER_OGG_ALZHEIMER }, + DEVICE_FLAG_OGG_IS_UNKNOWN }, { "iRiver", 0x4102, "H10", 0x2102, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS | - DEVICE_FLAG_IRIVER_OGG_ALZHEIMER }, + DEVICE_FLAG_OGG_IS_UNKNOWN }, /* @@ -330,6 +377,10 @@ { "Toshiba", 0x0930, "Gigabeat MEU202", 0x0018, DEVICE_FLAG_NO_RELEASE_INTERFACE }, // Reported by Rolf <japan (at) dl3lar.de> { "Toshiba", 0x0930, "Gigabeat T", 0x0019, DEVICE_FLAG_NONE }, + // Reported by Phil Ingram <uk...@us...> + // Tentatively added - no real reports of this device ID being MTP, + // reports as USB Mass Storage currently. + { "Toshiba", 0x0930, "Gigabeat MEU201", 0x001a, DEVICE_FLAG_NONE }, /* @@ -362,11 +413,15 @@ * interface. */ { "Dunlop", 0x10d6, "MP3 player 1GB / EGOMAN MD223AFD", 0x2200, DEVICE_FLAG_UNLOAD_DRIVER}, + // Reported by Steven Black <ste...@us...> + // Obviously this company goes by many names. + // This device is USB 2.0 only. + { "Memorex", 0x10d6, "MMP 8585/8586", 0x2300, DEVICE_FLAG_UNLOAD_DRIVER }, /* * Microsoft */ - // Reported by Farooq Zaman + // Reported by Farooq Zaman (used for all Zunes) { "Microsoft", 0x045e, "Zune", 0x0710, DEVICE_FLAG_NONE }, /* @@ -376,7 +431,7 @@ // Reported by Chris Bagwell <ch...@cn...> // Apparently this comes with a firmware upgrade to the original // Stiletto as well. - { "Sirius", 0x18f6, "Stiletto 2", 0x0110, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, + { "Sirius", 0x18f6, "Stiletto 2", 0x0110, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, /* * Canon @@ -393,12 +448,18 @@ */ // From: DoomHammer <ga...@us...> { "Nokia", 0x0421, "N81 Mobile Phone", 0x000a, DEVICE_FLAG_NONE }, + // From an anonymous SourceForge user + { "Nokia", 0x0421, "6120c Classic Mobile Phone", 0x002e, DEVICE_FLAG_NONE }, // From: DoomHammer <ga...@us...> { "Nokia", 0x0421, "3110c Mobile Phone", 0x005f, DEVICE_FLAG_NONE }, // From: Vasily <sp...@us...> { "Nokia", 0x0421, "3109c Mobile Phone", 0x0065, DEVICE_FLAG_NONE }, + // From: <ra...@us...> + { "Nokia", 0x0421, "5310 XpressMusic", 0x006c, DEVICE_FLAG_NONE }, // From: robin (AT) headbank D0Tco DOTuk { "Nokia", 0x0421, "N95 Mobile Phone 8GB", 0x006e, DEVICE_FLAG_NONE }, + // From: danielw + { "Nokia", 0x0421, "E71", 0x00e4, DEVICE_FLAG_NONE }, // From: Christian Rusa <kri...@us...> { "Nokia", 0x0421, "5700 XpressMusic Mobile Phone", 0x04b4, DEVICE_FLAG_NONE }, // From: Mitchell Hicks <mi...@ya...> @@ -411,6 +472,9 @@ { "Nokia", 0x0421, "N95 Mobile Phone", 0x04ef, DEVICE_FLAG_NONE }, // From: Pat Nicholls <pa...@pa...> { "Nokia", 0x0421, "N80 Internet Edition (Media Player)", 0x04f1, DEVICE_FLAG_UNLOAD_DRIVER }, + // Reported by anonymous SourceForge user + // One thing stated by reporter (Nokia model) another by the detect log... + { "Nokia/Verizon", 0x05c6, "6205 Balboa/Verizon Music Phone", 0x3196, DEVICE_FLAG_NONE }, /* @@ -446,17 +510,22 @@ { "Palm Handspring", 0x1703, "Pocket Tunes 4", 0x0002, DEVICE_FLAG_NONE }, /* - * TrekStor devices + * TrekStor and Medion devices * Their datasheet claims their devices are dualmode so probably needs to * unload the attached drivers here. */ // Reported by Stefan Voss <sv...@we...> // This is a Sigmatel SoC with a hard disk. { "TrekStor", 0x066f, "Vibez 8/12GB", 0x842a, - DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, + DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, + // Reported by anonymous SourceForge user. + // This one done for Medion, whatever that is. Error reported so assume + // the same bug flag as its ancestor above. + { "Medion", 0x066f, "MD8333", 0x8550, + DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, // Reported by Cristi Magherusan <ma...@ge...> { "TrekStor", 0x0402, "i.Beat Sweez FM", 0x0611, - DEVICE_FLAG_UNLOAD_DRIVER }, + DEVICE_FLAG_UNLOAD_DRIVER }, /* * Disney/Tevion (have had no reports of these actually working.) @@ -474,6 +543,8 @@ { "Cowon", 0x0e21, "iAudio U3 (MTP mode)", 0x0701, DEVICE_FLAG_NONE }, // Reported by Roberth Karman { "Cowon", 0x0e21, "iAudio 7 (MTP mode)", 0x0751, DEVICE_FLAG_NONE }, + // Reported by an anonymous SourceForge user + { "Cowon", 0x0e21, "iAudio U5 (MTP mode)", 0x0761, DEVICE_FLAG_NONE }, // Reported by TJ Something <tjb...@us...> { "Cowon", 0x0e21, "iAudio D2 (MTP mode)", 0x0801, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, @@ -491,7 +562,10 @@ * LG Electronics */ // Not verified - anonymous submission - { "LG", 0x043e, "UP3", 0x70b1, DEVICE_FLAG_NONE }, + { "LG Electronics Inc.", 0x043e, "UP3", 0x70b1, DEVICE_FLAG_NONE }, + // Reported by Joseph Nahmias <jo...@na...> + { "LG Electronics Inc.", 0x1004, "VX8550 V CAST Mobile Phone", 0x6010, + DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR }, /* * Sony @@ -521,6 +595,12 @@ { "SonyEricsson", 0x0fce, "W910", 0x0076, DEVICE_FLAG_NONE }, // Reported by Zack <za...@us...> { "SonyEricsson", 0x0fce, "W890i", 0x00b3, DEVICE_FLAG_NONE }, + // Reported by robert dot ahlskog at gmail + { "SonyEricsson", 0x0fce, "W760i", 0x00c6, DEVICE_FLAG_NONE }, + // Reported by Linus Åkesson <lin...@us...> + { "SonyEricsson", 0x0fce, "C902", 0x00d4, DEVICE_FLAG_NONE }, + // Reported by an anonymous SourceForge user + { "SonyEricsson", 0x0fce, "C702", 0x00d9, DEVICE_FLAG_NONE }, /* * Motorola Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-08-24 20:24:18 UTC (rev 11289) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-08-26 12:45:33 UTC (rev 11290) @@ -875,13 +875,20 @@ ptp_deleteobject (PTPParams* params, uint32_t handle, uint32_t ofc) { PTPContainer ptp; + uint16_t ret; PTP_CNT_INIT(ptp); ptp.Code=PTP_OC_DeleteObject; ptp.Param1=handle; ptp.Param2=ofc; ptp.Nparam=2; - return ptp_transaction(params, &ptp, PTP_DP_NODATA, 0, NULL, NULL); + ret = ptp_transaction(params, &ptp, PTP_DP_NODATA, 0, NULL, NULL); + if (ret != PTP_RC_OK) { + return ret; + } + /* If the object is cached and could be removed, cleanse cache. */ + ptp_remove_object_from_cache(params, handle); + return PTP_RC_OK; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-08-28 10:42:31
|
Revision: 11291 http://gphoto.svn.sourceforge.net/gphoto/?rev=11291&view=rev Author: marcusmeissner Date: 2008-08-28 10:42:37 +0000 (Thu, 28 Aug 2008) Log Message: ----------- more timeout for proplist reading Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/music-players.h Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-08-26 12:45:33 UTC (rev 11290) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-08-28 10:42:37 UTC (rev 11291) @@ -1,3 +1,10 @@ +2008-08-28 Marcus Meissner <ma...@je...> + + * library.c: Increase timeout for mtp proplist reading (from + Chris Bagwell). + + * ptp.c, music-players.h, device-flags.h: Merged updates from libmtp. + 2008-07-31 Marcus Meissner <ma...@je...> * library.c: Added Nikon Coolpix L16 , Nikon D700. Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-08-26 12:45:33 UTC (rev 11290) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-08-28 10:42:37 UTC (rev 11291) @@ -3945,8 +3945,26 @@ int cnt = 0, i, j, nrofprops = 0; uint32_t lasthandle = 0xffffffff; MTPProperties *props = NULL, *xpl; + int oldtimeout; + /* The follow request causes the device to generate + * a list of very file on the device and return it + * in a single response. + * + * Some slow device as well as devices with very + * large file systems can easily take longer then + * the standard timeout value before it is able + * to return a response. + * + * Temporarly set timeout to allow working with + * widest range of devices. + */ + gp_port_get_timeout (camera->port, &oldtimeout); + gp_port_set_timeout (camera->port, 60000); + ret = ptp_mtp_getobjectproplist (&camera->pl->params, 0xffffffff, &props, &nrofprops); + gp_port_set_timeout (camera->port, oldtimeout); + if (ret != PTP_RC_OK) goto fallback; params->props = props; /* cache it */ Modified: trunk/libgphoto2/camlibs/ptp2/music-players.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/music-players.h 2008-08-26 12:45:33 UTC (rev 11290) +++ trunk/libgphoto2/camlibs/ptp2/music-players.h 2008-08-28 10:42:37 UTC (rev 11291) @@ -429,9 +429,7 @@ */ { "Sirius", 0x18f6, "Stiletto", 0x0102, DEVICE_FLAG_NONE }, // Reported by Chris Bagwell <ch...@cn...> - // Apparently this comes with a firmware upgrade to the original - // Stiletto as well. - { "Sirius", 0x18f6, "Stiletto 2", 0x0110, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, + { "Sirius", 0x18f6, "Stiletto 2", 0x0110, DEVICE_FLAG_NONE }, /* * Canon This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-09-20 21:24:27
|
Revision: 11325 http://gphoto.svn.sourceforge.net/gphoto/?rev=11325&view=rev Author: marcusmeissner Date: 2008-09-20 21:24:18 +0000 (Sat, 20 Sep 2008) Log Message: ----------- do not disable viewfnder mode after one frame of preview. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-09-20 14:19:56 UTC (rev 11324) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-09-20 21:24:18 UTC (rev 11325) @@ -1,3 +1,9 @@ +2008-09-20 Marcus Meissner <ma...@je...> + + * library.c: Do not disable viewfinder just after one preview. + Repeatedly switching on/off viewfinder mode causes refocus + all the time. + 2008-08-28 Marcus Meissner <ma...@je...> * library.c: Increase timeout for mtp proplist reading (from Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-09-20 14:19:56 UTC (rev 11324) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-09-20 21:24:18 UTC (rev 11325) @@ -1257,12 +1257,15 @@ /* Add an arbitrary file name so caller won't crash */ gp_file_set_name (file, "canon_preview.jpg"); +#if 0 + /* Leave out, otherwise we refocus all the time */ ret = ptp_canon_viewfinderoff (params); if (ret != PTP_RC_OK) { gp_context_error (context, _("Canon disable viewfinder failed: %d"), ret); SET_CONTEXT_P(params, NULL); return GP_ERROR; } +#endif SET_CONTEXT_P(params, NULL); return GP_OK; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-10-10 18:51:17
|
Revision: 11369 http://gphoto.svn.sourceforge.net/gphoto/?rev=11369&view=rev Author: marcusmeissner Date: 2008-10-10 18:51:03 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Factor out a ptp time parsing function. Use the ptp time parsing function. Use the MTP objectlist downloader for the Canon Digital IXUS SX100IS. implemented DateCreatedTime , ModifiedTime, and 32/64bit ObjectSizes for MTP objectlist Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/cameras/canon-powershot-sx100is.txt trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp-pack.c Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-10-10 18:44:46 UTC (rev 11368) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-10-10 18:51:03 UTC (rev 11369) @@ -1,3 +1,10 @@ +2008-10-09 Marcus Meissner <ma...@je...> + + * ptp-pack.c: factored out ptp time string parser + * library.c: also support MTP commands for cameras. + (fast directory download) + Using it for the Canon Digital IXUS SX100IS already. + 2008-09-20 Marcus Meissner <ma...@je...> * library.c: Do not disable viewfinder just after one preview. Modified: trunk/libgphoto2/camlibs/ptp2/cameras/canon-powershot-sx100is.txt =================================================================== --- trunk/libgphoto2/camlibs/ptp2/cameras/canon-powershot-sx100is.txt 2008-10-10 18:44:46 UTC (rev 11368) +++ trunk/libgphoto2/camlibs/ptp2/cameras/canon-powershot-sx100is.txt 2008-10-10 18:51:03 UTC (rev 11369) @@ -133,70 +133,78 @@ 0xd406 0xd407 -Model Port ----------------------------------------------------------- -Canon Powershot SX100 IS (PTP mode) usb: Camera summary: Model: Canon PowerShot SX100 IS device version: 1-4.2.1.0 - serial number: dddddddddddddddddddddddddd + serial number: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Vendor extension ID: 0x0000000b Vendor extension description: (null) Capture Formats: JPEG Display Formats: Association/Directory, Script, DPOF, MS AVI, MS Wave, JPEG, Defined Type, CRW, Unknown(b103), Unknown(bf01) +Supported MTP Object Properties: + Association/Directory/3001: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc08/DateCreated dc09/DateModified + Script/3002: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc08/DateCreated dc09/DateModified + DPOF/3006: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc08/DateCreated dc09/DateModified + MS AVI/300a: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dc08/DateCreated dc09/DateModified dc89/Duration de93/SampleRate de94/NumberOfChannels de97/ScanDepth de9a/AudioBitRate de9b/VideoFourCCCodec de9c/VideoBitRate + MS Wave/3008: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc08/DateCreated dc09/DateModified dc89/Duration de93/SampleRate de94/NumberOfChannels de9a/AudioBitRate + JPEG/3801: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified + Defined Type/3800: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified + CRW/b101: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified + Unknown(b103)/b103: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified + Unknown(bf01)/bf01: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc08/DateCreated dc09/DateModified Device Capabilities: - File Download, File Deletion, File Upload - Generic Image Capture, No Open Capture, Canon Capture + File Download, File Deletion, File Upload + Generic Image Capture, No Open Capture, Canon Capture Storage Devices Summary: store_00010001: - StorageDescription: None - VolumeLabel: None - Storage Type: Removable RAM (memory card) - Filesystemtype: Digital Camera Layout (DCIM) - Access Capability: Read-Write - Maximum Capability: 14860288 (14 MB) - Free Space (Bytes): 507904 (0 MB) - Free Space (Images): -1 + StorageDescription: None + VolumeLabel: None + Storage Type: Removable RAM (memory card) + Filesystemtype: Digital Camera Layout (DCIM) + Access Capability: Read-Write + Maximum Capability: 14860288 (14 MB) + Free Space (Bytes): 12697600 (12 MB) + Free Space (Images): -1 Device Property Summary: Event Emulate Mode(0xd045):(readwrite) (type=0x4) Enumeration [1,2,3,4,5,6,7] value: 2 Property 0xd04a:(readwrite) (type=0x2) Enumeration [0,1,2,3] value: 0 Size of Output Data from Camera(0xd02e):(read only) (type=0x6) 524288 Size of Input Data to Camera(0xd02f):(read only) (type=0x6) 262144 -Battery Kind(0xd002):(read only) (type=0x4) Enumeration [0,1,2,3,4,5] value: 0 +Battery Type(0xd002):(read only) (type=0x4) Enumeration [0,1,2,3,4,5] value: 0 Battery Mode(0xd003):(read only) (type=0x6) Enumeration [0,1,2,3] value: 1 -UNIX Time(0xd034):(readwrite) (type=0x6) 1214588664 +UNIX Time(0xd034):(readwrite) (type=0x6) 1223655918 Type of Slideshow(0xd047):(read only) (type=0x4) 0 DPOF Version(0xd046):(read only) (type=0x4) 257 Supported Thumb Size(0xd02d):(read only) (type=0x4006) a[4] 119,0,159,0 -Average Filesizes(0xd048):(read only) (type=0x4006) a[19] -3518464,2563072,1640448,0,254976,2109440,1428480,914432,0,153600,1003520,711680,455680,0,86016,0,1026048,571392,284672 +Average Filesizes(0xd048):(read only) (type=0x4006) a[19] 3518464,2563072,1640448,0,254976,2109440,1428480,914432,0,153600,1003520,711680,455680,0,86016,0,1026048,571392,284672 Size Quality Mode(0xd02c):(read only) (type=0x4006) Enumeration [ - a[6] 2448,3264,1,0,0,0, - a[6] 2448,3264,6,0,0,0, - a[6] 2448,3264,11,0,0,0, - a[6] 1944,2592,2,0,0,0, - a[6] 1944,2592,7,0,0,0, - a[6] 1944,2592,12,0,0,0, - a[6] 1536,2048,3,0,0,0, - a[6] 1536,2048,8,0,0,0, - a[6] 1536,2048,13,0,0,0, - a[6] 1200,1600,17,0,0,0, - a[6] 1200,1600,18,0,0,0, - a[6] 1200,1600,19,0,0,0, - a[6] 480,640,5,0,0,0, - a[6] 480,640,10,0,0,0, - a[6] 480,640,15,0,0,0 - ] value: a[6] 0,0,0,0,0,0 + a[6] 2448,3264,1,0,0,0, + a[6] 2448,3264,6,0,0,0, + a[6] 2448,3264,11,0,0,0, + a[6] 1944,2592,2,0,0,0, + a[6] 1944,2592,7,0,0,0, + a[6] 1944,2592,12,0,0,0, + a[6] 1536,2048,3,0,0,0, + a[6] 1536,2048,8,0,0,0, + a[6] 1536,2048,13,0,0,0, + a[6] 1200,1600,17,0,0,0, + a[6] 1200,1600,18,0,0,0, + a[6] 1200,1600,19,0,0,0, + a[6] 480,640,5,0,0,0, + a[6] 480,640,10,0,0,0, + a[6] 480,640,15,0,0,0 + ] value: a[6] 0,0,0,0,0,0 Remote API Version(0xd030):(read only) (type=0x6) 256 Model ID(0xd049):(read only) (type=0x6) 36241408 Camera Model(0xd032):(read only) (type=0xffff) 'Canon PowerShot SX100 IS' -Camera Owner(0xd033):(readwrite) (type=0x4002) a[0] +Camera Owner(0xd033):(readwrite) (type=0x4002) a[16] 77,97,114,99,117,115,32,77,101,105,115,115,110,101,114,0 Firmware Version(0xd031):(read only) (type=0x6) 16777216 -Property 0xd050:(read only) (type=0x2) 0 +Property 0xd050:(read only) (type=0x2) 1 Property 0xd402:(read only) (type=0xffff) 'Canon PowerShot SX100 IS' Property 0xd406:(readwrite) (type=0xffff) 'Windows' Property 0xd407:(read only) (type=0x6) 1 + Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-10 18:44:46 UTC (rev 11368) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-10 18:51:03 UTC (rev 11369) @@ -244,15 +244,19 @@ if ( (camera->pl->params.deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && (camera->port->type == GP_PORT_USB) && (a.usb_vendor == 0x4a9) - ) + ) { + camera->pl->bugs |= PTP_MTP; camera->pl->params.deviceinfo.VendorExtensionID = PTP_VENDOR_CANON; + } /* Newer Nikons (D40) say that they are MTP devices. Restore Nikon vendor extid. */ if ( (camera->pl->params.deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && (camera->port->type == GP_PORT_USB) && (a.usb_vendor == 0x4b0) - ) + ) { + camera->pl->bugs |= PTP_MTP; camera->pl->params.deviceinfo.VendorExtensionID = PTP_VENDOR_NIKON; + } } static struct { @@ -803,7 +807,7 @@ /* Roger Lynn <ro...@ri...> */ {"Canon:PowerShot A720 IS (PTP mode)", 0x04a9, 0x315d, PTPBUG_DELETE_SENDS_EVENT}, /* Mats Petersson <mat...@lt...> */ - {"Canon:Powershot SX100 IS (PTP mode)", 0x04a9, 0x315e, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW}, + {"Canon:Powershot SX100 IS (PTP mode)", 0x04a9, 0x315e, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW|PTP_MTP|PTP_MTP_PROPLIST_WORKS}, /* Ruben Vandamme <van...@be...> */ {"Canon:Digital IXUS 860 IS", 0x04a9, 0x3160, PTPBUG_DELETE_SENDS_EVENT}, @@ -1022,6 +1026,16 @@ gp_context_error (ptp_data->context, "%s", buf); } +static int +is_mtp_capable(Camera *camera) { + PTPParams *params = &camera->pl->params; + if (params->deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) + return 1; + if (camera->pl->bugs & PTP_MTP) + return 1; + return 0; +} + int camera_abilities (CameraAbilitiesList *list) { @@ -2140,7 +2154,7 @@ n = snprintf (txt, spaceleft,"\n"); if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; - if ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if (is_mtp_capable (camera) && ptp_operation_issupported(params,PTP_OC_MTP_GetObjectPropsSupported) ) { n = snprintf (txt, spaceleft,_("Supported MTP Object Properties:\n")); @@ -3217,7 +3231,7 @@ break; } case GP_FILE_TYPE_METADATA: - if ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if (is_mtp_capable (camera) && ptp_operation_issupported(params,PTP_OC_MTP_GetObjectPropsSupported) ) return ptp_mtp_render_metadata (params,params->handles.Handler[object_id],oi->ObjectFormat,file); @@ -3231,7 +3245,7 @@ oi->ThumbFormat == PTP_OFC_Undefined)) return (GP_ERROR_NOT_SUPPORTED); - if ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if (is_mtp_capable (camera) && (oi->ObjectFormat == PTP_OFC_MTP_AbstractAudioVideoPlaylist)) return mtp_get_playlist (camera, file, params->handles.Handler[object_id], context); @@ -3304,7 +3318,7 @@ } memset(&oi, 0, sizeof (PTPObjectInfo)); if (type == GP_FILE_TYPE_METADATA) { - if ((params->deviceinfo.VendorExtensionID==PTP_VENDOR_MICROSOFT) && + if (is_mtp_capable (camera) && ptp_operation_issupported(params,PTP_OC_MTP_GetObjectPropsSupported) ) { uint32_t object_id; @@ -3354,7 +3368,7 @@ oi.ParentObject = parent; gp_file_get_mtime(file, &oi.ModificationDate); - if ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if (is_mtp_capable (camera) && ( strstr(filename,".zpl") || strstr(filename, ".pla") )) { char *object; gp_file_get_data_and_size (file, (const char**)&object, &intsize); @@ -3549,7 +3563,7 @@ } /* MTP playlists have their own size calculation */ - if ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if (is_mtp_capable (camera) && (oi->ObjectFormat == PTP_OFC_MTP_AbstractAudioVideoPlaylist)) { int ret, contentlen; ret = mtp_get_playlist_string (camera, params->handles.Handler[object_id], NULL, &contentlen); @@ -3946,7 +3960,7 @@ #endif /* Microsoft/MTP also has fast directory retrieval. */ - if ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if (is_mtp_capable (camera) && ptp_operation_issupported(params,PTP_OC_MTP_GetObjPropList) && (camera->pl->bugs & PTP_MTP_PROPLIST_WORKS) ) { @@ -4006,26 +4020,60 @@ i++; lasthandle = xpl->ObjectHandle; params->handles.Handler[i] = xpl->ObjectHandle; - gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "objectid %u", xpl->ObjectHandle); + gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "objectid 0x%x", xpl->ObjectHandle); } switch (xpl->property) { case PTP_OPC_ParentObject: + if (xpl->datatype != PTP_DTC_UINT32) { + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "parentobject has type 0x%x???", xpl->datatype); + break; + } oinfos[i].ParentObject = xpl->propval.u32; - gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "parent %u", xpl->propval.u32); + gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "parent 0x%x", xpl->propval.u32); break; case PTP_OPC_ObjectFormat: + if (xpl->datatype != PTP_DTC_UINT16) { + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "objectformat has type 0x%x???", xpl->datatype); + break; + } oinfos[i].ObjectFormat = xpl->propval.u16; - gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "ofc %u", xpl->propval.u16); + gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "ofc 0x%x", xpl->propval.u16); break; case PTP_OPC_ObjectSize: - oinfos[i].ObjectCompressedSize = xpl->propval.u32; + switch (xpl->datatype) { + case PTP_DTC_UINT32: + oinfos[i].ObjectCompressedSize = xpl->propval.u32; + break; + case PTP_DTC_UINT64: + oinfos[i].ObjectCompressedSize = xpl->propval.u64; + break; + default: + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "objectsize has type 0x%x???", xpl->datatype); + break; + } gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "objectsize %u", xpl->propval.u32); break; case PTP_OPC_StorageID: + if (xpl->datatype != PTP_DTC_UINT32) { + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "storageid has type 0x%x???", xpl->datatype); + break; + } oinfos[i].StorageID = xpl->propval.u32; - gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "storageid %u", xpl->propval.u32); + gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "storageid 0x%x", xpl->propval.u32); break; + case PTP_OPC_ProtectionStatus:/*UINT16*/ + if (xpl->datatype != PTP_DTC_UINT16) { + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "protectionstatus has type 0x%x???", xpl->datatype); + break; + } + oinfos[i].ProtectionStatus = xpl->propval.u16; + gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "protection 0x%x", xpl->propval.u16); + break; case PTP_OPC_ObjectFileName: + if (xpl->datatype != PTP_DTC_STR) { + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "filename has type 0x%x???", xpl->datatype); + break; + } if (xpl->propval.str) { gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "filename %s", xpl->propval.str); oinfos[i].Filename = strdup(xpl->propval.str); @@ -4033,6 +4081,22 @@ oinfos[i].Filename = NULL; } break; + case PTP_OPC_DateCreated: + if (xpl->datatype != PTP_DTC_STR) { + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "datecreated has type 0x%x???", xpl->datatype); + break; + } + gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "capturedate %s", xpl->propval.str); + oinfos[i].CaptureDate = ptp_unpack_PTPTIME (xpl->propval.str); + break; + case PTP_OPC_DateModified: + if (xpl->datatype != PTP_DTC_STR) { + gp_log (GP_LOG_ERROR, "ptp2/mtpfast", "datemodified has type 0x%x???", xpl->datatype); + break; + } + gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "moddate %s", xpl->propval.str); + oinfos[i].ModificationDate = ptp_unpack_PTPTIME (xpl->propval.str); + break; default: if ((xpl->property & 0xfff0) == 0xdc00) gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "case %x type %x unhandled", xpl->property, xpl->datatype); @@ -4259,16 +4323,14 @@ camera->pl->params.cancelreq_func = ptp_usb_control_cancel_request; break; case GP_PORT_PTPIP: { - GPPortInfo pinfo; - char *path; + GPPortInfo info; - ret = gp_port_get_info (camera->port, &pinfo); + ret = gp_port_get_info (camera->port, &info); if (ret != GP_OK) { gp_log (GP_LOG_ERROR, "ptpip", "Failed to get port info?\n"); return ret; } - gp_port_info_get_path (pinfo, &path); - ret = ptp_ptpip_connect (&camera->pl->params, path); + ret = ptp_ptpip_connect (&camera->pl->params, info.path); if (ret != GP_OK) { gp_log (GP_LOG_ERROR, "ptpip", "Failed to connect.\n"); return ret; Modified: trunk/libgphoto2/camlibs/ptp2/ptp-pack.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2008-10-10 18:44:46 UTC (rev 11368) +++ trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2008-10-10 18:51:03 UTC (rev 11369) @@ -467,17 +467,51 @@ return (PTP_oi_Filename+filenamelen*2+(capturedatelen+1)*3); } +static time_t +ptp_unpack_PTPTIME (const char *str) { + char ptpdate[40]; + char tmp[5]; + int ptpdatelen; + struct tm tm; + + if (!str) + return 0; + ptpdatelen = strlen(str); + if (ptpdatelen >= sizeof (ptpdate)) + return 0; + strcpy (ptpdate, str); + if (ptpdatelen<=15) + return 0; + + memset(&tm,0,sizeof(tm)); + strncpy (tmp, ptpdate, 4); + tmp[4] = 0; + tm.tm_year=atoi (tmp) - 1900; + strncpy (tmp, ptpdate + 4, 2); + tmp[2] = 0; + tm.tm_mon = atoi (tmp) - 1; + strncpy (tmp, ptpdate + 6, 2); + tmp[2] = 0; + tm.tm_mday = atoi (tmp); + strncpy (tmp, ptpdate + 9, 2); + tmp[2] = 0; + tm.tm_hour = atoi (tmp); + strncpy (tmp, ptpdate + 11, 2); + tmp[2] = 0; + tm.tm_min = atoi (tmp); + strncpy (tmp, ptpdate + 13, 2); + tmp[2] = 0; + tm.tm_sec = atoi (tmp); + return mktime (&tm); +} + static inline void ptp_unpack_OI (PTPParams *params, unsigned char* data, PTPObjectInfo *oi, unsigned int len) { uint8_t filenamelen; uint8_t capturedatelen; char *capture_date; - char tmp[16]; - struct tm tm; - memset(&tm,0,sizeof(tm)); - oi->StorageID=dtoh32a(&data[PTP_oi_StorageID]); oi->ObjectFormat=dtoh16a(&data[PTP_oi_ObjectFormat]); oi->ProtectionStatus=dtoh16a(&data[PTP_oi_ProtectionStatus]); @@ -500,56 +534,14 @@ /* subset of ISO 8601, without '.s' tenths of second and * time zone */ - if (capturedatelen>15) - { - strncpy (tmp, capture_date, 4); - tmp[4] = 0; - tm.tm_year=atoi (tmp) - 1900; - strncpy (tmp, capture_date + 4, 2); - tmp[2] = 0; - tm.tm_mon = atoi (tmp) - 1; - strncpy (tmp, capture_date + 6, 2); - tmp[2] = 0; - tm.tm_mday = atoi (tmp); - strncpy (tmp, capture_date + 9, 2); - tmp[2] = 0; - tm.tm_hour = atoi (tmp); - strncpy (tmp, capture_date + 11, 2); - tmp[2] = 0; - tm.tm_min = atoi (tmp); - strncpy (tmp, capture_date + 13, 2); - tmp[2] = 0; - tm.tm_sec = atoi (tmp); - oi->CaptureDate=mktime (&tm); - } + oi->CaptureDate = ptp_unpack_PTPTIME(capture_date); free(capture_date); - /* now it's modification date ;) */ + /* now the modification date ... */ capture_date = ptp_unpack_string(params, data, PTP_oi_filenamelen+filenamelen*2 +capturedatelen*2+2,&capturedatelen); - if (capturedatelen>15) - { - strncpy (tmp, capture_date, 4); - tmp[4] = 0; - tm.tm_year=atoi (tmp) - 1900; - strncpy (tmp, capture_date + 4, 2); - tmp[2] = 0; - tm.tm_mon = atoi (tmp) - 1; - strncpy (tmp, capture_date + 6, 2); - tmp[2] = 0; - tm.tm_mday = atoi (tmp); - strncpy (tmp, capture_date + 9, 2); - tmp[2] = 0; - tm.tm_hour = atoi (tmp); - strncpy (tmp, capture_date + 11, 2); - tmp[2] = 0; - tm.tm_min = atoi (tmp); - strncpy (tmp, capture_date + 13, 2); - tmp[2] = 0; - tm.tm_sec = atoi (tmp); - oi->ModificationDate=mktime (&tm); - } + oi->ModificationDate = ptp_unpack_PTPTIME(capture_date); free(capture_date); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-10-12 19:45:30
|
Revision: 11377 http://gphoto.svn.sourceforge.net/gphoto/?rev=11377&view=rev Author: marcusmeissner Date: 2008-10-12 19:45:19 +0000 (Sun, 12 Oct 2008) Log Message: ----------- adjusted summary output Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-10-12 19:43:22 UTC (rev 11376) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-10-12 19:45:19 UTC (rev 11377) @@ -1,3 +1,7 @@ +2008-10-12 Marcus Meissner <ma...@je...> + + * library.c: Adjusted summary output a bit. + 2008-10-09 Marcus Meissner <ma...@je...> * ptp-pack.c: factored out ptp time string parser Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-12 19:43:22 UTC (rev 11376) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-12 19:45:19 UTC (rev 11377) @@ -2108,23 +2108,41 @@ SET_CONTEXT(camera, context); spaceleft = sizeof(summary->text); - n = snprintf (summary->text, sizeof (summary->text), - _("Model: %s\n" - " device version: %s\n" - " serial number: %s\n" - "Vendor extension ID: 0x%08x\n" - "Vendor extension description: %s\n" - ), - params->deviceinfo.Model, - params->deviceinfo.DeviceVersion, - params->deviceinfo.SerialNumber, - params->deviceinfo.VendorExtensionID, - params->deviceinfo.VendorExtensionDesc); + txt = summary->text; - if (n>=sizeof (summary->text)) - return GP_OK; - spaceleft -= n; - txt = summary->text + strlen (summary->text); + n = snprintf (txt, spaceleft,_("Manufacturer: %s\n"),params->deviceinfo.Manufacturer); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + n = snprintf (txt, spaceleft,_("Model: %s\n"),params->deviceinfo.Model); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + n = snprintf (txt, spaceleft,_(" Version: %s\n"),params->deviceinfo.DeviceVersion); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + if (params->deviceinfo.SerialNumber) { + n = snprintf (txt, spaceleft,_(" Serial Number: %s\n"),params->deviceinfo.SerialNumber); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + } + if (params->deviceinfo.VendorExtensionID) { + n = snprintf (txt, spaceleft,_("Vendor Extension ID: 0x%x (%d.%d)\n"), + params->deviceinfo.VendorExtensionID, + params->deviceinfo.VendorExtensionVersion/100, + params->deviceinfo.VendorExtensionVersion%100 + ); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + if (params->deviceinfo.VendorExtensionDesc) { + n = snprintf (txt, spaceleft,_("Vendor Extension Description: %s\n"),params->deviceinfo.VendorExtensionDesc); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + } + } + if (params->deviceinfo.StandardVersion != 100) { + n = snprintf (txt, spaceleft,_("PTP Standard Version: %d.%d\n"), + params->deviceinfo.StandardVersion/100, + params->deviceinfo.StandardVersion%100 + ); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + } + if (params->deviceinfo.FunctionalMode) { + n = snprintf (txt, spaceleft,_("Functional Mode: 0x%04x\n"),params->deviceinfo.FunctionalMode); + if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + } /* Dump Formats */ n = snprintf (txt, spaceleft,_("\nCapture Formats: ")); @@ -2571,6 +2589,7 @@ /* HP Photosmart 850, the camera tends to duplicate filename in the list. * Original patch by cle...@gm... */ /* search backwards, likely gets hits faster. */ + /* FIXME Marcus: This is also O(n^2) ... bad for large directories. */ if (GP_OK == gp_list_find_by_name(list, NULL, params->objectinfo[i].Filename)) { gp_log (GP_LOG_ERROR, "ptp2/file_list_func", "Duplicate filename '%s' in folder '%s'. Ignoring nth entry.\n", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-10-12 19:58:54
|
Revision: 11378 http://gphoto.svn.sourceforge.net/gphoto/?rev=11378&view=rev Author: marcusmeissner Date: 2008-10-12 19:58:47 +0000 (Sun, 12 Oct 2008) Log Message: ----------- 2008-10-12 Marcus Meissner <ma...@je...> * library.c: Adjusted summary output a bit. * library.c: Handle "wrong parent" or "no root parent" devices every time, so when we autodetect new ones we do not need to add them to the list. Should avoid releasing libgphoto2 for new iPhones etc. * library.c: If a filename is empty or not set, replace it by the 8 char hexcode. (Should enable movie retrieval on Panasonics). 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 2008-10-12 19:45:19 UTC (rev 11377) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-10-12 19:58:47 UTC (rev 11378) @@ -2,6 +2,15 @@ * library.c: Adjusted summary output a bit. + * library.c: Handle "wrong parent" or "no root parent" + devices every time, so when we autodetect new ones + we do not need to add them to the list. + Should avoid releasing libgphoto2 for new iPhones etc. + + * library.c: If a filename is empty or not set, replace it by + the 8 char hexcode. (Should enable movie retrieval on + Panasonics). + 2008-10-09 Marcus Meissner <ma...@je...> * ptp-pack.c: factored out ptp time string parser Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-12 19:45:19 UTC (rev 11377) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-12 19:58:47 UTC (rev 11378) @@ -331,7 +331,7 @@ /* Giulio Salani <ilf...@gm...> */ {"Kodak:C310", 0x040a, 0x058a, 0}, /* Brandon Sharitt */ - {"Kodak:C330", 0x040a, 0x058c, PTPBUG_DCIM_WRONG_PARENT}, + {"Kodak:C330", 0x040a, 0x058c, 0}, /* c340 Maurizio Daniele <hay...@po...> */ {"Kodak:C340", 0x040a, 0x058d, 0}, {"Kodak:V530", 0x040a, 0x058e, 0}, @@ -678,9 +678,9 @@ {"Canon:Elura 50 (PTP mode)", 0x04a9, 0x3087, PTPBUG_DELETE_SENDS_EVENT}, {"Canon:MVX3i (PTP mode)", 0x04a9, 0x308d, PTPBUG_DELETE_SENDS_EVENT}, /* 0x3084 is the EOS 300D/Digital Rebel in normal (canon) mode */ - {"Canon:EOS 300D (PTP mode)", 0x04a9, 0x3099, PTPBUG_DCIM_WRONG_PARENT}, - {"Canon:EOS Digital Rebel (PTP mode)", 0x04a9, 0x3099, PTPBUG_DCIM_WRONG_PARENT}, - {"Canon:EOS Kiss Digital (PTP mode)", 0x04a9, 0x3099, PTPBUG_DCIM_WRONG_PARENT}, + {"Canon:EOS 300D (PTP mode)", 0x04a9, 0x3099, 0}, + {"Canon:EOS Digital Rebel (PTP mode)", 0x04a9, 0x3099, 0}, + {"Canon:EOS Kiss Digital (PTP mode)", 0x04a9, 0x3099, 0}, {"Canon:PowerShot A80 (PTP)", 0x04a9, 0x309a, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW}, {"Canon:Digital IXUS i (PTP mode)", 0x04a9, 0x309b, PTPBUG_DELETE_SENDS_EVENT}, {"Canon:PowerShot S1 IS (PTP mode)", 0x04a9, 0x309c, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW}, @@ -706,16 +706,16 @@ {"Canon:Digital IXUS 30 (PTP mode)", 0x04a9, 0x30c0, PTPBUG_DELETE_SENDS_EVENT}, {"Canon:PowerShot A520 (PTP mode)", 0x04a9, 0x30c1, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW}, {"Canon:PowerShot A510 (PTP mode)", 0x04a9, 0x30c2, PTPBUG_DELETE_SENDS_EVENT}, - {"Canon:EOS 1D Mark II (PTP mode)", 0x04a9, 0x30ea, PTPBUG_DCIM_WRONG_PARENT}, - {"Canon:EOS 20D (PTP mode)", 0x04a9, 0x30ec, PTPBUG_DCIM_WRONG_PARENT}, + {"Canon:EOS 1D Mark II (PTP mode)", 0x04a9, 0x30ea, 0}, + {"Canon:EOS 20D (PTP mode)", 0x04a9, 0x30ec, 0}, /* 30ef is the ID in explicit PTP mode. * 30ee is the ID with the camera in Canon mode, but the camera reacts to * PTP commands according to: * https://sourceforge.net/tracker/?func=detail&atid=108874&aid=1394326&group_id=8874 * They need to have different names. */ - {"Canon:EOS 350D (PTP mode)", 0x04a9, 0x30ee, PTPBUG_DCIM_WRONG_PARENT}, - {"Canon:EOS 350D", 0x04a9, 0x30ef, PTPBUG_DCIM_WRONG_PARENT}, + {"Canon:EOS 350D (PTP mode)", 0x04a9, 0x30ee, 0}, + {"Canon:EOS 350D", 0x04a9, 0x30ef, 0}, {"Canon:PowerShot S2 IS (PTP mode)", 0x04a9, 0x30f0, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW}, {"Canon:PowerShot SD430 (PTP mode)", 0x04a9, 0x30f1, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW}, {"Canon:Digital IXUS Wireless (PTP mode)",0x04a9, 0x30f1, PTPBUG_DELETE_SENDS_EVENT|PTP_CAP|PTP_CAP_PREVIEW}, @@ -741,18 +741,18 @@ {"Canon:PowerShot SD450 (PTP mode)", 0x04a9, 0x30ff, 0}, {"Canon:Optura 600 (PTP mode)", 0x04a9, 0x3105, 0}, /* Jeff Mock <je...@mo...> */ - {"Canon:EOS 5D (PTP mode)", 0x04a9, 0x3102, PTPBUG_DCIM_WRONG_PARENT}, + {"Canon:EOS 5D (PTP mode)", 0x04a9, 0x3102, 0}, /* Nick Richards <ni...@ne...> */ {"Canon:Digital IXUS 50 (PTP mode)", 0x04a9, 0x310e, PTPBUG_DELETE_SENDS_EVENT}, /* http://sourceforge.net/tracker/index.php?func=detail&aid=1640547&group_id=8874&atid=358874 */ {"Canon:PowerShot A420 (PTP mode)", 0x04a9, 0x310f, PTPBUG_DELETE_SENDS_EVENT}, /* Some Canon 400D do not have the infamous PTP bug, but some do. * see http://bugs.kde.org/show_bug.cgi?id=141577 -Marcus */ - {"Canon:EOS 400D (PTP mode)", 0x04a9, 0x3110, PTPBUG_DCIM_WRONG_PARENT|PTP_CAP}, + {"Canon:EOS 400D (PTP mode)", 0x04a9, 0x3110, PTP_CAP}, /* https://sourceforge.net/tracker/?func=detail&atid=358874&aid=1456391&group_id=8874 */ - {"Canon:EOS 30D (PTP mode)", 0x04a9, 0x3113, PTPBUG_DCIM_WRONG_PARENT}, - {"Canon:Digital IXUS 900Ti (PTP mode)", 0x04a9, 0x3115, PTPBUG_DCIM_WRONG_PARENT}, - {"Canon:PowerShot SD900 (PTP mode)", 0x04a9, 0x3115, PTPBUG_DCIM_WRONG_PARENT}, + {"Canon:EOS 30D (PTP mode)", 0x04a9, 0x3113, 0}, + {"Canon:Digital IXUS 900Ti (PTP mode)", 0x04a9, 0x3115, 0}, + {"Canon:PowerShot SD900 (PTP mode)", 0x04a9, 0x3115, 0}, {"Canon:Digital IXUS 750 (PTP mode)", 0x04a9, 0x3116, PTPBUG_DELETE_SENDS_EVENT}, {"Canon:PowerShot A700 (PTP mode)", 0x04a9, 0x3117, PTPBUG_DELETE_SENDS_EVENT}, /* http://sourceforge.net/tracker/index.php?func=detail&aid=1498577&group_id=8874&atid=358874 */ @@ -783,7 +783,7 @@ {"Canon:EOS 40D (PTP mode)", 0x04a9, 0x3146, PTP_CAP}, /* user had it working without problem */ /* reported by: gp...@lu... */ - {"Canon:EOS 1D Mark III (PTP mode)", 0x04a9, 0x3147, PTPBUG_DCIM_WRONG_PARENT|PTP_CAP}, + {"Canon:EOS 1D Mark III (PTP mode)", 0x04a9, 0x3147, PTP_CAP}, {"Canon:PowerShot S5 IS (PTP mode)", 0x04a9, 0x3148, PTP_CAP|PTP_CAP_PREVIEW}, /* AlannY <al...@st...> */ @@ -876,9 +876,9 @@ {"Sanyo:VPC-C5 (PTP mode)", 0x0474, 0x0230, 0}, /* from Mike Meyer <mw...@mi...> */ - {"Apple:iPhone (PTP mode)", 0x05ac, 0x1290, PTPBUG_DCIM_WRONG_PARENT}, + {"Apple:iPhone (PTP mode)", 0x05ac, 0x1290, 0}, /* irc reporter */ - {"Apple:iPhone 3G (PTP mode)", 0x05ac, 0x1292, PTPBUG_DCIM_WRONG_PARENT}, + {"Apple:iPhone 3G (PTP mode)", 0x05ac, 0x1292, 0}, /* https://sourceforge.net/tracker/index.php?func=detail&aid=1869653&group_id=158745&atid=809061 */ {"Pioneer:DVR-LX60D", 0x08e4, 0x0142, 0}, }; @@ -3800,7 +3800,7 @@ static int init_ptp_fs (Camera *camera, GPContext *context) { - int i,id,nroot; + int i, id, nroot = 0; PTPParams *params = &camera->pl->params; char buf[1024]; uint16_t ret; @@ -3880,6 +3880,7 @@ roothandle = curhandle; params->handles.Handler[curhandle] = rootoid; params->objectinfo[curhandle].ParentObject = 0; + nroot = 1; } else { if (roothandle == -1) { /* We must synthesize /DCIM... */ roothandle = curhandle; @@ -4048,6 +4049,8 @@ break; } oinfos[i].ParentObject = xpl->propval.u32; + if (xpl->propval.u32 == 0) + nroot++; gp_log (GP_LOG_DEBUG, "ptp2/mtpfast", "parent 0x%x", xpl->propval.u32); break; case PTP_OPC_ObjectFormat: @@ -4167,6 +4170,17 @@ GP_DEBUG (" SequenceNumber: 0x%08x", oi->SequenceNumber); } #endif + if (params->objectinfo[i].ParentObject == 0) + nroot++; + + if ( !params->objectinfo[i].Filename || + !strlen (params->objectinfo[i].Filename) + ) { + params->objectinfo[i].Filename = malloc(8+1); + sprintf (params->objectinfo[i].Filename, "%08x", params->handles.Handler[i]); + gp_log (GP_LOG_ERROR, "ptp2/std_getobjectinfo", "Replaced empty dirname by '%08x'", params->handles.Handler[i]); + } + gp_context_progress_update (context, id, 10+(90*i)/params->handles.n); } @@ -4212,52 +4226,56 @@ } } - if (DCIM_WRONG_PARENT_BUG(camera->pl)) - { - GP_DEBUG("PTPBUG_DCIM_WRONG_PARENT bug workaround"); - /* Count number of root directory objects */ - nroot = 0; - for (i = 0; i < params->handles.n; i++) - if (params->objectinfo[i].ParentObject == 0) - nroot++; + /* If there are no root directory objects, look for "DCIM" directories. + * This way, we can handle cameras that report the wrong ParentObject ID for + * root. + * + * FIXME: If DCIM is there, it will not look for other root directories. + */ + if (nroot == 0 && params->handles.n > 0) { + uint32_t badroothandle; - GP_DEBUG("Found %d root directory objects", nroot); + GP_DEBUG("Bug workaround: Found no root directory objects, looking for some."); + for (i = 0; i < params->handles.n; i++) { + PTPObjectInfo *oi = ¶ms->objectinfo[i]; - /* If no root directory objects, look for "DCIM". This way, we can - * handle cameras that report the wrong ParentObject ID for root - */ - if (nroot == 0 && params->handles.n > 0) { - for (i = 0; i < params->handles.n; i++) - { - PTPObjectInfo *oi = ¶ms->objectinfo[i]; - - if (strcmp(oi->Filename, "DCIM") == 0) - { - GP_DEBUG("Changing DCIM ParentObject ID from 0x%x to 0", - oi->ParentObject); - oi->ParentObject = 0; - nroot++; - } + if (strcmp(oi->Filename, "DCIM") == 0) { + GP_DEBUG("Changing DCIM ParentObject ID from 0x%x to 0", + oi->ParentObject); + badroothandle = oi->ParentObject; + oi->ParentObject = 0; + nroot++; + } } - } - /* Some cameras do not have a directory at all, just files or unattached - * directories. In this case associate all unattached to the 0 object. - */ - if (nroot == 0) { - /* look for entries with parentobjects that do not exist */ - for (i = 0; i < params->handles.n; i++) - { - int j; - PTPObjectInfo *oi = ¶ms->objectinfo[i]; + for (i = 0; i < params->handles.n; i++) { + PTPObjectInfo *oi = ¶ms->objectinfo[i]; + if (oi->ParentObject == badroothandle) { + GP_DEBUG("Changing %s ParentObject ID from 0x%x to 0", + oi->Filename, oi->ParentObject); + oi->ParentObject = 0; + nroot++; + } + } + /* Some cameras do not have a directory at all, just files or unattached + * directories. In this case associate all unattached to the 0 object. + * + * O(n^2) search. Be careful. + */ + if (nroot == 0) { + GP_DEBUG("Bug workaround: Found no root dir entries and no DCIM dir, looking for some."); + /* look for entries with parentobjects that do not exist */ + for (i = 0; i < params->handles.n; i++) { + int j; + PTPObjectInfo *oi = ¶ms->objectinfo[i]; - for (j = 0;j < params->handles.n; j++) - if (oi->ParentObject == params->handles.Handler[j]) - break; - if (j == params->handles.n) - oi->ParentObject = 0; + for (j = 0;j < params->handles.n; j++) + if (oi->ParentObject == params->handles.Handler[j]) + break; + if (j == params->handles.n) + oi->ParentObject = 0; + } } - } - } + } #if 0 add_dir (camera, 0x00000000, 0xff000000, "DIR1"); add_dir (camera, 0x00000000, 0xff000001, "DIR20"); @@ -4453,11 +4471,14 @@ GP_DEBUG ("Device info:"); GP_DEBUG ("Manufacturer: %s",camera->pl->params.deviceinfo.Manufacturer); - GP_DEBUG (" model: %s", camera->pl->params.deviceinfo.Model); + GP_DEBUG (" Model: %s", camera->pl->params.deviceinfo.Model); GP_DEBUG (" device version: %s", camera->pl->params.deviceinfo.DeviceVersion); GP_DEBUG (" serial number: '%s'",camera->pl->params.deviceinfo.SerialNumber); GP_DEBUG ("Vendor extension ID: 0x%08x",camera->pl->params.deviceinfo.VendorExtensionID); + GP_DEBUG ("Vendor extension version: %d",camera->pl->params.deviceinfo.VendorExtensionVersion); GP_DEBUG ("Vendor extension description: %s",camera->pl->params.deviceinfo.VendorExtensionDesc); + GP_DEBUG ("Functional Mode: 0x%04x",camera->pl->params.deviceinfo.FunctionalMode); + GP_DEBUG ("PTP Standard Version: %d",camera->pl->params.deviceinfo.StandardVersion); GP_DEBUG ("Supported operations:"); for (i=0; i<camera->pl->params.deviceinfo.OperationsSupported_len; i++) GP_DEBUG (" 0x%04x", Modified: trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h 2008-10-12 19:45:19 UTC (rev 11377) +++ trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h 2008-10-12 19:58:47 UTC (rev 11378) @@ -23,7 +23,6 @@ #define __PTP_BUGS_H_ -#define PTPBUG_DCIM_WRONG_PARENT (1<<0) #define PTPBUG_DELETE_SENDS_EVENT (1<<1) #define PTPBUG_DUPE_FILE (1<<2) #define PTP_MTP (1<<3) @@ -33,8 +32,6 @@ #define PTP_NIKON_BROKEN_CAP (1<<7) #define PTP_MTP_ZEN_BROKEN_HEADER (1<<8) -#define DCIM_WRONG_PARENT_BUG(x) \ - ((x)->bugs & PTPBUG_DCIM_WRONG_PARENT) #define DELETE_SENDS_EVENT(x) \ ((x)->bugs & PTPBUG_DELETE_SENDS_EVENT) #define CAN_HAVE_DUPE_FILE(x) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-10-26 12:05:54
|
Revision: 11502 http://gphoto.svn.sourceforge.net/gphoto/?rev=11502&view=rev Author: marcusmeissner Date: 2008-10-26 12:05:31 +0000 (Sun, 26 Oct 2008) Log Message: ----------- DNG objectformatcode (ptp2v1.1) Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-10-25 17:20:29 UTC (rev 11501) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-10-26 12:05:31 UTC (rev 11502) @@ -1,3 +1,7 @@ +2008-10-26 Marcus Meissner <ma...@je...> + + * ptp.h,ptp.c: Started adding PTP v1.1 defines. + 2008-10-12 Marcus Meissner <ma...@je...> * library.c: Adjusted summary output a bit. Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-25 17:20:29 UTC (rev 11501) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-10-26 12:05:31 UTC (rev 11502) @@ -940,7 +940,7 @@ {PTP_OFC_TIFF, 0, GP_MIME_TIFF}, {PTP_OFC_TIFF_IT, 0, "image/x-tiffit"}, {PTP_OFC_JP2, 0, "image/x-jpeg2000bff"}, - {PTP_OFC_JPX, 0, "image/x-jpeg2000eff"}, + {PTP_OFC_JPX, 0, "image/x-adobe-dng"}, {PTP_OFC_MTP_OGG, PTP_VENDOR_MICROSOFT, "application/ogg"}, {PTP_OFC_MTP_FLAC, PTP_VENDOR_MICROSOFT, "audio/x-flac"}, Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-10-25 17:20:29 UTC (rev 11501) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-10-26 12:05:31 UTC (rev 11502) @@ -3811,6 +3811,7 @@ {PTP_OFC_TIFF_IT,"TIFF_IT"}, {PTP_OFC_JP2,"JP2"}, {PTP_OFC_JPX,"JPX"}, + {PTP_OFC_DNG,"DNG"}, }; struct { Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-10-25 17:20:29 UTC (rev 11501) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-10-26 12:05:31 UTC (rev 11502) @@ -666,6 +666,8 @@ #define PTP_OFC_TIFF_IT 0x380E #define PTP_OFC_JP2 0x380F #define PTP_OFC_JPX 0x3810 +/* ptp v1.1 has only DNG new */ +#define PTP_OFC_DNG 0x3811 /* Eastman Kodak extension ancillary format */ #define PTP_OFC_EK_M3U 0xb002 /* Canon extension */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-10-31 07:55:20
|
Revision: 11512 http://gphoto.svn.sourceforge.net/gphoto/?rev=11512&view=rev Author: marcusmeissner Date: 2008-10-31 07:55:15 +0000 (Fri, 31 Oct 2008) Log Message: ----------- updated from libmtp Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/device-flags.h trunk/libgphoto2/camlibs/ptp2/music-players.h Modified: trunk/libgphoto2/camlibs/ptp2/device-flags.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/device-flags.h 2008-10-30 22:25:21 UTC (rev 11511) +++ trunk/libgphoto2/camlibs/ptp2/device-flags.h 2008-10-31 07:55:15 UTC (rev 11512) @@ -183,3 +183,10 @@ * to be stored, per playlist. */ #define DEVICE_FLAG_PLAYLIST_SPL_V2 0x00002000 +/** + * The Sansa E250 is know to have this problem which is actually + * that the device claims that property PTP_OPC_DateModified + * is read/write but will still fail to update it. It can only + * be set properly the first time a file is sent. + */ +#define DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED 0x00004000 Modified: trunk/libgphoto2/camlibs/ptp2/music-players.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/music-players.h 2008-10-30 22:25:21 UTC (rev 11511) +++ trunk/libgphoto2/camlibs/ptp2/music-players.h 2008-10-31 07:55:15 UTC (rev 11512) @@ -24,6 +24,9 @@ * * This file is supposed to be included within a struct from both libmtp * and libgphoto2. + * + * Information can be harvested from Windows driver .INF files, see: + * http://msdn.microsoft.com/en-us/library/aa973606.aspx */ /* * MTP device list, trying real bad to get all devices into @@ -175,7 +178,7 @@ */ { "Philips", 0x0471, "HDD6320/00 or HDD6330/17", 0x014b, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, // Anonymous SourceForge user - { "Philips", 0x0471, "HDD1620 or HDD1630/17", 0x014c, DEVICE_FLAG_NONE }, + { "Philips", 0x0471, "HDD14XX,HDD1620 or HDD1630/17", 0x014c, DEVICE_FLAG_NONE }, // from discussion forum { "Philips", 0x0471, "HDD085/00 or HDD082/17", 0x014d, DEVICE_FLAG_NONE }, // from XNJB forum @@ -222,41 +225,43 @@ // Reported by Brian Robison { "SanDisk", 0x0781, "Sansa m230/m240", 0x7400, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by tan...@us... { "SanDisk", 0x0781, "Sansa c150", 0x7410, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // From libgphoto2 source // Reported by <gon...@us...> // Reported by Mike Owen <mik...@co...> { "SanDisk", 0x0781, "Sansa e200/e250/e260/e270/e280", 0x7420, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by XNJB user { "SanDisk", 0x0781, "Sansa e280", 0x7421, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by XNJB user { "SanDisk", 0x0781, "Sansa e260/e280 v2", 0x7422, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | - DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR | + DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by XNJB user { "SanDisk", 0x0781, "Sansa m240", 0x7430, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by Eugene Brevdo <eb...@pr...> { "SanDisk", 0x0781, "Sansa Clip", 0x7432, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | - DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR | + DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED}, // Reported by anonymous user at sourceforge.net { "SanDisk", 0x0781, "Sansa c240/c250", 0x7450, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by Troy Curtis Jr. { "SanDisk", 0x0781, "Sansa Express", 0x7460, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by XNJB user, and Miguel de Icaza <mi...@gn...> // This has no dual-mode so no need to unload any driver. // This is a Linux based device! @@ -264,12 +269,13 @@ // Reported by anonymous SourceForge user { "SanDisk", 0x0781, "Sansa View", 0x74b0, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL | - DEVICE_FLAG_NO_RELEASE_INTERFACE }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, // Reported by Patrick <sk...@gm...> // There are apparently problems with this device. { "SanDisk", 0x0781, "Sansa Fuze", 0x74c0, DEVICE_FLAG_UNLOAD_DRIVER | DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | - DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR }, + DEVICE_FLAG_NO_RELEASE_INTERFACE | DEVICE_FLAG_ALWAYS_PROBE_DESCRIPTOR | + DEVICE_FLAG_CANNOT_HANDLE_DATEMODIFIED }, /* * iRiver @@ -383,6 +389,8 @@ // Tentatively added - no real reports of this device ID being MTP, // reports as USB Mass Storage currently. { "Toshiba", 0x0930, "Gigabeat MEU201", 0x001a, DEVICE_FLAG_NONE }, + // Reported by anonymous SourceForge user + { "Toshiba", 0x0930, "Gigabeat MET401", 0x001d, DEVICE_FLAG_NONE }, /* @@ -438,13 +446,23 @@ * This is actually a camera, but it has a Microsoft device descriptor * and reports itself as supporting the MTP extension. */ - { "Canon", 0x04a9, "PowerShot A640 (PTP/MTP mode)", 0x3139, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL}, + { "Canon", 0x04a9, "PowerShot A640 (PTP/MTP mode)", 0x3139, + DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL }, /* * Nokia * Please verify the low device IDs here, I suspect these might be for * things like USB storage or modem mode actually, whereas the higher - * range (0x04nn) could be for MTP. + * range (0x04nn) could be for MTP. Some of the devices were gathered + * from the Nokia WMP drivers: + * http://nds2.nokia.com/files/support/global/phones/software/ + * Address was gathered from going to: + * nseries.com + * -> support + * -> select supported device + * -> PC software + * -> Music software + * -> Windows Media Player 10 driver */ // From: DoomHammer <ga...@us...> { "Nokia", 0x0421, "N81 Mobile Phone", 0x000a, DEVICE_FLAG_NONE }, @@ -458,10 +476,20 @@ { "Nokia", 0x0421, "5310 XpressMusic", 0x006c, DEVICE_FLAG_NONE }, // From: robin (AT) headbank D0Tco DOTuk { "Nokia", 0x0421, "N95 Mobile Phone 8GB", 0x006e, DEVICE_FLAG_NONE }, + // From Bastien Nocera <ha...@ha...> + { "Nokia", 0x0421, "N82 Mobile Phone", 0x0074, DEVICE_FLAG_NONE }, // From: danielw { "Nokia", 0x0421, "E71", 0x00e4, DEVICE_FLAG_NONE }, // From: Laurent Bigonville <bi...@us...> { "Nokia", 0x0421, "E66", 0x00e5, DEVICE_FLAG_NONE }, + // From: http://nds2.nokia.com/files/support/global/phones/software/Nokia_3250_WMP10_driver.inf + { "Nokia", 0x0421, "3250 Mobile Phone", 0x0462, DEVICE_FLAG_NONE }, + // From http://nds2.nokia.com/files/support/global/phones/software/Nokia_N93_WMP10_Driver.inf + { "Nokia", 0x0421, "N93 Mobile Phone", 0x0478, DEVICE_FLAG_NONE }, + // From: http://nds2.nokia.com/files/support/global/phones/software/Nokia_5500_Sport_WMP10_driver.inf + { "Nokia", 0x0421, "5500 Sport Mobile Phone", 0x047e, DEVICE_FLAG_NONE }, + // From http://nds2.nokia.com/files/support/global/phones/software/Nokia_N91_WMP10_Driver.inf + { "Nokia", 0x0421, "N91 Mobile Phone", 0x0485, DEVICE_FLAG_NONE }, // From: Christian Rusa <kri...@us...> { "Nokia", 0x0421, "5700 XpressMusic Mobile Phone", 0x04b4, DEVICE_FLAG_NONE }, // From: Mitchell Hicks <mi...@ya...> @@ -470,6 +498,8 @@ { "Nokia", 0x0421, "N73 Mobile Phone", 0x04d1, DEVICE_FLAG_UNLOAD_DRIVER }, // From Swapan <sw...@ya...> { "Nokia", 0x0421, "N75 Mobile Phone", 0x04e1, DEVICE_FLAG_NONE }, + // From: http://nds2.nokia.com/files/support/global/phones/software/Nokia_N93i_WMP10_driver.inf + { "Nokia", 0x0421, "N93i Mobile Phone", 0x04e5, DEVICE_FLAG_NONE }, // From Anonymous Sourceforge User { "Nokia", 0x0421, "N95 Mobile Phone", 0x04ef, DEVICE_FLAG_NONE }, // From: Pat Nicholls <pa...@pa...> @@ -584,25 +614,35 @@ // Reported by Jean-Marc Bourguet <jm...@bo...> { "Sony", 0x054c, "Walkman NWZ-S716F", 0x035a, DEVICE_FLAG_UNLOAD_DRIVER }, // Reported by Anon SF User / Anthon van der Neut <ava...@av...> - { "Sony", 0x054c, "Walkman NWZ-A828/NWZ-A829", 0x035b, DEVICE_FLAG_UNLOAD_DRIVER }, + { "Sony", 0x054c, "Walkman NWZ-A826/NWZ-A828/NWZ-A829", 0x035b, DEVICE_FLAG_UNLOAD_DRIVER }, // Reported by Niek Klaverstijn <ni...@us...> { "Sony", 0x054c, "Walkman NWZ-A728B", 0x035c, DEVICE_FLAG_UNLOAD_DRIVER }, + // Reported by Mehdi AMINI <mehdi.amini - at - ulp.u-strasbg.fr> + { "Sony", 0x054c, "Walkman NWZ-B135", 0x036e, DEVICE_FLAG_UNLOAD_DRIVER }, + // Reported by Marco Filipe Nunes Soares Abrantes Pereira <mar...@ua...> + { "Sony", 0x054c, "Walkman NWZ-S638F", 0x038e, DEVICE_FLAG_UNLOAD_DRIVER }, + /* * SonyEricsson + * These initially seemed to support GetObjPropList but later revisions + * of the firmware seem to have broken it, so all are flagged as broken + * for now. */ // Reported by Øyvind Stegard <st...@us...> - { "SonyEricsson", 0x0fce, "K850i", 0x0075, DEVICE_FLAG_NONE }, + { "SonyEricsson", 0x0fce, "K850i", 0x0075, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, // Reported by Michael Eriksson - { "SonyEricsson", 0x0fce, "W910", 0x0076, DEVICE_FLAG_NONE }, + { "SonyEricsson", 0x0fce, "W910", 0x0076, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, // Reported by Zack <za...@us...> - { "SonyEricsson", 0x0fce, "W890i", 0x00b3, DEVICE_FLAG_NONE }, + { "SonyEricsson", 0x0fce, "W890i", 0x00b3, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, // Reported by robert dot ahlskog at gmail - { "SonyEricsson", 0x0fce, "W760i", 0x00c6, DEVICE_FLAG_NONE }, + { "SonyEricsson", 0x0fce, "W760i", 0x00c6, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, // Reported by Linus Åkesson <lin...@us...> - { "SonyEricsson", 0x0fce, "C902", 0x00d4, DEVICE_FLAG_NONE }, + { "SonyEricsson", 0x0fce, "C902", 0x00d4, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, // Reported by an anonymous SourceForge user - { "SonyEricsson", 0x0fce, "C702", 0x00d9, DEVICE_FLAG_NONE }, + { "SonyEricsson", 0x0fce, "C702", 0x00d9, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, + // Reported by Christian Zuckschwerdt <chr...@zu...> + { "SonyEricsson", 0x0fce, "W980", 0x00da, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST }, /* * Motorola @@ -615,6 +655,8 @@ { "Motorola", 0x22b8, "K1", 0x4811, DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST }, // Reported by Hans-Joachim Baader <hj...@pr...> to libptp2 { "Motorola", 0x22b8, "A1200", 0x60ca, DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST }, + // http://mark.cdmaforums.com/Files/Motdmmtp.inf + { "Motorola", 0x22b8, "MTP Test Command Interface", 0x6413, DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST }, // Reported by anonymous user { "Motorola", 0x22b8, "RAZR2 V8/U9/Z6", 0x6415, DEVICE_FLAG_BROKEN_SET_OBJECT_PROPLIST }, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-02 08:36:48
|
Revision: 11515 http://gphoto.svn.sourceforge.net/gphoto/?rev=11515&view=rev Author: marcusmeissner Date: 2008-11-02 08:36:43 +0000 (Sun, 02 Nov 2008) Log Message: ----------- from libmtp - handle and of MTP objectpropertylist - readlen back to 512 Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ptp-pack.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ptp-pack.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2008-11-01 22:36:31 UTC (rev 11514) +++ trunk/libgphoto2/camlibs/ptp2/ptp-pack.c 2008-11-02 08:36:43 UTC (rev 11515) @@ -2,6 +2,9 @@ #include <iconv.h> +extern void +ptp_debug (PTPParams *params, const char *format, ...); + static inline uint16_t htod16p (PTPParams *params, uint16_t var) { @@ -993,9 +996,16 @@ return 0; } data += sizeof(uint32_t); + len -= sizeof(uint32_t); props = malloc(prop_count * sizeof(MTPProperties)); if (!props) return 0; for (i = 0; i < prop_count; i++) { + if (len <= 0) { + ptp_debug (params ,"short MTP Object Property List at property %d", i); + ptp_debug (params ,"device probably needs DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL", i); + ptp_debug (params ,"or even DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST", i); + return i; + } props[i].ObjectHandle = dtoh32a(data); data += sizeof(uint32_t); len -= sizeof(uint32_t); @@ -1098,9 +1108,6 @@ #define PTP_ece_OI_Size 0x14 /* only for objectinfos */ #define PTP_ece_OI_Name 0x1c /* only for objectinfos */ -extern void -ptp_debug (PTPParams *params, const char *format, ...); - static inline int ptp_unpack_CANON_changes (PTPParams *params, unsigned char* data, int datasize, PTPCanon_changes_entry **ce) { Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-01 22:36:31 UTC (rev 11514) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-02 08:36:43 UTC (rev 11515) @@ -66,7 +66,7 @@ * and fixed the bugs that made this necessary and it can be 512 again. */ #define PTP_USB_BULK_HS_MAX_PACKET_LEN_WRITE 512 -#define PTP_USB_BULK_HS_MAX_PACKET_LEN_READ 4096 +#define PTP_USB_BULK_HS_MAX_PACKET_LEN_READ 512 #define PTP_USB_BULK_HDR_LEN (2*sizeof(uint32_t)+2*sizeof(uint16_t)) #define PTP_USB_BULK_PAYLOAD_LEN_WRITE (PTP_USB_BULK_HS_MAX_PACKET_LEN_WRITE-PTP_USB_BULK_HDR_LEN) #define PTP_USB_BULK_PAYLOAD_LEN_READ (PTP_USB_BULK_HS_MAX_PACKET_LEN_READ-PTP_USB_BULK_HDR_LEN) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-04 22:15:42
|
Revision: 11517 http://gphoto.svn.sourceforge.net/gphoto/?rev=11517&view=rev Author: marcusmeissner Date: 2008-11-04 22:15:29 +0000 (Tue, 04 Nov 2008) Log Message: ----------- first hack at inserting "hidden" Nikon PTP Device Properties Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/cameras/nikon-d40.txt trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h Modified: trunk/libgphoto2/camlibs/ptp2/cameras/nikon-d40.txt =================================================================== --- trunk/libgphoto2/camlibs/ptp2/cameras/nikon-d40.txt 2008-11-03 15:47:14 UTC (rev 11516) +++ trunk/libgphoto2/camlibs/ptp2/cameras/nikon-d40.txt 2008-11-04 22:15:29 UTC (rev 11517) @@ -148,7 +148,7 @@ 0xd02b uint8 6 0xd02c uint8 2 0xd02d uint8 0 -0xd054 uint8 0 (changed, might be Auto ISO) +0xd054 uint8 0 (Auto ISO! - known) 0xd062 uint8 1 0xd064 uint8 1 0xd066 uint8 1 Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-03 15:47:14 UTC (rev 11516) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-04 22:15:29 UTC (rev 11517) @@ -235,28 +235,55 @@ } } +const static uint16_t nikon_extra_props[] = { +0xd10b, +0xd017, 0xd018, 0xd019, 0xd01a, 0xd01b, 0xd01c, 0xd01d, +0xd02a, 0xd02b, 0xd02c, 0xd02d, +0xd054, +0xd062, 0xd064, 0xd066, 0xd06b, +0xd091, 0xd092, +0xd0e0, 0xd0e1, 0xd0e2, 0xd0e3, 0xd0e4, 0xd0e5, 0xd0e6, +0xd100, 0xd101, 0xd102, 0xd103, 0xd105, 0xd108, 0xd109, 0xd10e, +0xd120, 0xd124, 0xd126, +0xd140, 0xd142, +0xd161, 0xd16a, +0xd1b0, 0xd1b1, 0xd1b2, +0xd1c0, 0xd1e1 +}; + void fixup_cached_deviceinfo (Camera *camera) { CameraAbilities a; + PTPDeviceInfo *di; + di = &camera->pl->params.deviceinfo; gp_camera_get_abilities(camera, &a); /* Newer Canons say that they are MTP devices. Restore Canon vendor extid. */ - if ( (camera->pl->params.deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if ( (di->VendorExtensionID == PTP_VENDOR_MICROSOFT) && (camera->port->type == GP_PORT_USB) && (a.usb_vendor == 0x4a9) ) { camera->pl->bugs |= PTP_MTP; - camera->pl->params.deviceinfo.VendorExtensionID = PTP_VENDOR_CANON; + di->VendorExtensionID = PTP_VENDOR_CANON; } /* Newer Nikons (D40) say that they are MTP devices. Restore Nikon vendor extid. */ - if ( (camera->pl->params.deviceinfo.VendorExtensionID == PTP_VENDOR_MICROSOFT) && + if ( (di->VendorExtensionID == PTP_VENDOR_MICROSOFT) && (camera->port->type == GP_PORT_USB) && (a.usb_vendor == 0x4b0) ) { camera->pl->bugs |= PTP_MTP; - camera->pl->params.deviceinfo.VendorExtensionID = PTP_VENDOR_NIKON; + di->VendorExtensionID = PTP_VENDOR_NIKON; } + if ( (di->VendorExtensionID == PTP_VENDOR_NIKON) && + (camera->pl->bugs & PTP_NIKON_SUPPRESSED_PROPS) + ) { + int i; + di->DevicePropertiesSupported = realloc(di->DevicePropertiesSupported,sizeof(di->DevicePropertiesSupported[0])*(di->DevicePropertiesSupported_len + sizeof(nikon_extra_props)/sizeof(nikon_extra_props[0]))); + for (i=0;i<sizeof(nikon_extra_props)/sizeof(nikon_extra_props[0]);i++) + di->DevicePropertiesSupported[i+di->DevicePropertiesSupported_len] = nikon_extra_props[i]; + di->DevicePropertiesSupported_len += sizeof(nikon_extra_props)/sizeof(nikon_extra_props[0]); + } } static struct { @@ -590,7 +617,7 @@ /* Christian Deckelmann @ SUSE */ {"Nikon:DSC D80 (PTP mode)", 0x04b0, 0x0412, PTP_CAP}, /* Huy Hoang <hoa...@um...> */ - {"Nikon:DSC D40 (PTP mode)", 0x04b0, 0x0414, PTP_CAP}, + {"Nikon:DSC D40 (PTP mode)", 0x04b0, 0x0414, PTP_CAP/*|PTP_NIKON_SUPPRESSED_PROPS*/}, /* Luca Gervasi <luc...@gm...> */ {"Nikon:DSC D40x (PTP mode)", 0x04b0, 0x0418, PTP_CAP}, /* Andreas Jaeger <aj...@su...>. Modified: trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h 2008-11-03 15:47:14 UTC (rev 11516) +++ trunk/libgphoto2/camlibs/ptp2/ptp-bugs.h 2008-11-04 22:15:29 UTC (rev 11517) @@ -31,6 +31,7 @@ #define PTP_MTP_PROPLIST_WORKS (1<<6) #define PTP_NIKON_BROKEN_CAP (1<<7) #define PTP_MTP_ZEN_BROKEN_HEADER (1<<8) +#define PTP_NIKON_SUPPRESSED_PROPS (1<<9) #define DELETE_SENDS_EVENT(x) \ ((x)->bugs & PTPBUG_DELETE_SENDS_EVENT) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-05 16:31:21
|
Revision: 11518 http://gphoto.svn.sourceforge.net/gphoto/?rev=11518&view=rev Author: marcusmeissner Date: 2008-11-05 16:31:15 +0000 (Wed, 05 Nov 2008) Log Message: ----------- * ptp-private.h, library.c: Move init_ptp_fs out of initialization and into the routines that need it. This avoids loading the whole PTP fs for: - configuration - summary Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp-private.h Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-11-04 22:15:29 UTC (rev 11517) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-11-05 16:31:15 UTC (rev 11518) @@ -1,3 +1,13 @@ +2008-11-05 Marcus Meissner <ma...@je...> + + * ptp-private.h, library.c: Move init_ptp_fs + out of initialization and into the routines + that need it. + + This avoids loading the whole PTP fs for: + - configuration + - summary + 2008-10-26 Marcus Meissner <ma...@je...> * ptp.h,ptp.c: Started adding PTP v1.1 defines. Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-04 22:15:29 UTC (rev 11517) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-05 16:31:15 UTC (rev 11518) @@ -119,6 +119,7 @@ return (GP_ERROR); \ } \ } +static int init_ptp_fs (Camera *camera, GPContext *context); typedef int (*getfunc_t)(CameraFilesystem*, const char*, const char *, CameraFileType, CameraFile *, void *, GPContext *); typedef int (*putfunc_t)(CameraFilesystem*, const char*, CameraFile*, void*, GPContext*); @@ -1217,12 +1218,10 @@ strncpy (text->text, _("PTP2 driver\n" "(c) 2001-2005 by Mariusz Woloszyn <em...@ip...>.\n" - "(c) 2003-2007 by Marcus Meissner <ma...@je...>.\n" + "(c) 2003-2008 by Marcus Meissner <ma...@je...>.\n" "This driver supports cameras that support PTP or PictBridge(tm), and\n" "Media Players that support the Media Transfer Protocol (MTP).\n" "\n" - "This driver is not a 'Licensed Implementation' of the Media Transfer Protocol.\n" - "\n" "Enjoy!"), sizeof (text->text)); return (GP_OK); } @@ -1745,6 +1744,8 @@ return GP_ERROR_NOT_SUPPORTED; SET_CONTEXT_P(params, context); + init_ptp_fs (camera, context); + if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_NIKON) && ptp_operation_issupported(params, PTP_OC_NIKON_Capture) ){ @@ -1906,6 +1907,7 @@ SET_CONTEXT(camera, context); memset (&event, 0, sizeof(event)); + init_ptp_fs (camera, context); if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) && ptp_operation_issupported(params, PTP_OC_CANON_EOS_RemoteRelease) @@ -1951,7 +1953,7 @@ gp_file_set_mime_type (file, GP_MIME_JPEG); gp_log (GP_LOG_DEBUG, "ptp2/canon_eos_capture", "trying to get object size=0x%x", entries[i].u.object.oi.ObjectCompressedSize); - CPR (context, ptp_canon_eos_getpartialobject (params, newobject, 0, entries[i].u.object.oi.ObjectCompressedSize, &ximage)); + CPR (context, ptp_canon_eos_getpartialobject (params, newobject, 0, entries[i].u.object.oi.ObjectCompressedSize, (unsigned char**)&ximage)); CPR (context, ptp_canon_eos_transfercomplete (params, newobject)); ret = gp_file_set_data_and_size(file, (char*)ximage, entries[i].u.object.oi.ObjectCompressedSize); if (ret != GP_OK) { @@ -2678,6 +2680,7 @@ SET_CONTEXT_P(params, context); gp_log (GP_LOG_DEBUG, "ptp2", "file_list_func(%s)", folder); + init_ptp_fs (camera, context); /* There should be NO files in root folder */ if (!strcmp(folder, "/")) @@ -2739,6 +2742,7 @@ SET_CONTEXT_P(params, context); gp_log (GP_LOG_DEBUG, "ptp2", "folder_list_func(%s)", folder); + init_ptp_fs ((Camera*)data, context); /* add storage pseudofolders in root folder */ if (!strcmp(folder, "/")) { @@ -3305,6 +3309,8 @@ return (GP_ERROR_BAD_PARAMETERS); /* file not found */ } + init_ptp_fs (camera, context); + /* compute storage ID value from folder patch */ folder_to_storage(folder,storage); @@ -3450,6 +3456,8 @@ SET_CONTEXT_P(params, context); + init_ptp_fs (camera, context); + gp_file_get_name (file, &filename); gp_file_get_type (file, &type); gp_log ( GP_LOG_DEBUG, "ptp2/put_file_func", "folder=%s, filename=%s", folder, filename); @@ -3573,6 +3581,7 @@ if (!strcmp (folder, "/special")) return GP_ERROR_NOT_SUPPORTED; + init_ptp_fs (camera, context); /* virtual file created by Nikon special capture */ if ( ((params->deviceinfo.VendorExtensionID == PTP_VENDOR_NIKON) || (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) ) && @@ -3639,6 +3648,7 @@ if (!ptp_operation_issupported(params, PTP_OC_DeleteObject)) return GP_ERROR_NOT_SUPPORTED; + init_ptp_fs (camera, context); /* compute storage ID value from folder patch */ folder_to_storage(folder,storage); @@ -3678,6 +3688,7 @@ if (!strcmp (folder, "/special")) return (GP_ERROR_BAD_PARAMETERS); /* for now */ + init_ptp_fs (camera, context); /* compute storage ID value from folder patch */ folder_to_storage(folder,storage); @@ -3770,6 +3781,8 @@ return GP_ERROR_NOT_SUPPORTED; SET_CONTEXT_P(params, context); + + init_ptp_fs (camera, context); memset(&oi, 0, sizeof (PTPObjectInfo)); /* compute storage ID value from folder patch */ @@ -3933,6 +3946,9 @@ uint16_t ret; SET_CONTEXT_P(params, context); + if (camera->pl->fs_loaded) return PTP_RC_OK; + camera->pl->fs_loaded = 1; + memset (¶ms->handles, 0, sizeof(PTPObjectHandles)); /* Nikon supports a fast filesystem retrieval. @@ -4621,7 +4637,7 @@ camera->pl->params.deviceinfo.DevicePropertiesSupported[i]); /* init internal ptp objectfiles (required for fs implementation) */ - init_ptp_fs (camera, context); + /*init_ptp_fs (camera, context);*/ switch (camera->pl->params.deviceinfo.VendorExtensionID) { case PTP_VENDOR_CANON: Modified: trunk/libgphoto2/camlibs/ptp2/ptp-private.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-private.h 2008-11-04 22:15:29 UTC (rev 11517) +++ trunk/libgphoto2/camlibs/ptp2/ptp-private.h 2008-11-05 16:31:15 UTC (rev 11518) @@ -35,6 +35,7 @@ struct _CameraPrivateLibrary { PTPParams params; unsigned long bugs; + int fs_loaded; }; struct _PTPData { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-07 09:49:30
|
Revision: 11531 http://gphoto.svn.sourceforge.net/gphoto/?rev=11531&view=rev Author: marcusmeissner Date: 2008-11-07 09:49:27 +0000 (Fri, 07 Nov 2008) Log Message: ----------- added/fixed some canon properties Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2008-11-07 09:35:33 UTC (rev 11530) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2008-11-07 09:49:27 UTC (rev 11531) @@ -874,8 +874,8 @@ static struct deviceproptableu16 canon_assistlight[] = { - { N_("On"), 0x0000, PTP_VENDOR_CANON }, - { N_("Off"), 0x0001, PTP_VENDOR_CANON }, + { N_("Off"), 0x0000, PTP_VENDOR_CANON }, + { N_("On"), 0x0001, PTP_VENDOR_CANON }, }; GENERIC16TABLE(Canon_AssistLight,canon_assistlight) @@ -886,12 +886,11 @@ GENERIC16TABLE(Canon_AutoRotation,canon_autorotation) static struct deviceproptableu16 canon_beepmode[] = { - { N_("On"), 0x00, PTP_VENDOR_CANON }, - { N_("Off"), 0x01, PTP_VENDOR_CANON }, + { N_("Off"), 0x00, PTP_VENDOR_CANON }, + { N_("On"), 0x01, PTP_VENDOR_CANON }, }; GENERIC16TABLE(Canon_BeepMode,canon_beepmode) - static int _get_Canon_ZoomRange(CONFIG_GET_ARGS) { float f, t, b, s; @@ -1022,27 +1021,43 @@ static struct deviceproptableu8 canon_quality[] = { + { N_("undefined"), 0x00, 0 }, + { N_("economy"), 0x01, 0 }, { N_("normal"), 0x02, 0 }, { N_("fine"), 0x03, 0 }, + { N_("lossless"), 0x04, 0 }, { N_("superfine"), 0x05, 0 }, }; GENERIC8TABLE(Canon_Quality,canon_quality) +static struct deviceproptableu8 canon_fullview_fileformat[] = { + { N_("Undefined"), 0x00, 0 }, + { N_("JPEG"), 0x01, 0 }, + { N_("CRW"), 0x02, 0 }, +}; +GENERIC8TABLE(Canon_Capture_Format,canon_fullview_fileformat) + static struct deviceproptableu8 canon_shootmode[] = { { N_("Auto"), 0x01, 0 }, { N_("TV"), 0x02, 0 }, { N_("AV"), 0x03, 0 }, { N_("Manual"), 0x04, 0 }, + { N_("A_DEP"), 0x05, 0 }, + { N_("M_DEP"), 0x06, 0 }, + { N_("Bulb"), 0x07, 0 }, + /* Marcus: The SDK has more listed, but I have never seen them + * enumerated by the cameras. Lets leave them out for now. */ }; GENERIC8TABLE(Canon_ShootMode,canon_shootmode) static struct deviceproptableu8 canon_flash[] = { - { N_("off"), 0, 0 }, - { N_("auto"), 1, 0 }, - { N_("on"), 2, 0 }, - { N_("fill in"), 4, 0 }, - { N_("auto red eye"), 5, 0 }, - { N_("on red eye"), 6, 0 }, + { N_("off"), 0, 0 }, + { N_("auto"), 1, 0 }, + { N_("on"), 2, 0 }, + { N_("red eye suppression"), 3, 0 }, + { N_("fill in"), 4, 0 }, + { N_("auto + red eye suppression"), 5, 0 }, + { N_("on + red eye suppression"), 6, 0 }, }; GENERIC8TABLE(Canon_FlashMode,canon_flash) @@ -1063,19 +1078,17 @@ GENERIC8TABLE(Nikon_FlashModeManualPower,flash_modemanualpower) static struct deviceproptableu8 canon_meteringmode[] = { - { N_("center weighted average"), 0, 0 }, + { N_("center-weighted"), 0, 0 }, { N_("spot"), 1, 0 }, + { N_("average"), 2, 0 }, { N_("evaluative"), 3, 0 }, + { N_("partial"), 4, 0 }, + { N_("center-weighted average"), 5, 0 }, + { N_("spot metering interlocked with AF frame"), 6, 0 }, + { N_("multi spot metering"), 7, 0 }, }; GENERIC8TABLE(Canon_MeteringMode,canon_meteringmode) -static struct deviceproptableu8 canon_eos_meteringmode[] = { - { N_("Evaluative metering"), 3, 0 }, - { N_("Partial metering"), 4, 0 }, - { N_("Center Weighted average metering"), 5, 0 }, -}; -GENERIC8TABLE(Canon_EOS_MeteringMode,canon_eos_meteringmode) - static struct deviceproptableu8 canon_eos_picturestyle[] = { { N_("Standard"), 0x81, 0 }, { N_("Portrait"), 0x82, 0 }, @@ -1090,71 +1103,92 @@ GENERIC8TABLE(Canon_EOS_PictureStyle,canon_eos_picturestyle) static struct deviceproptableu16 canon_shutterspeed[] = { - { "auto",0x0000,0 }, - { "bulb",0x0004,0 }, - { "30\"",0x0010,0 }, - { "25\"",0x0013,0 }, - { "20\"",0x0015,0 }, - { "15\"",0x0018,0 }, - { "13\"",0x001b,0 }, - { "10\"",0x001d,0 }, - { "8\"",0x0020,0 }, - { "6\"",0x0023,0 }, - { "5\"",0x0025,0 }, - { "4\"",0x0028,0 }, - { "3\"2",0x002b,0 }, - { "2\"5",0x002d,0 }, - { "2\"",0x0030,0 }, - { "1\"6",0x0033,0 }, - { "1\"3",0x0035,0 }, - { "1\"",0x0038,0 }, - { "0\"8",0x003b,0 }, - { "0\"6",0x003d,0 }, - { "0\"5",0x0040,0 }, - { "0\"4",0x0043,0 }, - { "0\"3",0x0045,0 }, - { "1/4",0x0048,0 }, - { "1/5",0x004b,0 }, - { "1/6",0x004d,0 }, - { "1/8",0x0050,0 }, - { "1/10",0x0053,0 }, - { "1/13",0x0055,0 }, - { "1/15",0x0058,0 }, - { "1/20",0x005b,0 }, - { "1/25",0x005d,0 }, - { "1/30",0x0060,0 }, - { "1/40",0x0063,0 }, - { "1/50",0x0065,0 }, - { "1/60",0x0068,0 }, - { "1/80",0x006b,0 }, - { "1/100",0x006d,0 }, - { "1/125",0x0070,0 }, - { "1/160",0x0073,0 }, - { "1/200",0x0075,0 }, - { "1/250",0x0078,0 }, - { "1/320",0x007b,0 }, - { "1/400",0x007d,0 }, - { "1/500",0x0080,0 }, - { "1/640",0x0083,0 }, - { "1/800",0x0085,0 }, - { "1/1000",0x0088,0 }, - { "1/1250",0x008b,0 }, - { "1/1600",0x008d,0 }, - { "1/2000",0x0090,0 }, - { "1/2500",0x0093,0 }, - { "1/3200",0x0095,0 }, - { "1/4000",0x0098,0 }, + { "auto", 0x0000,0 }, + { "bulb", 0x0004,0 }, + { "30\"", 0x0010,0 }, + { "25\"", 0x0013,0 }, + { "20\" (1/3)", 0x0014,0 }, + { "20\"", 0x0015,0 }, + { "15\"", 0x0018,0 }, + { "13\"", 0x001b,0 }, + { "10\"", 0x001c,0 }, + { "10\" (1/3)", 0x001d,0 }, + { "8\"", 0x0020,0 }, + { "6\" (1/3)", 0x0023,0 }, + { "6\"", 0x0024,0 }, + { "5\"", 0x0025,0 }, + { "4\"", 0x0028,0 }, + { "3\"2", 0x002b,0 }, + { "3\"", 0x002c,0 }, + { "2\"5", 0x002d,0 }, + { "2\"", 0x0030,0 }, + { "1\"6", 0x0033,0 }, + { "1\"5", 0x0034,0 }, + { "1\"3", 0x0035,0 }, + { "1\"", 0x0038,0 }, + { "0\"8", 0x003b,0 }, + { "0\"7", 0x003c,0 }, + { "0\"6", 0x003d,0 }, + { "0\"5", 0x0040,0 }, + { "0\"4", 0x0043,0 }, + { "0\"3", 0x0044,0 }, + { "0\"3 (1/3)", 0x0045,0 }, + { "1/4", 0x0048,0 }, + { "1/5", 0x004b,0 }, + { "1/6", 0x004c,0 }, + { "1/6 (1/3)", 0x004d,0 }, + { "1/8", 0x0050,0 }, + { "1/10 (1/3)", 0x0053,0 }, + { "1/10", 0x0054,0 }, + { "1/13", 0x0055,0 }, + { "1/15", 0x0058,0 }, + { "1/20 (1/3)", 0x005b,0 }, + { "1/20", 0x005c,0 }, + { "1/25", 0x005d,0 }, + { "1/30", 0x0060,0 }, + { "1/40", 0x0063,0 }, + { "1/45", 0x0064,0 }, + { "1/50", 0x0065,0 }, + { "1/60", 0x0068,0 }, + { "1/80", 0x006b,0 }, + { "1/90", 0x006c,0 }, + { "1/100", 0x006d,0 }, + { "1/125", 0x0070,0 }, + { "1/160", 0x0073,0 }, + { "1/180", 0x0074,0 }, + { "1/200", 0x0075,0 }, + { "1/250", 0x0078,0 }, + { "1/320", 0x007b,0 }, + { "1/350", 0x007c,0 }, + { "1/400", 0x007d,0 }, + { "1/500", 0x0080,0 }, + { "1/640", 0x0083,0 }, + { "1/750", 0x0084,0 }, + { "1/800", 0x0085,0 }, + { "1/1000", 0x0088,0 }, + { "1/1250", 0x008b,0 }, + { "1/1500", 0x008c,0 }, + { "1/1600", 0x008d,0 }, + { "1/2000", 0x0090,0 }, + { "1/2500", 0x0093,0 }, + { "1/3000", 0x0094,0 }, + { "1/3200", 0x0095,0 }, + { "1/4000", 0x0098,0 }, }; GENERIC16TABLE(Canon_ShutterSpeed,canon_shutterspeed) static struct deviceproptableu16 canon_focuspoints[] = { - { N_("Center"), 0x3003, 0 }, - { N_("Auto"), 0x3001, 0 }, + { N_("Focusing Point on Center Only, Manual"), 0x1000, 0 }, + { N_("Focusing Point on Center Only, Auto"), 0x1001, 0 }, + { N_("Multiple Focusing Points (No Specification), Manual"), 0x3000, 0 }, + { N_("Multiple Focusing Points, Auto"), 0x3001, 0 }, + { N_("Multiple Focusing Points (Right)"), 0x3002, 0 }, + { N_("Multiple Focusing Points (Center)"), 0x3003, 0 }, + { N_("Multiple Focusing Points (Left)"), 0x3004, 0 }, }; GENERIC16TABLE(Canon_FocusingPoint,canon_focuspoints) - static struct deviceproptableu8 canon_size[] = { { N_("large"), 0x00, 0 }, { N_("medium 1"), 0x01, 0 }, @@ -1164,10 +1198,29 @@ }; GENERIC8TABLE(Canon_Size,canon_size) +/* actually in 1/10s of a second, but only 3 values in use */ +static struct deviceproptableu16 canon_selftimer[] = { + { N_("Not used"), 0, 0 }, + { N_("10 seconds"), 100, 0 }, + { N_("2 seconds"), 20, 0 }, +}; +GENERIC16TABLE(Canon_SelfTimer,canon_selftimer) +static struct deviceproptableu8 canon_cameraoutput[] = { + { N_("Undefined"), 0, 0 }, + { N_("LCD"), 1, 0 }, + { N_("Video OUT"), 2, 0 }, + { N_("Off"), 3, 0 }, +}; +GENERIC8TABLE(Canon_CameraOutput,canon_cameraoutput) + static struct deviceproptableu16 canon_isospeed[] = { { N_("Factory Default"),0xffff, 0 }, + { "6", 0x0028, 0 }, + { "12", 0x0030, 0 }, + { "25", 0x0038, 0 }, { "50", 0x0040, 0 }, + { "64", 0x0043, 0 }, { "80", 0x0045, 0 }, { "100", 0x0048, 0 }, { "200", 0x0050, 0 }, @@ -1175,6 +1228,7 @@ { "800", 0x0060, 0 }, { "1600", 0x0068, 0 }, { "3200", 0x0070, 0 }, + { "6400", 0x0078, 0 }, { N_("Auto"), 0x0000, 0 }, }; GENERIC16TABLE(Canon_ISO,canon_isospeed) @@ -1612,9 +1666,18 @@ GENERIC8TABLE(Nikon_ToneCompensation,nikon_tonecompensation) static struct deviceproptableu8 canon_afdistance[] = { - { N_("Off"), 0x01, 0 }, - { N_("Macro"), 0x03, 0 }, - { N_("Long distance"), 0x07, 0 }, /* Unchecked. */ + { N_("Manual"), 0x00, 0 }, + { N_("Auto"), 0x01, 0 }, + { N_("Unknown"), 0x02, 0 }, + { N_("Zone Focus (Close-up)"), 0x03, 0 }, + { N_("Zone Focus (Very Close)"),0x04, 0 }, + { N_("Zone Focus (Close)"), 0x05, 0 }, + { N_("Zone Focus (Medium)"), 0x06, 0 }, + { N_("Zone Focus (Far)"), 0x07, 0 }, + { N_("Zone Focus (Reserved 1)"),0x08, 0 }, + { N_("Zone Focus (Reserved 2)"),0x09, 0 }, + { N_("Zone Focus (Reserved 3)"),0x0a, 0 }, + { N_("Zone Focus (Reserved 4)"),0x0b, 0 }, }; GENERIC8TABLE(Canon_AFDistance,canon_afdistance) @@ -1633,13 +1696,19 @@ static struct deviceproptableu8 canon_whitebalance[] = { - { N_("Auto"), 0, 0 }, - { N_("Daylight"), 1, 0 }, - { N_("Cloudy"), 2, 0 }, - { N_("Tungsten"), 3, 0 }, - { N_("Fluorescent"), 4, 0 }, - { N_("Fluorescent H"), 7, 0 }, - { N_("Custom"), 6, 0 }, + { N_("Auto"), 0, 0 }, + { N_("Daylight"), 1, 0 }, + { N_("Cloudy"), 2, 0 }, + { N_("Tungsten"), 3, 0 }, + { N_("Fluorescent"), 4, 0 }, + { N_("Custom"), 6, 0 }, + { N_("Fluorescent H"), 7, 0 }, + { N_("Color Temperature"), 9, 0 }, + { N_("Custom Whitebalance PC-1"), 10, 0 }, + { N_("Custom Whitebalance PC-2"), 11, 0 }, + { N_("Custom Whitebalance PC-3"), 12, 0 }, + { N_("Missing Number"), 13, 0 }, + /*{ N_("Flourescent H"), 14, 0 }, ... dup? */ }; GENERIC8TABLE(Canon_WhiteBalance,canon_whitebalance) @@ -1658,19 +1727,31 @@ static struct deviceproptableu8 canon_expcompensation[] = { { N_("Factory Default"), 0xff, 0 }, + { "+3", 0x00, 0 }, + { "+2 2/3", 0x03, 0 }, + { "+2 1/2", 0x04, 0 }, + { "+2 1/3", 0x05, 0 }, { "+2", 0x08, 0 }, { "+1 2/3", 0x0b, 0 }, + { "+1 1/2", 0x0c, 0 }, { "+1 1/3", 0x0d, 0 }, { "+1", 0x10, 0 }, { "+2/3", 0x13, 0 }, + { "+1/2", 0x14, 0 }, { "+1/3", 0x15, 0 }, { "0", 0x18, 0 }, { "-1/3", 0x1b, 0 }, + { "-1/2", 0x1c, 0 }, { "-2/3", 0x1d, 0 }, { "-1", 0x20, 0 }, { "-1 1/3", 0x23, 0 }, + { "-1 1/2", 0x24, 0 }, { "-1 2/3", 0x25, 0 }, { "-2", 0x28, 0 }, + { "-2 1/3", 0x2b, 0 }, + { "-2 1/2", 0x2c, 0 }, + { "-2 2/3", 0x2d, 0 }, + { "-3", 0x30, 0 }, }; GENERIC8TABLE(Canon_ExpCompensation,canon_expcompensation) @@ -1705,34 +1786,58 @@ static struct deviceproptableu16 canon_aperture[] = { { N_("auto"), 0xffff, 0 }, + { "1.0", 0x0008, 0 }, + { "1.1", 0x000b, 0 }, + { "1.2", 0x000c, 0 }, + { "1.2 (1/3)", 0x000d, 0 }, { "1.4", 0x0010, 0 }, { "1.6", 0x0013, 0 }, - { "1.8", 0x0015, 0 }, + { "1.8", 0x0014, 0 }, + { "1.8 (1/3)", 0x0015, 0 }, { "2.0", 0x0018, 0 }, { "2.2", 0x001b, 0 }, - { "2.5", 0x001d, 0 }, + { "2.5", 0x001c, 0 }, + { "2.5 (1/3)", 0x001d, 0 }, { "2.8", 0x0020, 0 }, { "3.2", 0x0023, 0 }, - { "3.5", 0x0025, 0 }, + { "3.5", 0x0024, 0 }, + { "3.5 (1/3)", 0x0025, 0 }, { "4.0", 0x0028, 0 }, - { "4.5", 0x002b, 0 }, - { "5", 0x002d, 0 }, + { "4.5 (1/3)", 0x002b, 0 }, + { "4.5", 0x002c, 0 }, + { "5.6 (1/3)", 0x002d, 0 }, { "5.6", 0x0030, 0 }, { "6.3", 0x0033, 0 }, { "7.1", 0x0035, 0 }, { "8.0", 0x0038, 0 }, { "9.0", 0x003b, 0 }, + { "9.5", 0x003c, 0 }, { "10", 0x003d, 0 }, { "11", 0x0040, 0 }, - { "13", 0x0043, 0 }, + { "13 (1/3)", 0x0043, 0 }, + { "13", 0x0044, 0 }, { "14", 0x0045, 0 }, { "16", 0x0048, 0 }, { "18", 0x004b, 0 }, + { "19", 0x004c, 0 }, { "20", 0x004d, 0 }, { "22", 0x0050, 0 }, { "25", 0x0053, 0 }, + { "27", 0x0054, 0 }, { "29", 0x0055, 0 }, { "32", 0x0058, 0 }, + { "36", 0x005b, 0 }, + { "38", 0x005c, 0 }, + { "40", 0x005d, 0 }, + { "45", 0x0060, 0 }, + { "51", 0x0063, 0 }, + { "54", 0x0064, 0 }, + { "57", 0x0065, 0 }, + { "64", 0x0068, 0 }, + { "72", 0x006b, 0 }, + { "76", 0x006c, 0 }, + { "81", 0x006d, 0 }, + { "91", 0x0070, 0 }, }; GENERIC16TABLE(Canon_Aperture,canon_aperture) @@ -2570,6 +2675,7 @@ { N_("Meter Off Time"), "meterofftime", PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_MeterOffTime, _put_Nikon_MeterOffTime }, { N_("CSM Menu"), "csmmenu", PTP_DPC_NIKON_CSMMenu, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8 }, { N_("Battery Level"), "battery", PTP_DPC_BatteryLevel, 0, PTP_DTC_UINT8, _get_BatteryLevel, _put_None }, + { N_("Camera Output"), "output", PTP_DPC_CANON_CameraOutput, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_CameraOutput, _put_Canon_CameraOutput }, /* virtual */ { N_("Fast Filesystem"), "fastfs", 0, PTP_VENDOR_NIKON, 0, _get_Nikon_FastFS, _put_Nikon_FastFS }, @@ -2583,9 +2689,11 @@ static struct submenu image_settings_menu[] = { { N_("Image Quality"), "imgquality", PTP_DPC_CompressionSetting, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Compression, _put_Compression}, { N_("Canon Image Quality"), "canonimgquality", PTP_DPC_CANON_ImageQuality, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_Quality, _put_Canon_Quality}, + { N_("Canon Image Format"), "canonimgformat", PTP_DPC_CANON_FullViewFileFormat, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_Capture_Format, _put_Canon_Capture_Format}, { N_("Image Size"), "imgsize", PTP_DPC_ImageSize, 0, PTP_DTC_STR, _get_ImageSize, _put_ImageSize}, { N_("Canon Image Size"), "canonimgsize", PTP_DPC_CANON_ImageSize, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_Size, _put_Canon_Size}, { N_("ISO Speed"), "iso", PTP_DPC_CANON_ISOSpeed, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_ISO, _put_Canon_ISO}, + { N_("ISO Speed"), "iso", PTP_DPC_ExposureIndex, 0, PTP_DTC_UINT16, _get_ISO, _put_ISO}, { N_("EOS ISO Speed"), "eos-iso", PTP_DPC_CANON_EOS_ISOSpeed, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_ISO, _put_Canon_ISO}, { N_("WhiteBalance"), "whitebalance", PTP_DPC_CANON_WhiteBalance, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_WhiteBalance, _put_Canon_WhiteBalance}, { N_("EOS WhiteBalance"), "eos-whitebalance", PTP_DPC_CANON_EOS_WhiteBalance, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_EOS_WhiteBalance, _put_Canon_EOS_WhiteBalance}, @@ -2603,8 +2711,11 @@ { N_("Zoom"), "zoom", PTP_DPC_CANON_Zoom, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_ZoomRange, _put_Canon_ZoomRange}, { N_("Assist Light"), "assistlight", PTP_DPC_CANON_AssistLight, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_AssistLight, _put_Canon_AssistLight}, { N_("Rotation Flag"), "autorotation", PTP_DPC_CANON_RotationScene, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_AutoRotation, _put_Canon_AutoRotation}, + { N_("Self Timer"), "selftimer", PTP_DPC_CANON_SelfTime, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_SelfTimer, _put_Canon_SelfTimer}, { N_("Assist Light"), "assistlight", PTP_DPC_NIKON_AFAssist, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, { N_("Exposure Compensation"), "exposurecompensation", PTP_DPC_CANON_ExpCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation, _put_Canon_ExpCompensation}, + { N_("Flash Compensation"), "flashcompensation", PTP_DPC_CANON_FlashCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation, _put_Canon_ExpCompensation}, + { N_("AEB Exposure Compensation"), "aebexpcompensation", PTP_DPC_CANON_AEBExposureCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation, _put_Canon_ExpCompensation}, { N_("EOS Exposure Compensation"), "eos-exposurecompensation", PTP_DPC_CANON_EOS_ExpCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation2, _put_Canon_ExpCompensation2}, { N_("Flash Mode"), "canonflashmode", PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_FlashMode, _put_Canon_FlashMode}, { N_("Flash Mode"), "nikonflashmode", PTP_DPC_NIKON_FlashMode, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashMode, _put_Nikon_FlashMode}, @@ -2613,7 +2724,6 @@ { N_("F-Number"), "f-number", PTP_DPC_FNumber, 0, PTP_DTC_UINT16, _get_FNumber, _put_FNumber}, { N_("Focal Length"), "focallength", PTP_DPC_FocalLength, 0, PTP_DTC_UINT32, _get_FocalLength, _put_FocalLength}, { N_("Focus Mode"), "focusmode", PTP_DPC_FocusMode, 0, PTP_DTC_UINT16, _get_FocusMode, _put_FocusMode}, - { N_("ISO Speed"), "iso", PTP_DPC_ExposureIndex, 0, PTP_DTC_UINT16, _get_ISO, _put_ISO}, { N_("Exposure Bias Compensation"), "exposurebiascompensation", PTP_DPC_ExposureBiasCompensation, 0, PTP_DTC_INT16, _get_ExpCompensation, _put_ExpCompensation}, { N_("Exposure Time"), "exptime", PTP_DPC_ExposureTime, 0, PTP_DTC_UINT32, _get_ExpTime, _put_ExpTime}, { N_("Effect Mode"), "effectmode", PTP_DPC_EffectMode, 0, PTP_DTC_UINT16, _get_EffectMode, _put_EffectMode}, @@ -2625,12 +2735,13 @@ { N_("Exposure Metering Mode"), "exposuremetermode", PTP_DPC_ExposureMeteringMode, 0, PTP_DTC_UINT16, _get_ExposureMetering, _put_ExposureMetering}, { N_("Flash Mode"), "flashmode", PTP_DPC_FlashMode, 0, PTP_DTC_UINT16, _get_FlashMode, _put_FlashMode}, { N_("Aperture"), "aperture", PTP_DPC_CANON_Aperture, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_Aperture, _put_Canon_Aperture}, + { N_("AV Open"), "avopen", PTP_DPC_CANON_AvOpen, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_Aperture, _put_Canon_Aperture}, + { N_("AV Max"), "avmax", PTP_DPC_CANON_AvMax, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_Aperture, _put_Canon_Aperture}, { N_("EOS Aperture"), "eos-aperture", PTP_DPC_CANON_EOS_Aperture, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_Aperture, _put_Canon_Aperture}, { N_("Focusing Point"), "focusingpoint", PTP_DPC_CANON_FocusingPoint, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_FocusingPoint, _put_Canon_FocusingPoint}, { N_("Shutter Speed"), "shutterspeed", PTP_DPC_CANON_ShutterSpeed, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_ShutterSpeed, _put_Canon_ShutterSpeed}, { N_("EOS Shutter Speed"), "eos-shutterspeed", PTP_DPC_CANON_EOS_ShutterSpeed, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_ShutterSpeed, _put_Canon_ShutterSpeed}, { N_("Metering Mode"), "meteringmode", PTP_DPC_CANON_MeteringMode, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_MeteringMode, _put_Canon_MeteringMode}, - { N_("EOS Metering Mode"), "eos-meteringmode", PTP_DPC_CANON_EOS_MeteringMode, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_EOS_MeteringMode, _put_Canon_EOS_MeteringMode}, { N_("AF Distance"), "afdistance", PTP_DPC_CANON_AFDistance, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_AFDistance, _put_Canon_AFDistance}, { N_("Focus Area Wrap"), "focusareawrap", PTP_DPC_NIKON_FocusAreaWrap, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, { N_("Exposure Lock"), "exposurelock", PTP_DPC_NIKON_AELockMode, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-07 09:35:33 UTC (rev 11530) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-07 09:49:27 UTC (rev 11531) @@ -1110,8 +1110,13 @@ #define PTP_DPC_CANON_FocalLengthWide 0xD027 #define PTP_DPC_CANON_FocalLengthDenominator 0xD028 #define PTP_DPC_CANON_CaptureTransferMode 0xD029 -#define CANON_TRANSFER_MEMORY 3 -#define CANON_TRANSFER_CARD 15 +#define CANON_TRANSFER_ENTIRE_IMAGE_TO_PC 0x0002 +#define CANON_TRANSFER_SAVE_THUMBNAIL_TO_DEVICE 0x0004 +#define CANON_TRANSFER_SAVE_IMAGE_TO_DEVICE 0x0008 +/* we use those values: */ +#define CANON_TRANSFER_MEMORY 3 +#define CANON_TRANSFER_CARD 15 + #define PTP_DPC_CANON_Zoom 0xD02A #define PTP_DPC_CANON_NamePrefix 0xD02B #define PTP_DPC_CANON_SizeQualityMode 0xD02C This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-19 20:08:08
|
Revision: 11542 http://gphoto.svn.sourceforge.net/gphoto/?rev=11542&view=rev Author: marcusmeissner Date: 2008-11-19 20:08:03 +0000 (Wed, 19 Nov 2008) Log Message: ----------- name ptp_canon_aeafawb -> ptp_canon_reset_aeafawn, document flags. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-18 16:30:32 UTC (rev 11541) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-19 20:08:03 UTC (rev 11542) @@ -1614,24 +1614,25 @@ } /** - * ptp_canon_aeafawb: + * ptp_canon_reset_aeafawb: * params: PTPParams* - * uint32_t p1 - Yet unknown parameter, - * value 7 works + * uint32_t flags - what shall be reset. + * 1 - autoexposure + * 2 - autofocus + * 4 - autowhitebalance * - * Called AeAfAwb (auto exposure, focus, white balance) + * Called "Reset AeAfAwb" (auto exposure, focus, white balance) * * Return values: Some PTP_RC_* code. - * **/ uint16_t -ptp_canon_aeafawb (PTPParams* params, uint32_t p1) +ptp_canon_reset_aeafawb (PTPParams* params, uint32_t flags) { PTPContainer ptp; PTP_CNT_INIT(ptp); ptp.Code=PTP_OC_CANON_DoAeAfAwb; - ptp.Param1=p1; + ptp.Param1=flags; ptp.Nparam=1; return ptp_transaction(params, &ptp, PTP_DP_NODATA, 0, NULL, NULL); } Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-18 16:30:32 UTC (rev 11541) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-19 20:08:03 UTC (rev 11542) @@ -1727,7 +1727,10 @@ uint16_t ptp_canon_viewfinderon (PTPParams* params); uint16_t ptp_canon_viewfinderoff (PTPParams* params); -uint16_t ptp_canon_aeafawb (PTPParams* params, uint32_t p1); +#define PTP_CANON_RESET_AE 0x1 +#define PTP_CANON_RESET_AF 0x2 +#define PTP_CANON_RESET_AWB 0x4 +uint16_t ptp_canon_reset_aeafawb (PTPParams* params, uint32_t flags); uint16_t ptp_canon_checkevent (PTPParams* params, PTPUSBEventContainer* event, int* isevent); uint16_t ptp_canon_focuslock (PTPParams* params); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-19 20:49:01
|
Revision: 11546 http://gphoto.svn.sourceforge.net/gphoto/?rev=11546&view=rev Author: marcusmeissner Date: 2008-11-19 20:48:56 +0000 (Wed, 19 Nov 2008) Log Message: ----------- dump more canon props Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp.c Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-19 20:46:50 UTC (rev 11545) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-19 20:48:56 UTC (rev 11546) @@ -1686,7 +1686,7 @@ } - ret = ptp_canon_aeafawb(params,7); + ret = ptp_canon_reset_aeafawb(params,7); break; } } Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-19 20:46:50 UTC (rev 11545) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-19 20:48:56 UTC (rev 11546) @@ -3721,6 +3721,7 @@ PTP_VENDOR_VAL_RBOOL(PTP_DPC_CANON_AssistLight,PTP_VENDOR_CANON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_CANON_RotationScene,PTP_VENDOR_CANON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_CANON_BeepMode,PTP_VENDOR_CANON), + PTP_VENDOR_VAL_BOOL(PTP_DPC_CANON_Beep,PTP_VENDOR_CANON), {PTP_DPC_CANON_RotationAngle, PTP_VENDOR_CANON, 0, "0'"}, {PTP_DPC_CANON_RotationAngle, PTP_VENDOR_CANON, 3, "270'"}, @@ -3738,6 +3739,62 @@ {PTP_DPC_CANON_BatteryStatus, PTP_VENDOR_CANON, 2, N_("Warning Level 1")}, {PTP_DPC_CANON_BatteryStatus, PTP_VENDOR_CANON, 3, N_("Emergency")}, {PTP_DPC_CANON_BatteryStatus, PTP_VENDOR_CANON, 4, N_("Warning Level 0")}, + + {PTP_DPC_CANON_ImageQuality, PTP_VENDOR_CANON, 0, N_("Undefined")}, + {PTP_DPC_CANON_ImageQuality, PTP_VENDOR_CANON, 1, N_("Economy")}, + {PTP_DPC_CANON_ImageQuality, PTP_VENDOR_CANON, 2, N_("Normal")}, + {PTP_DPC_CANON_ImageQuality, PTP_VENDOR_CANON, 3, N_("Fine")}, + {PTP_DPC_CANON_ImageQuality, PTP_VENDOR_CANON, 4, N_("Lossless")}, + {PTP_DPC_CANON_ImageQuality, PTP_VENDOR_CANON, 5, N_("SuperFine")}, + + {PTP_DPC_CANON_FullViewFileFormat, PTP_VENDOR_CANON, 0, N_("Undefined")}, + {PTP_DPC_CANON_FullViewFileFormat, PTP_VENDOR_CANON, 1, N_("JPEG")}, + {PTP_DPC_CANON_FullViewFileFormat, PTP_VENDOR_CANON, 2, N_("CRW")}, + + {PTP_DPC_CANON_ImageSize, PTP_VENDOR_CANON, 0, N_("Large")}, + {PTP_DPC_CANON_ImageSize, PTP_VENDOR_CANON, 1, N_("Medium 1")}, + {PTP_DPC_CANON_ImageSize, PTP_VENDOR_CANON, 2, N_("Small")}, + {PTP_DPC_CANON_ImageSize, PTP_VENDOR_CANON, 3, N_("Medium 2")}, + {PTP_DPC_CANON_ImageSize, PTP_VENDOR_CANON, 7, N_("Medium 3")}, + + {PTP_DPC_CANON_SelfTime, PTP_VENDOR_CANON, 0, N_("Not used")}, + {PTP_DPC_CANON_SelfTime, PTP_VENDOR_CANON, 100, N_("10 seconds")}, + {PTP_DPC_CANON_SelfTime, PTP_VENDOR_CANON, 20, N_("2 seconds")}, + + {PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, 0, N_("Off")}, + {PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, 1, N_("Auto")}, + {PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, 2, N_("On")}, + {PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, 3, N_("Red Eye Suppression")}, + {PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, 4, N_("Low Speed Synchronization")}, + {PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, 5, N_("Auto + Red Eye Suppression")}, + {PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, 6, N_("On + Red Eye Suppression")}, + + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 0, N_("Auto")}, + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 1, N_("P")}, + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 2, N_("Tv")}, + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 3, N_("Av")}, + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 4, N_("M")}, + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 5, N_("A_DEP")}, + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 6, N_("M_DEP")}, + {PTP_DPC_CANON_ShootingMode, PTP_VENDOR_CANON, 7, N_("Bulb")}, + /* more actually */ + + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 0, N_("Auto")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 1, N_("Manual")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 2, N_("Distant View")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 3, N_("High-Speed Shutter")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 4, N_("Low-Speed Shutter")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 5, N_("Night View")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 6, N_("Grayscale")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 7, N_("Sepia")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 8, N_("Portrait")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 9, N_("Sports")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 10, N_("Macro")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 11, N_("Monochrome")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 12, N_("Pan Focus")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 13, N_("Neutral")}, + {PTP_DPC_CANON_ImageMode, PTP_VENDOR_CANON, 14, N_("Soft")}, + {0, 0, 0, NULL} }; for (i=0; ptp_value_trans[i].dpc!=0; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-22 21:14:43
|
Revision: 11564 http://gphoto.svn.sourceforge.net/gphoto/?rev=11564&view=rev Author: marcusmeissner Date: 2008-11-22 21:14:40 +0000 (Sat, 22 Nov 2008) Log Message: ----------- merged back from 2.4 branch, some nikon d80 hidden property fixes Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp-private.h trunk/libgphoto2/camlibs/ptp2/ptp.c Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2008-11-22 21:04:38 UTC (rev 11563) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2008-11-22 21:14:40 UTC (rev 11564) @@ -85,14 +85,14 @@ ret = ptp_getdeviceinfo (params, ¶ms->deviceinfo); ret = ptp_getdeviceinfo (params, ¶ms->deviceinfo); - fixup_cached_deviceinfo (camera); + fixup_cached_deviceinfo (camera, ¶ms->deviceinfo); ret = ptp_getdevicepropvalue(params, PTP_DPC_CANON_SizeOfOutputDataFromCamera, &propval, PTP_DTC_UINT32); gp_log (GP_LOG_DEBUG, "ptp", "prop PTP_DPC_CANON_SizeOfOutputDataFromCamera value is 0x%8x, ret %d\n",propval.u32, ret); ret = ptp_getdevicepropvalue(params, PTP_DPC_CANON_SizeOfInputDataToCamera, &propval, PTP_DTC_UINT32); gp_log (GP_LOG_DEBUG, "ptp", "prop PTP_DPC_CANON_SizeOfInputDataToCamera value is 0x%8X, ret %d\n",propval.u32,ret); ret = ptp_getdeviceinfo (params, ¶ms->deviceinfo); - fixup_cached_deviceinfo (camera); + fixup_cached_deviceinfo (camera, ¶ms->deviceinfo); ret = ptp_getdevicepropvalue(params, PTP_DPC_CANON_EventEmulateMode, &propval, PTP_DTC_UINT16); gp_log (GP_LOG_DEBUG, "ptp","prop 0xd045 value is 0x%4x, ret %d\n",propval.u16,ret); @@ -140,7 +140,7 @@ } /* Reget device info, they change on the Canons. */ ptp_getdeviceinfo(&camera->pl->params, &camera->pl->params.deviceinfo); - fixup_cached_deviceinfo (camera); + fixup_cached_deviceinfo (camera, &camera->pl->params.deviceinfo); gp_port_set_timeout (camera->port, oldtimeout); return GP_OK; } @@ -195,7 +195,7 @@ gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "getdeviceinfo failed!"); return GP_ERROR; } - fixup_cached_deviceinfo (camera); + fixup_cached_deviceinfo (camera, &camera->pl->params.deviceinfo); ret = ptp_canon_eos_getstorageids(params, &sids); if (ret != PTP_RC_OK) { gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_capture", "9101 failed!"); @@ -272,7 +272,7 @@ } /* Reget device info, they change on the Canons. */ ptp_getdeviceinfo(&camera->pl->params, &camera->pl->params.deviceinfo); - fixup_cached_deviceinfo (camera); + fixup_cached_deviceinfo (camera, &camera->pl->params.deviceinfo); return GP_OK; } @@ -1579,6 +1579,7 @@ { N_("1 minute"), 0x02, 0 }, { N_("5 minutes"), 0x03, 0 }, { N_("10 minutes"), 0x04, 0 }, + { N_("5 seconds"), 0x05, 0 }, /* d80 observed */ }; GENERIC8TABLE(Nikon_LCDOffTime,nikon_lcdofftime) @@ -1588,6 +1589,7 @@ { N_("8 seconds"), 0x02, 0 }, { N_("16 seconds"), 0x03, 0 }, { N_("30 minutes"), 0x04, 0 }, + { N_("30 seconds"), 0x05, 0 }, /* d80 observed */ }; GENERIC8TABLE(Nikon_MeterOffTime,nikon_meterofftime) Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-22 21:04:38 UTC (rev 11563) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-22 21:14:40 UTC (rev 11564) @@ -253,11 +253,9 @@ }; void -fixup_cached_deviceinfo (Camera *camera) { +fixup_cached_deviceinfo (Camera *camera, PTPDeviceInfo *di) { CameraAbilities a; - PTPDeviceInfo *di; - di = &camera->pl->params.deviceinfo; gp_camera_get_abilities(camera, &a); /* Newer Canons say that they are MTP devices. Restore Canon vendor extid. */ if ( (di->VendorExtensionID == PTP_VENDOR_MICROSOFT) && @@ -276,6 +274,7 @@ camera->pl->bugs |= PTP_MTP; di->VendorExtensionID = PTP_VENDOR_NIKON; } + if ( (di->VendorExtensionID == PTP_VENDOR_NIKON) && (camera->pl->bugs & PTP_NIKON_SUPPRESSED_PROPS) ) { @@ -284,6 +283,13 @@ for (i=0;i<sizeof(nikon_extra_props)/sizeof(nikon_extra_props[0]);i++) di->DevicePropertiesSupported[i+di->DevicePropertiesSupported_len] = nikon_extra_props[i]; di->DevicePropertiesSupported_len += sizeof(nikon_extra_props)/sizeof(nikon_extra_props[0]); +#if 0 + /* hardcore hack ... just query d000 -> d1ff */ + di->DevicePropertiesSupported = realloc(di->DevicePropertiesSupported,sizeof(di->DevicePropertiesSupported[0])*(di->DevicePropertiesSupported_len + 2*256)); + for (i=0;i<2*256;i++) + di->DevicePropertiesSupported[i+di->DevicePropertiesSupported_len] = 0xD000 | i; + di->DevicePropertiesSupported_len += 2*256; +#endif } } @@ -616,7 +622,7 @@ /* Jana Jaeger <jjaeger.suse.de> */ {"Nikon:DSC D200 (PTP mode)", 0x04b0, 0x0410, PTP_CAP}, /* Christian Deckelmann @ SUSE */ - {"Nikon:DSC D80 (PTP mode)", 0x04b0, 0x0412, PTP_CAP}, + {"Nikon:DSC D80 (PTP mode)", 0x04b0, 0x0412, PTP_CAP|PTP_NIKON_SUPPRESSED_PROPS}, /* Huy Hoang <hoa...@um...> */ {"Nikon:DSC D40 (PTP mode)", 0x04b0, 0x0414, PTP_CAP/*|PTP_NIKON_SUPPRESSED_PROPS*/}, /* Luca Gervasi <luc...@gm...> */ @@ -1436,6 +1442,7 @@ _("Sorry, your camera does not support Nikon capture")); return GP_ERROR_NOT_SUPPORTED; } + init_ptp_fs (camera, context); if ( ptp_property_issupported(params, PTP_DPC_StillCaptureMode) && (PTP_RC_OK == ptp_getdevicepropdesc (params, PTP_DPC_StillCaptureMode, &propdesc)) && (propdesc.DataType == PTP_DTC_UINT16) && @@ -1682,8 +1689,6 @@ if ((ret==PTP_RC_OK) && isevent) gp_log (GP_LOG_DEBUG, "ptp", "evdata: L=0x%X, T=0x%X, C=0x%X, trans_id=0x%X, p1=0x%X, p2=0x%X, p3=0x%X\n", usbevent.length,usbevent.type,usbevent.code,usbevent.trans_id, usbevent.param1, usbevent.param2, usbevent.param3); } - - ret = ptp_canon_reset_aeafawb(params,7); break; } @@ -1906,6 +1911,7 @@ SET_CONTEXT(camera, context); memset (&event, 0, sizeof(event)); + init_ptp_fs (camera, context); if ( (params->deviceinfo.VendorExtensionID == PTP_VENDOR_CANON) && @@ -1952,7 +1958,7 @@ gp_file_set_mime_type (file, GP_MIME_JPEG); gp_log (GP_LOG_DEBUG, "ptp2/canon_eos_capture", "trying to get object size=0x%x", entries[i].u.object.oi.ObjectCompressedSize); - CPR (context, ptp_canon_eos_getpartialobject (params, newobject, 0, entries[i].u.object.oi.ObjectCompressedSize, (unsigned char**)&ximage)); + CPR (context, ptp_canon_eos_getpartialobject (params, newobject, 0, entries[i].u.object.oi.ObjectCompressedSize, &ximage)); CPR (context, ptp_canon_eos_transfercomplete (params, newobject)); ret = gp_file_set_data_and_size(file, (char*)ximage, entries[i].u.object.oi.ObjectCompressedSize); if (ret != GP_OK) { @@ -2517,7 +2523,7 @@ * the available properties in capture mode. */ CPR(context, ptp_getdeviceinfo(&camera->pl->params, &pdi)); - fixup_cached_deviceinfo(camera); + fixup_cached_deviceinfo(camera,&pdi); for (i=0;i<pdi.DevicePropertiesSupported_len;i++) { PTPDevicePropDesc dpd; unsigned int dpc = pdi.DevicePropertiesSupported[i]; @@ -4635,7 +4641,7 @@ CPR(context, ptp_getdeviceinfo(&camera->pl->params, &camera->pl->params.deviceinfo)); - fixup_cached_deviceinfo (camera); + fixup_cached_deviceinfo (camera,&camera->pl->params.deviceinfo); GP_DEBUG ("Device info:"); GP_DEBUG ("Manufacturer: %s",camera->pl->params.deviceinfo.Manufacturer); Modified: trunk/libgphoto2/camlibs/ptp2/ptp-private.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp-private.h 2008-11-22 21:04:38 UTC (rev 11563) +++ trunk/libgphoto2/camlibs/ptp2/ptp-private.h 2008-11-22 21:14:40 UTC (rev 11564) @@ -30,12 +30,12 @@ /* library.c */ void report_result (GPContext *context, short result, short vendor); int translate_ptp_result (short result); -void fixup_cached_deviceinfo (Camera *camera); +void fixup_cached_deviceinfo (Camera *camera, PTPDeviceInfo*); struct _CameraPrivateLibrary { PTPParams params; unsigned long bugs; - int fs_loaded; + int fs_loaded; }; struct _PTPData { Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-22 21:04:38 UTC (rev 11563) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-22 21:14:40 UTC (rev 11564) @@ -3713,6 +3713,7 @@ {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 83, "AF Nikkor 80-200mm 1:2.8 D ED"}, {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 118, "AF Nikkor 50mm 1:1.8 D"}, {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 127, "AF-S Nikkor 18-70mm 1:3.5-4.5G ED DX"}, + {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 154, "AF-S Nikkor 18-55mm 1:3.5-F5.6G DX VR"}, PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_LowLight,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_CSMMenu,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_NIKON_BeepOff,PTP_VENDOR_NIKON), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-23 16:08:31
|
Revision: 11570 http://gphoto.svn.sourceforge.net/gphoto/?rev=11570&view=rev Author: marcusmeissner Date: 2008-11-23 16:08:25 +0000 (Sun, 23 Nov 2008) Log Message: ----------- handle failing device propdesc queries in summary fixed canon capture to card mode Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-23 15:57:56 UTC (rev 11569) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-23 16:08:25 UTC (rev 11570) @@ -2282,7 +2282,7 @@ static int camera_summary (Camera* camera, CameraText* summary, GPContext *context) { - int n, i, j; + int n, i, j, ret; int spaceleft; char *txt; PTPParams *params = &(camera->pl->params); @@ -2574,69 +2574,73 @@ } memset (&dpd, 0, sizeof (dpd)); - ptp_getdevicepropdesc (params, dpc, &dpd); - - n = snprintf (txt, spaceleft, "(%s) ",_get_getset(dpd.GetSet)); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n = snprintf (txt, spaceleft, "(type=0x%x) ",dpd.DataType); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - switch (dpd.FormFlag) { - case PTP_DPFF_None: break; - case PTP_DPFF_Range: { - n = snprintf (txt, spaceleft, "Range ["); + ret = ptp_getdevicepropdesc (params, dpc, &dpd); + if (ret == PTP_RC_OK) { + n = snprintf (txt, spaceleft, "(%s) ",_get_getset(dpd.GetSet)); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n = _value_to_str (&dpd.FORM.Range.MinimumValue, dpd.DataType, txt, spaceleft); + n = snprintf (txt, spaceleft, "(type=0x%x) ",dpd.DataType); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n = snprintf (txt, spaceleft, " - "); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n= _value_to_str (&dpd.FORM.Range.MaximumValue, dpd.DataType, txt, spaceleft); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n = snprintf (txt, spaceleft, ", step "); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n= _value_to_str (&dpd.FORM.Range.StepSize, dpd.DataType, txt, spaceleft); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n = snprintf (txt, spaceleft, "] value: "); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - break; - } - case PTP_DPFF_Enumeration: - n = snprintf (txt, spaceleft, "Enumeration ["); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - if ((dpd.DataType & PTP_DTC_ARRAY_MASK) == PTP_DTC_ARRAY_MASK) { - n = snprintf (txt, spaceleft, "\n\t"); + switch (dpd.FormFlag) { + case PTP_DPFF_None: break; + case PTP_DPFF_Range: { + n = snprintf (txt, spaceleft, "Range ["); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n = _value_to_str (&dpd.FORM.Range.MinimumValue, dpd.DataType, txt, spaceleft); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n = snprintf (txt, spaceleft, " - "); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n= _value_to_str (&dpd.FORM.Range.MaximumValue, dpd.DataType, txt, spaceleft); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n = snprintf (txt, spaceleft, ", step "); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n= _value_to_str (&dpd.FORM.Range.StepSize, dpd.DataType, txt, spaceleft); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n = snprintf (txt, spaceleft, "] value: "); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + break; } - for (j = 0; j<dpd.FORM.Enum.NumberOfValues; j++) { - n = _value_to_str(dpd.FORM.Enum.SupportedValue+j,dpd.DataType,txt, spaceleft); + case PTP_DPFF_Enumeration: + n = snprintf (txt, spaceleft, "Enumeration ["); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - if (j != dpd.FORM.Enum.NumberOfValues-1) { - n = snprintf (txt, spaceleft, ","); + if ((dpd.DataType & PTP_DTC_ARRAY_MASK) == PTP_DTC_ARRAY_MASK) { + n = snprintf (txt, spaceleft, "\n\t"); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - if ((dpd.DataType & PTP_DTC_ARRAY_MASK) == PTP_DTC_ARRAY_MASK) { - n = snprintf (txt, spaceleft, "\n\t"); + } + for (j = 0; j<dpd.FORM.Enum.NumberOfValues; j++) { + n = _value_to_str(dpd.FORM.Enum.SupportedValue+j,dpd.DataType,txt, spaceleft); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + if (j != dpd.FORM.Enum.NumberOfValues-1) { + n = snprintf (txt, spaceleft, ","); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + if ((dpd.DataType & PTP_DTC_ARRAY_MASK) == PTP_DTC_ARRAY_MASK) { + n = snprintf (txt, spaceleft, "\n\t"); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + } } } + if ((dpd.DataType & PTP_DTC_ARRAY_MASK) == PTP_DTC_ARRAY_MASK) { + n = snprintf (txt, spaceleft, "\n\t"); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + } + n = snprintf (txt, spaceleft, "] value: "); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + break; } - if ((dpd.DataType & PTP_DTC_ARRAY_MASK) == PTP_DTC_ARRAY_MASK) { - n = snprintf (txt, spaceleft, "\n\t"); + n = ptp_render_property_value(params, dpc, &dpd, sizeof(summary->text) - strlen(summary->text) - 1, txt); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + if (n) { + n = snprintf(txt, spaceleft, " ("); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n = _value_to_str (&dpd.CurrentValue, dpd.DataType, txt, spaceleft); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + n = snprintf(txt, spaceleft, ")"); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; + } else { + n = _value_to_str (&dpd.CurrentValue, dpd.DataType, txt, spaceleft); + if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; } - n = snprintf (txt, spaceleft, "] value: "); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - break; - } - n = ptp_render_property_value(params, dpc, &dpd, sizeof(summary->text) - strlen(summary->text) - 1, txt); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - if (n) { - n = snprintf(txt, spaceleft, " ("); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n = _value_to_str (&dpd.CurrentValue, dpd.DataType, txt, spaceleft); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; - n = snprintf(txt, spaceleft, ")"); - if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; } else { - n = _value_to_str (&dpd.CurrentValue, dpd.DataType, txt, spaceleft); + n = snprintf (txt, spaceleft, _(" error %x on query."), ret); if (n>=spaceleft) return GP_OK;spaceleft-=n;txt+=n; } n = snprintf(txt, spaceleft, "\n"); Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-23 15:57:56 UTC (rev 11569) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-23 16:08:25 UTC (rev 11570) @@ -1114,8 +1114,8 @@ #define CANON_TRANSFER_SAVE_THUMBNAIL_TO_DEVICE 0x0004 #define CANON_TRANSFER_SAVE_IMAGE_TO_DEVICE 0x0008 /* we use those values: */ -#define CANON_TRANSFER_MEMORY 3 -#define CANON_TRANSFER_CARD 15 +#define CANON_TRANSFER_MEMORY (2|1) +#define CANON_TRANSFER_CARD (8|4|1) #define PTP_DPC_CANON_Zoom 0xD02A #define PTP_DPC_CANON_NamePrefix 0xD02B This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-11-27 08:15:04
|
Revision: 11583 http://gphoto.svn.sourceforge.net/gphoto/?rev=11583&view=rev Author: marcusmeissner Date: 2008-11-27 08:14:59 +0000 (Thu, 27 Nov 2008) Log Message: ----------- * library.c: Got the data for the D700, included. Changed nikon capture code to work with the D700 and other newer Nikon DSLRs. * ptp.[ch]: Decode the Nikon DSLR current rotation flag. * ptp.h: Mark up the operation codes for Nikons. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-11-26 13:38:43 UTC (rev 11582) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-11-27 08:14:59 UTC (rev 11583) @@ -1,3 +1,12 @@ +2008-11-27 Marcus Meissner <ma...@je...> + + * library.c: Got the data for the D700, included. + Changed nikon capture code to work with the D700 and other + newer Nikon DSLRs. + + * ptp.[ch]: Decode the Nikon DSLR current rotation flag. + * ptp.h: Mark up the operation codes for Nikons. + 2008-11-23 Marcus Meissner <ma...@je...> * library.c: Newer Nikon DSLRs "hide" the Nikon Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-26 13:38:43 UTC (rev 11582) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-11-27 08:14:59 UTC (rev 11583) @@ -259,13 +259,51 @@ 0xd1d0, 0xd1d1, 0xd1d2, 0xd1d3, 0xd1d4, 0xd1d5, 0xd1d6, 0xd1d7, 0xd1d8, 0xd1d9, 0xd1da, 0xd1db, 0xd1dc }; +const static uint16_t nikon_d700_extra_props[] = { +0xd010, 0xd011, 0xd012, 0xd013, 0xd014, 0xd015, 0xd016, 0xd017, +0xd018, 0xd019, 0xd01a, 0xd01b, 0xd01c, 0xd01d, 0xd01e, 0xd01f, +0xd020, 0xd021, 0xd022, 0xd023, 0xd024, 0xd025, 0xd026, 0xd027, +0xd028, 0xd029, 0xd02e, 0xd02f, +0xd030, 0xd031, 0xd032, 0xd033, +0xd040, 0xd041, 0xd042, 0xd043, 0xd044, 0xd045, 0xd048, 0xd049, 0xd04b, 0xd04f, +0xd050, 0xd051, 0xd053, 0xd054, 0xd055, 0xd056, 0xd057, +0xd058, 0xd059, 0xd05a, 0xd05b, 0xd05c, 0xd05e, 0xd05f, +0xd062, 0xd063, 0xd065, 0xd067, +0xd068, 0xd069, 0xd06a, 0xd06b, 0xd06c, 0xd06f, +0xd070, 0xd071, 0xd072, 0xd073, 0xd074, 0xd075, 0xd077, +0xd078, 0xd079, 0xd07a, +0xd080, 0xd081, 0xd082, 0xd083, 0xd084, 0xd085, 0xd086, 0xd087, +0xd088, 0xd089, 0xd08a, 0xd08b, 0xd08c, 0xd08d, +0xd090, 0xd091, 0xd092, 0xd093, 0xd094, 0xd095, 0xd096, 0xd097, +0xd098, 0xd099, 0xd09a, 0xd09b, +0xd0c0, 0xd0c1, 0xd0c2, 0xd0c3, 0xd0c4, 0xd0c5, +0xd0e0, 0xd0e1, 0xd0e2, 0xd0e3, 0xd0e4, 0xd0e5, 0xd0e6, +0xd0f2, 0xd0f3, 0xd0f4, 0xd0f7, +0xd100, 0xd101, 0xd102, 0xd103, 0xd104, 0xd105, 0xd106, +0xd108, 0xd109, 0xd10b, 0xd10c, 0xd10d, 0xd10e, +0xd110, 0xd111, 0xd112, 0xd113, 0xd114, +0xd120, 0xd121, 0xd122, 0xd123, 0xd124, 0xd125, 0xd126, +0xd149, 0xd14e, 0xd14f, +0xd150, 0xd151, 0xd152, 0xd153, 0xd154, 0xd155, +0xd160, 0xd163, 0xd164, 0xd166, 0xd167, 0xd16c, 0xd16d, +0xd182, 0xd183, 0xd184, 0xd187, 0xd189, 0xd18a, 0xd18b, 0xd18d, 0xd18e, +0xd1a0, 0xd1a1, 0xd1a2, 0xd1a3, 0xd1a4, +0xd1b0, 0xd1b1, 0xd1b2, 0xd1b3, +0xd1c0, 0xd1c1, +0xd1d0, 0xd1d1, 0xd1d2, 0xd1d3, 0xd1d4, 0xd1d5, 0xd1d6, 0xd1d7, +0xd1d8, 0xd1d9, 0xd1da, 0xd1db, 0xd1dc, +0xd200, 0xd201 +}; + static const struct { uint16_t productid; const uint16_t *extraprops; int nrextraprops; } nikon_extra_props[] = { /* D80 - confirmed by Marcus */ - { 0x412, nikon_d80_extra_props, sizeof(nikon_d80_extra_props)/sizeof(nikon_d80_extra_props[0]) } + { 0x412, nikon_d80_extra_props, sizeof(nikon_d80_extra_props)/sizeof(nikon_d80_extra_props[0]) }, + /* D700 - confirmed by Marcus */ + { 0x422, nikon_d700_extra_props, sizeof(nikon_d700_extra_props)/sizeof(nikon_d700_extra_props[0]) } }; void @@ -303,15 +341,17 @@ if (j==sizeof(nikon_extra_props)/sizeof(nikon_extra_props[0])) j=0; /* just use the first one as default */ +#if 1 di->DevicePropertiesSupported = realloc(di->DevicePropertiesSupported,sizeof(di->DevicePropertiesSupported[0])*(di->DevicePropertiesSupported_len + nikon_extra_props[j].nrextraprops)); for (i=0;i<nikon_extra_props[j].nrextraprops;i++) di->DevicePropertiesSupported[i+di->DevicePropertiesSupported_len] = nikon_extra_props[j].extraprops[i]; di->DevicePropertiesSupported_len += nikon_extra_props[j].nrextraprops; +#endif #if 0 /* hardcore hack ... just query d000 -> d1ff ... */ di->DevicePropertiesSupported = realloc(di->DevicePropertiesSupported,sizeof(di->DevicePropertiesSupported[0])*(di->DevicePropertiesSupported_len + 2*256)); for (i=0;i<2*256;i++) - di->DevicePropertiesSupported[i+di->DevicePropertiesSupported_len] = 0xD000 | i; + di->DevicePropertiesSupported[i+di->DevicePropertiesSupported_len] = 0xD000 + i; di->DevicePropertiesSupported_len += 2*256; #endif } @@ -1454,6 +1494,7 @@ PTPParams *params = &camera->pl->params; PTPDevicePropDesc propdesc; int i, ret, hasc101 = 0, burstnumber = 1; + uint32_t newobject; if (type != GP_CAPTURE_IMAGE) return GP_ERROR_NOT_SUPPORTED; @@ -1479,13 +1520,20 @@ gp_log (GP_LOG_DEBUG, "ptp2", "burstnumber %d", burstnumber); } - do { - ret = ptp_nikon_capture(params, 0xffffffff); - } while (ret == PTP_RC_DeviceBusy); + if (ptp_operation_issupported(params,PTP_OC_NIKON_AfCaptureSDRAM)) { + do { + ret = ptp_nikon_capture_sdram(params); + } while (ret == PTP_RC_DeviceBusy); + } else { + do { + ret = ptp_nikon_capture(params, 0xffffffff); + } while (ret == PTP_RC_DeviceBusy); + } CPR (context, ret); CR (gp_port_set_timeout (camera->port, USB_TIMEOUT_CAPTURE)); + newobject = 0xffff0001; while (!((ptp_nikon_device_ready(params) == PTP_RC_OK) && hasc101)) { int i, evtcnt; PTPUSBEventContainer *nevent = NULL; @@ -1496,8 +1544,11 @@ if (ret != PTP_RC_OK) break; for (i=0;i<evtcnt;i++) { - /*fprintf(stderr,"1:nevent.Code is %x / param %lx\n", nevent[i].code, (unsigned long)nevent[i].param1);*/ - if (nevent[i].code == 0xc101) hasc101=1; + gp_log (GP_LOG_DEBUG , "ptp/nikon_capture", "%d:nevent.Code is %x / param %lx\n", i, nevent[i].code, (unsigned long)nevent[i].param1); + if (nevent[i].code == 0xc101) { + hasc101=1; + newobject = nevent[i].param1; + } } free (nevent); } @@ -1505,10 +1556,11 @@ for (i=0;i<burstnumber;i++) { /* In Burst mode, the image is always 0xffff0001. * The firmware just gives us one after the other for the same ID + * Not so for the D700 :/ */ - ret = ptp_getobjectinfo (params, 0xffff0001, &oi); + ret = ptp_getobjectinfo (params, newobject, &oi); if (ret != PTP_RC_OK) { - fprintf (stderr,"getobjectinfo(%x) failed: %d\n", 0xffff0001, ret); + fprintf (stderr,"getobjectinfo(%x) failed: %d\n", newobject, ret); return GP_ERROR_IO; } if (oi.ParentObject != 0) @@ -1518,7 +1570,7 @@ oi.StorageID = 0x00010001; sprintf (path->folder,"/"STORAGE_FOLDER_PREFIX"%08lx",(unsigned long)oi.StorageID); sprintf (path->name, "capt%04d.jpg", capcnt++); - ret = add_objectid_to_gphotofs(camera, path, context, 0xffff0001, &oi); + ret = add_objectid_to_gphotofs(camera, path, context, newobject, &oi); if (ret != GP_OK) { fprintf (stderr, "failed to add object\n"); return ret; Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-26 13:38:43 UTC (rev 11582) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-11-27 08:14:59 UTC (rev 11583) @@ -2371,6 +2371,27 @@ } /** + * ptp_nikon_capture_sdram: + * + * This command captures a picture on the Nikon. + * + * params: PTPParams* + * + * Return values: Some PTP_RC_* code. + * + **/ +uint16_t +ptp_nikon_capture_sdram (PTPParams* params) +{ + PTPContainer ptp; + + PTP_CNT_INIT(ptp); + ptp.Code=PTP_OC_NIKON_AfCaptureSDRAM; + ptp.Nparam=0; + return ptp_transaction(params, &ptp, PTP_DP_NODATA, 0, NULL, NULL); +} + +/** * ptp_nikon_check_event: * * This command checks the event queue on the Nikon. @@ -3397,6 +3418,8 @@ N_("Active AF Sensor")}, {PTP_DPC_NIKON_LightMeter, /* 0xD10a */ N_("Exposure Meter")}, + {PTP_DPC_NIKON_CameraOrientation, /* 0xD10e */ + N_("Camera Orientation")}, {PTP_DPC_NIKON_ExposureApertureLock, /* 0xD111 */ N_("Exposure Aperture Lock")}, {PTP_DPC_NIKON_MaximumShots, /* 0xD103 */ @@ -3713,11 +3736,17 @@ {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 83, "AF Nikkor 80-200mm 1:2.8 D ED"}, {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 118, "AF Nikkor 50mm 1:1.8 D"}, {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 127, "AF-S Nikkor 18-70mm 1:3.5-4.5G ED DX"}, + {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 147, "AF-S Nikkor 24-70mm 1:2.8G ED DX"}, {PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, 154, "AF-S Nikkor 18-55mm 1:3.5-F5.6G DX VR"}, PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_LowLight,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_CSMMenu,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_NIKON_BeepOff,PTP_VENDOR_NIKON), + {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 0, "0'"}, + {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 1, "270'"}, + {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 2, "90'"}, + {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 3, "180'"}, + /* Canon stuff */ PTP_VENDOR_VAL_BOOL(PTP_DPC_CANON_AssistLight,PTP_VENDOR_CANON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_CANON_RotationScene,PTP_VENDOR_CANON), Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-26 13:38:43 UTC (rev 11582) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-11-27 08:14:59 UTC (rev 11583) @@ -345,12 +345,17 @@ #define PTP_OC_NIKON_SetProfileData 0x9009 #define PTP_OC_NIKON_AdvancedTransfer 0x9010 #define PTP_OC_NIKON_GetFileInfoInBlock 0x9011 -#define PTP_OC_NIKON_Capture 0x90C0 -#define PTP_OC_NIKON_SetControlMode 0x90C2 -#define PTP_OC_NIKON_CurveDownload 0x90C5 -#define PTP_OC_NIKON_CurveUpload 0x90C6 -#define PTP_OC_NIKON_CheckEvent 0x90C7 -#define PTP_OC_NIKON_DeviceReady 0x90C8 +#define PTP_OC_NIKON_Capture 0x90C0 /* 1 param, no data */ +#define PTP_OC_NIKON_AfDrive 0x90C1 /* no params, no data */ +#define PTP_OC_NIKON_SetControlMode 0x90C2 /* 1 param, no data */ +#define PTP_OC_NIKON_DelImageSDRAM 0x90C3 /* no params, no data */ +#define PTP_OC_NIKON_CurveDownload 0x90C5 /* 1 param, data in */ +#define PTP_OC_NIKON_CurveUpload 0x90C6 /* 1 param, data out */ +#define PTP_OC_NIKON_CheckEvent 0x90C7 /* no params, data in */ +#define PTP_OC_NIKON_DeviceReady 0x90C8 /* no params, no data */ +#define PTP_OC_NIKON_SetPreWBData 0x90C9 /* 3 params, data out */ + /* 0x90CA */ +#define PTP_OC_NIKON_AfCaptureSDRAM 0x90CB /* no params, no data */ #define PTP_OC_NIKON_GetDevicePTPIPInfo 0x90E0 /* Microsoft / MTP extension codes */ @@ -1780,6 +1785,7 @@ uint16_t ptp_nikon_deletewifiprofile (PTPParams* params, uint32_t profilenr); uint16_t ptp_nikon_setcontrolmode (PTPParams* params, uint32_t mode); uint16_t ptp_nikon_capture (PTPParams* params, uint32_t x); +uint16_t ptp_nikon_capture_sdram (PTPParams* params); uint16_t ptp_nikon_check_event (PTPParams* params, PTPUSBEventContainer **evt, int *evtcnt); uint16_t ptp_nikon_getfileinfoinblock (PTPParams* params, uint32_t p1, uint32_t p2, uint32_t p3, unsigned char **data, unsigned int *size); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-12-12 21:25:03
|
Revision: 11616 http://gphoto.svn.sourceforge.net/gphoto/?rev=11616&view=rev Author: marcusmeissner Date: 2008-12-12 21:24:57 +0000 (Fri, 12 Dec 2008) Log Message: ----------- added nikon lowlight indicator (r/o), fixed canon camera output Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/library.c Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-11 09:05:17 UTC (rev 11615) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-12 21:24:57 UTC (rev 11616) @@ -1555,6 +1555,29 @@ } +static int +_get_Nikon_LowLight(CONFIG_GET_ARGS) { + float value_float; + + gp_widget_new (GP_WIDGET_RANGE, _(menu->label), widget); + gp_widget_set_name (*widget, menu->name); + + if (!(dpd->FormFlag & PTP_DPFF_Range)) + return (GP_ERROR); + + if (dpd->DataType != PTP_DTC_UINT8) + return (GP_ERROR); + + gp_widget_set_range (*widget, + dpd->FORM.Range.MinimumValue.u8, + dpd->FORM.Range.MaximumValue.u8, + dpd->FORM.Range.StepSize.u8 + ); + value_float = dpd->CurrentValue.u8; + gp_widget_set_value (*widget, &value_float); + return (GP_OK); +} + static struct deviceproptableu8 nikon_afareaillum[] = { { N_("Auto"), 0, 0 }, { N_("Off"), 1, 0 }, @@ -2678,7 +2701,7 @@ { N_("Meter Off Time"), "meterofftime", PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_MeterOffTime, _put_Nikon_MeterOffTime }, { N_("CSM Menu"), "csmmenu", PTP_DPC_NIKON_CSMMenu, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8 }, { N_("Battery Level"), "battery", PTP_DPC_BatteryLevel, 0, PTP_DTC_UINT8, _get_BatteryLevel, _put_None }, - { N_("Camera Output"), "output", PTP_DPC_CANON_CameraOutput, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_CameraOutput, _put_Canon_CameraOutput }, + { N_("Camera Output"), "output", PTP_DPC_CANON_CameraOutput, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_CameraOutput, _put_Canon_CameraOutput }, /* virtual */ { N_("Fast Filesystem"), "fastfs", 0, PTP_VENDOR_NIKON, 0, _get_Nikon_FastFS, _put_Nikon_FastFS }, @@ -2777,6 +2800,9 @@ { N_("Tone Compensation"), "tonecompensation", PTP_DPC_NIKON_ToneCompensation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_ToneCompensation, _put_Nikon_ToneCompensation }, { N_("Saturation"), "saturation", PTP_DPC_NIKON_Saturation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_Saturation, _put_Nikon_Saturation }, { N_("Hue Adjustment"), "hueadjustment", PTP_DPC_NIKON_HueAdjustment, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_HueAdjustment, _put_Nikon_HueAdjustment }, + + { N_("Low Light"), "lowlight", PTP_DPC_NIKON_LowLight, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_LowLight, _put_None }, + /* { N_("Viewfinder Mode"), "viewfinder", PTP_DPC_CANON_ViewFinderMode, PTP_VENDOR_CANON, PTP_DTC_UINT32, _get_Canon_ViewFinderMode, _put_Canon_ViewFinderMode}, */ { N_("Focus Lock"), "focuslock", 0, PTP_VENDOR_CANON, 0, _get_Canon_FocusLock, _put_Canon_FocusLock}, { 0,0,0,0,0,0,0 }, Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-12-11 09:05:17 UTC (rev 11615) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-12-12 21:24:57 UTC (rev 11616) @@ -961,6 +961,8 @@ /* https://sourceforge.net/tracker/?func=detail&atid=358874&aid=1910010&group_id=8874 */ {"Canon:Digital IXUS 80 IS", 0x04a9, 0x3184, PTPBUG_DELETE_SENDS_EVENT}, + /* https://sourceforge.net/tracker/index.php?func=detail&aid=2391422&group_id=8874&atid=358874 */ + {"Canon:Powershot SD1100 IS", 0x04a9, 0x3184, PTPBUG_DELETE_SENDS_EVENT}, /* Chris Rodley <ch...@ta...> */ {"Canon:PowerShot SX110 IS", 0x04a9, 0x3192, PTPBUG_DELETE_SENDS_EVENT|PTP_MTP|PTP_CAP|PTP_CAP_PREVIEW}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-12-14 20:55:46
|
Revision: 11621 http://gphoto.svn.sourceforge.net/gphoto/?rev=11621&view=rev Author: marcusmeissner Date: 2008-12-14 20:55:39 +0000 (Sun, 14 Dec 2008) Log Message: ----------- found some more Nikon Property Ids Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-12-14 16:29:29 UTC (rev 11620) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-12-14 20:55:39 UTC (rev 11621) @@ -1,3 +1,7 @@ +2008-12-14 Marcus Meissner <ma...@je...> + + * ptp.h: Found some Nikon property ids. + 2008-11-27 Marcus Meissner <ma...@je...> * library.c: Got the data for the D700 and D300, included. Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-14 16:29:29 UTC (rev 11620) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-14 20:55:39 UTC (rev 11621) @@ -3419,16 +3419,16 @@ N_("No CF Card Release")}, {PTP_DPC_NIKON_ImageCommentString, /* 0xD090 */ N_("Image Comment String")}, - {PTP_DPC_NIKON_ImageCommentAttach, /* 0xD091 */ - N_("Image Comment Attach")}, + {PTP_DPC_NIKON_ImageCommentEnable, /* 0xD091 */ + N_("Image Comment Enable")}, {PTP_DPC_NIKON_ImageRotation, /* 0xD092 */ N_("Image Rotation")}, {PTP_DPC_NIKON_Bracketing, /* 0xD0c0 */ N_("Exposure Bracketing")}, - {PTP_DPC_NIKON_ExposureBracketingIntervalDist, /* 0xD0c1 */ - N_("Exposure Bracketing Distance")}, - {PTP_DPC_NIKON_BracketingProgram, /* 0xD0c2 */ - N_("Exposure Bracketing Number")}, + {PTP_DPC_NIKON_AutoExposureBracketStep, /* 0xD0c1 */ + N_("Exposure Bracketing Step")}, + {PTP_DPC_NIKON_AutoExposureBracketProgram, /* 0xD0c2 */ + N_("Exposure Bracketing Program")}, {PTP_DPC_NIKON_WhiteBalanceBracketStep, N_("NIKON White Balance Bracket Step")}, /* 0xD0C4 */ {PTP_DPC_NIKON_LensID, /* 0xD0E0 */ N_("Lens ID")}, @@ -3445,11 +3445,9 @@ {PTP_DPC_NIKON_ACPower, N_("AC Power")}, /* 0xD101 */ {PTP_DPC_NIKON_MaximumShots, /* 0xD103 */ N_("Maximum Shots")}, - {PTP_DPC_NIKON_AFLLock, N_("NIKON AF-L Locked")},/* 0xD104 */ - {PTP_DPC_NIKON_AutoExposureLock, /* 0xD105 */ - N_("Auto Exposure Lock")}, - {PTP_DPC_NIKON_AutoFocusLock, /* 0xD106 */ - N_("Auto Focus Lock")}, + {PTP_DPC_NIKON_AFLock, N_("AF Locked")},/* 0xD104 */ + {PTP_DPC_NIKON_AFLock, N_("AE Locked")},/* 0xD105 */ + {PTP_DPC_NIKON_AFLock, N_("FV Locked")},/* 0xD106 */ {PTP_DPC_NIKON_AutofocusLCDTopMode2, /* 0xD107 */ N_("AF LCD Top Mode 2")}, {PTP_DPC_NIKON_AutofocusArea, /* 0xD108 */ Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-12-14 16:29:29 UTC (rev 11620) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-12-14 20:55:39 UTC (rev 11621) @@ -1188,6 +1188,9 @@ #define PTP_DPC_NIKON_WhiteBalanceCloudyBias 0xD01C #define PTP_DPC_NIKON_WhiteBalanceShadeBias 0xD01D #define PTP_DPC_NIKON_WhiteBalanceColorTemperature 0xD01E +#define PTP_DPC_NIKON_WhiteBalancePresetNo 0xD01F +#define PTP_DPC_NIKON_WhiteBalancePresentVal0 0xD025 +#define PTP_DPC_NIKON_WhiteBalancePresentVal1 0xD026 #define PTP_DPC_NIKON_ImageSharpening 0xD02A #define PTP_DPC_NIKON_ToneCompensation 0xD02B #define PTP_DPC_NIKON_ColorModel 0xD02C @@ -1199,6 +1202,7 @@ #define PTP_DPC_NIKON_MenuBankNameB 0xD042 #define PTP_DPC_NIKON_MenuBankNameC 0xD043 #define PTP_DPC_NIKON_MenuBankNameD 0xD044 +#define PTP_DPC_NIKON_ResetBank 0xD045 #define PTP_DPC_NIKON_A1AFCModePriority 0xD048 #define PTP_DPC_NIKON_A2AFSModePriority 0xD049 #define PTP_DPC_NIKON_A3GroupDynamicAF 0xD04A @@ -1208,6 +1212,7 @@ #define PTP_DPC_NIKON_FocusAreaIllumWhenSelected 0xD04E #define PTP_DPC_NIKON_FocusAreaWrap 0xD04F #define PTP_DPC_NIKON_A7VerticalAFON 0xD050 +#define PTP_DPC_NIKON_FocusAreaZone 0xD052 #define PTP_DPC_NIKON_ISOAuto 0xD054 #define PTP_DPC_NIKON_B2ISOStep 0xD055 #define PTP_DPC_NIKON_EVStep 0xD056 @@ -1227,8 +1232,9 @@ #define PTP_DPC_NIKON_D6ControlPanelFinderRearControl 0xD06D #define PTP_DPC_NIKON_ControlPanelFinderViewfinder 0xD06E #define PTP_DPC_NIKON_D7Illumination 0xD06F +#define PTP_DPC_NIKON_NrHighISO 0xD070 #define PTP_DPC_NIKON_E1FlashSyncSpeed 0xD074 -#define PTP_DPC_NIKON_FlashShutterSpeed 0xD075 +#define PTP_DPC_NIKON_FlashShutterSpeed 0xD075 /* SB Low Limit */ #define PTP_DPC_NIKON_E3AAFlashMode 0xD076 #define PTP_DPC_NIKON_E4ModelingFlash 0xD077 #define PTP_DPC_NIKON_BracketSet 0xD078 @@ -1248,49 +1254,83 @@ #define PTP_DPC_NIKON_F6ButtonsAndDials 0xD089 #define PTP_DPC_NIKON_NoCFCard 0xD08A #define PTP_DPC_NIKON_ImageCommentString 0xD090 -#define PTP_DPC_NIKON_ImageCommentAttach 0xD091 +#define PTP_DPC_NIKON_ImageCommentEnable 0xD091 #define PTP_DPC_NIKON_ImageRotation 0xD092 #define PTP_DPC_NIKON_Bracketing 0xD0C0 -#define PTP_DPC_NIKON_ExposureBracketingIntervalDist 0xD0C1 -#define PTP_DPC_NIKON_BracketingProgram 0xD0C2 +#define PTP_DPC_NIKON_AutoExposureBracketStep 0xD0C1 /* auto exposure bracketing step */ +#define PTP_DPC_NIKON_AutoExposureBracketProgram 0xD0C2 +#define PTP_DPC_NIKON_AutoExposureBracketCount 0xD0C3 #define PTP_DPC_NIKON_WhiteBalanceBracketStep 0xD0C4 +#define PTP_DPC_NIKON_WhiteBalanceBracketProgram 0xD0C5 #define PTP_DPC_NIKON_LensID 0xD0E0 +#define PTP_DPC_NIKON_LensSort 0xD0E1 +#define PTP_DPC_NIKON_LensType 0xD0E2 #define PTP_DPC_NIKON_FocalLengthMin 0xD0E3 #define PTP_DPC_NIKON_FocalLengthMax 0xD0E4 #define PTP_DPC_NIKON_MaxApAtMinFocalLength 0xD0E5 #define PTP_DPC_NIKON_MaxApAtMaxFocalLength 0xD0E6 #define PTP_DPC_NIKON_ExposureTime 0xD100 #define PTP_DPC_NIKON_ACPower 0xD101 -#define PTP_DPC_NIKON_MaximumShots 0xD103 -#define PTP_DPC_NIKON_AFLLock 0xD104 -#define PTP_DPC_NIKON_AutoExposureLock 0xD105 -#define PTP_DPC_NIKON_AutoFocusLock 0xD106 +#define PTP_DPC_NIKON_WarningStatus 0xD102 +#define PTP_DPC_NIKON_MaximumShots 0xD103 /* remain shots (in RAM buffer?) */ +#define PTP_DPC_NIKON_AFLockStatus 0xD104 +#define PTP_DPC_NIKON_AELockStatus 0xD105 +#define PTP_DPC_NIKON_FVLockStatus 0xD106 #define PTP_DPC_NIKON_AutofocusLCDTopMode2 0xD107 #define PTP_DPC_NIKON_AutofocusArea 0xD108 +#define PTP_DPC_NIKON_FlexibleProgram 0xD109 #define PTP_DPC_NIKON_LightMeter 0xD10A #define PTP_DPC_NIKON_CameraOrientation 0xD10E #define PTP_DPC_NIKON_ExposureApertureLock 0xD111 +#define PTP_DPC_NIKON_ExternalFlashAttached 0xD120 +#define PTP_DPC_NIKON_ExternalFlashStatus 0xD121 +#define PTP_DPC_NIKON_ExternalFlashSort 0xD122 +#define PTP_DPC_NIKON_ExternalFlashCompensation 0xD124 +#define PTP_DPC_NIKON_NewExternalFlashMode 0xD125 #define PTP_DPC_NIKON_FlashExposureCompensation 0xD126 #define PTP_DPC_NIKON_OptimizeImage 0xD140 #define PTP_DPC_NIKON_Saturation 0xD142 +#define PTP_DPC_NIKON_BW_FillerEffect 0xD143 +#define PTP_DPC_NIKON_BW_Sharpness 0xD144 +#define PTP_DPC_NIKON_BW_Contrast 0xD145 +#define PTP_DPC_NIKON_BW_Setting_Type 0xD146 #define PTP_DPC_NIKON_BeepOff 0xD160 #define PTP_DPC_NIKON_AutofocusMode 0xD161 #define PTP_DPC_NIKON_AFAssist 0xD163 -#define PTP_DPC_NIKON_PADVPMode 0xD164 +#define PTP_DPC_NIKON_PADVPMode 0xD164 /* iso auto time */ #define PTP_DPC_NIKON_ImageReview 0xD165 #define PTP_DPC_NIKON_AFAreaIllumination 0xD166 #define PTP_DPC_NIKON_FlashMode 0xD167 #define PTP_DPC_NIKON_FlashCommanderMode 0xD168 #define PTP_DPC_NIKON_FlashSign 0xD169 +#define PTP_DPC_NIKON_ISO_Auto 0xD16A #define PTP_DPC_NIKON_RemoteTimeout 0xD16B #define PTP_DPC_NIKON_GridDisplay 0xD16C #define PTP_DPC_NIKON_FlashModeManualPower 0xD16D #define PTP_DPC_NIKON_FlashModeCommanderPower 0xD16E +#define PTP_DPC_NIKON_AutoFP 0xD16F #define PTP_DPC_NIKON_CSMMenu 0xD180 +#define PTP_DPC_NIKON_WarningDisplay 0xD181 +#define PTP_DPC_NIKON_BatteryCellKind 0xD182 +#define PTP_DPC_NIKON_ISOAutoHiLimit 0xD183 #define PTP_DPC_NIKON_BracketingFramesAndSteps 0xD190 -#define PTP_DPC_NIKON_LowLight 0xD1B0 +#define PTP_DPC_NIKON_LowLight 0xD1B0 /* exp disp status */ +#define PTP_DPC_NIKON_ExposureIndicateStatus 0xD1B1 /* exp indicate status */ #define PTP_DPC_NIKON_FlashOpen 0xD1C0 #define PTP_DPC_NIKON_FlashCharged 0xD1C1 +#define PTP_DPC_NIKON_FlashMRepeatValue 0xD1D0 +#define PTP_DPC_NIKON_FlashMRepeatCount 0xD1D1 +#define PTP_DPC_NIKON_FlashMRepeatInterval 0xD1D2 +#define PTP_DPC_NIKON_FlashCommandChannel 0xD1D3 +#define PTP_DPC_NIKON_FlashCommandSelfMode 0xD1D4 +#define PTP_DPC_NIKON_FlashCommandSelfCompensation 0xD1D5 +#define PTP_DPC_NIKON_FlashCommandSelfValue 0xD1D6 +#define PTP_DPC_NIKON_FlashCommandAMode 0xD1D7 +#define PTP_DPC_NIKON_FlashCommandACompensation 0xD1D8 +#define PTP_DPC_NIKON_FlashCommandAValue 0xD1D9 +#define PTP_DPC_NIKON_FlashCommandBMode 0xD1DA +#define PTP_DPC_NIKON_FlashCommandBCompensation 0xD1DB +#define PTP_DPC_NIKON_FlashCommandBValue 0xD1DC /* Microsoft/MTP specific */ #define PTP_DPC_MTP_SecureTime 0xD101 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-12-15 20:36:04
|
Revision: 11622 http://gphoto.svn.sourceforge.net/gphoto/?rev=11622&view=rev Author: marcusmeissner Date: 2008-12-15 20:35:52 +0000 (Mon, 15 Dec 2008) Log Message: ----------- fixed typos, decode names for d70s Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-14 20:55:39 UTC (rev 11621) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-15 20:35:52 UTC (rev 11622) @@ -3300,6 +3300,12 @@ N_("Shady White Balance Bias")}, {PTP_DPC_NIKON_WhiteBalanceColorTemperature, /* 0xD01e */ N_("White Balance Colour Temperature")}, + {PTP_DPC_NIKON_WhiteBalancePresetNo, /* 0xD01f */ + N_("White Balance Present Number")}, + {PTP_DPC_NIKON_WhiteBalancePresetVal0, /* 0xD025 */ + N_("White Balance Present Value 0")}, + {PTP_DPC_NIKON_WhiteBalancePresetVal1, /* 0xD026 */ + N_("White Balance Present Value 1")}, {PTP_DPC_NIKON_ImageSharpening, /* 0xD02a */ N_("Sharpening")}, {PTP_DPC_NIKON_ToneCompensation, /* 0xD02b */ @@ -3315,13 +3321,15 @@ {PTP_DPC_NIKON_CSMMenuBankSelect, /* 0xD040 */ "PTP_DPC_NIKON_CSMMenuBankSelect"}, {PTP_DPC_NIKON_MenuBankNameA, /* 0xD041 */ - "PTP_DPC_NIKON_MenuBankNameA"}, + N_("Menu Bank Name A")}, {PTP_DPC_NIKON_MenuBankNameB, /* 0xD042 */ - "PTP_DPC_NIKON_MenuBankNameB"}, + N_("Menu Bank Name B")}, {PTP_DPC_NIKON_MenuBankNameC, /* 0xD043 */ - "PTP_DPC_NIKON_MenuBankNameC"}, + N_("Menu Bank Name C")}, {PTP_DPC_NIKON_MenuBankNameD, /* 0xD044 */ - "PTP_DPC_NIKON_MenuBankNameD"}, + N_("Menu Bank Name D")}, + {PTP_DPC_NIKON_ResetBank, /* 0xD045 */ + N_("Reset Menu Bank")}, {PTP_DPC_NIKON_A1AFCModePriority, /* 0xD048 */ "PTP_DPC_NIKON_A1AFCModePriority"}, {PTP_DPC_NIKON_A2AFSModePriority, /* 0xD049 */ @@ -3429,9 +3437,16 @@ N_("Exposure Bracketing Step")}, {PTP_DPC_NIKON_AutoExposureBracketProgram, /* 0xD0c2 */ N_("Exposure Bracketing Program")}, - {PTP_DPC_NIKON_WhiteBalanceBracketStep, N_("NIKON White Balance Bracket Step")}, /* 0xD0C4 */ + {PTP_DPC_NIKON_AutoExposureBracketCount, /* 0xD0c3 */ + N_("Auto Exposure Bracket Count")}, + {PTP_DPC_NIKON_WhiteBalanceBracketStep, N_("White Balance Bracket Step")}, /* 0xD0C4 */ + {PTP_DPC_NIKON_WhiteBalanceBracketProgram, N_("White Balance Bracket Program")}, /* 0xD0C5 */ {PTP_DPC_NIKON_LensID, /* 0xD0E0 */ N_("Lens ID")}, + {PTP_DPC_NIKON_LensSort, /* 0xD0E1 */ + N_("Lens Sort")}, + {PTP_DPC_NIKON_LensType, /* 0xD0E2 */ + N_("Lens Type")}, {PTP_DPC_NIKON_FocalLengthMin, /* 0xD0E3 */ N_("Min. Focal Length")}, {PTP_DPC_NIKON_FocalLengthMax, /* 0xD0E4 */ @@ -3443,21 +3458,34 @@ {PTP_DPC_NIKON_ExposureTime, /* 0xD100 */ N_("Nikon Exposure Time")}, {PTP_DPC_NIKON_ACPower, N_("AC Power")}, /* 0xD101 */ + {PTP_DPC_NIKON_WarningStatus, N_("Warning Status")},/* 0xD102 */ {PTP_DPC_NIKON_MaximumShots, /* 0xD103 */ N_("Maximum Shots")}, - {PTP_DPC_NIKON_AFLock, N_("AF Locked")},/* 0xD104 */ - {PTP_DPC_NIKON_AFLock, N_("AE Locked")},/* 0xD105 */ - {PTP_DPC_NIKON_AFLock, N_("FV Locked")},/* 0xD106 */ + {PTP_DPC_NIKON_AFLockStatus, N_("AF Locked")},/* 0xD104 */ + {PTP_DPC_NIKON_AELockStatus, N_("AE Locked")},/* 0xD105 */ + {PTP_DPC_NIKON_FVLockStatus, N_("FV Locked")},/* 0xD106 */ {PTP_DPC_NIKON_AutofocusLCDTopMode2, /* 0xD107 */ N_("AF LCD Top Mode 2")}, {PTP_DPC_NIKON_AutofocusArea, /* 0xD108 */ N_("Active AF Sensor")}, + {PTP_DPC_NIKON_FlexibleProgram, /* 0xD109 */ + N_("Flexible Program")}, {PTP_DPC_NIKON_LightMeter, /* 0xD10a */ N_("Exposure Meter")}, {PTP_DPC_NIKON_CameraOrientation, /* 0xD10e */ N_("Camera Orientation")}, {PTP_DPC_NIKON_ExposureApertureLock, /* 0xD111 */ N_("Exposure Aperture Lock")}, + {PTP_DPC_NIKON_ExternalFlashAttached, /* 0xD120 */ + N_("External Flash Attached")}, + {PTP_DPC_NIKON_ExternalFlashStatus, /* 0xD121 */ + N_("External Flash Status")}, + {PTP_DPC_NIKON_ExternalFlashSort, /* 0xD122 */ + N_("External Flash Sort")}, + {PTP_DPC_NIKON_ExternalFlashCompensation, /* 0xD124 */ + N_("External Flash Compensation")}, + {PTP_DPC_NIKON_NewExternalFlashMode, /* 0xD125 */ + N_("External Flash Mode")}, {PTP_DPC_NIKON_FlashExposureCompensation, /* 0xD126 */ N_("Flash Exposure Compensation")}, {PTP_DPC_NIKON_OptimizeImage, /* 0xD140 */ Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-12-14 20:55:39 UTC (rev 11621) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-12-15 20:35:52 UTC (rev 11622) @@ -1189,8 +1189,8 @@ #define PTP_DPC_NIKON_WhiteBalanceShadeBias 0xD01D #define PTP_DPC_NIKON_WhiteBalanceColorTemperature 0xD01E #define PTP_DPC_NIKON_WhiteBalancePresetNo 0xD01F -#define PTP_DPC_NIKON_WhiteBalancePresentVal0 0xD025 -#define PTP_DPC_NIKON_WhiteBalancePresentVal1 0xD026 +#define PTP_DPC_NIKON_WhiteBalancePresetVal0 0xD025 +#define PTP_DPC_NIKON_WhiteBalancePresetVal1 0xD026 #define PTP_DPC_NIKON_ImageSharpening 0xD02A #define PTP_DPC_NIKON_ToneCompensation 0xD02B #define PTP_DPC_NIKON_ColorModel 0xD02C This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-12-15 21:03:37
|
Revision: 11624 http://gphoto.svn.sourceforge.net/gphoto/?rev=11624&view=rev Author: marcusmeissner Date: 2008-12-15 21:03:17 +0000 (Mon, 15 Dec 2008) Log Message: ----------- fixed nikon afmode, handle older nikons in nikon capture Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp.c Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-15 20:56:59 UTC (rev 11623) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-15 21:03:17 UTC (rev 11624) @@ -1068,6 +1068,13 @@ }; GENERIC8TABLE(Nikon_FlashMode,nikon_flashmode) +static struct deviceproptableu8 nikon_afmode[] = { + { N_("AF-S"), 0, 0 }, + { N_("AF-C"), 1, 0 }, + /* more for newer */ +}; +GENERIC8TABLE(Nikon_AFMode,nikon_afmode) + static struct deviceproptableu8 flash_modemanualpower[] = { { N_("Full"), 0x00, 0 }, { "1/2", 0x01, 0 }, @@ -2732,7 +2739,7 @@ static struct submenu capture_settings_menu[] = { { N_("Long Exp Noise Reduction"), "longexpnr", PTP_DPC_NIKON_LongExposureNoiseReduction, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, - { N_("Auto Focus Mode"), "autofocusmode", PTP_DPC_NIKON_AutofocusMode, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, + { N_("Auto Focus Mode"), "autofocusmode", PTP_DPC_NIKON_AutofocusMode, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_AFMode, _put_Nikon_AFMode}, { N_("Auto Focus Mode 2"), "autofocusmode2", PTP_DPC_NIKON_A4AFActivation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, { N_("Zoom"), "zoom", PTP_DPC_CANON_Zoom, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_ZoomRange, _put_Canon_ZoomRange}, { N_("Assist Light"), "assistlight", PTP_DPC_CANON_AssistLight, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_AssistLight, _put_Canon_AssistLight}, Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-12-15 20:56:59 UTC (rev 11623) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-12-15 21:03:17 UTC (rev 11624) @@ -1591,6 +1591,7 @@ if (nevent[i].code == 0xc101) { hasc101=1; newobject = nevent[i].param1; + if (!newobject) newobject = 0xffff0001; } } free (nevent); Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-15 20:56:59 UTC (rev 11623) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-15 21:03:17 UTC (rev 11624) @@ -3718,10 +3718,11 @@ {PTP_DPC_StillCaptureMode, PTP_VENDOR_NIKON, 32787, N_("Remote")}, {PTP_DPC_StillCaptureMode, PTP_VENDOR_NIKON, 32787, N_("Mirror Up")}, {PTP_DPC_StillCaptureMode, PTP_VENDOR_NIKON, 32788, N_("Timer + Remote")}, - PTP_VENDOR_VAL_BOOL(PTP_DPC_NIKON_AutofocusMode,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_NIKON_AFAssist,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_NIKON_ImageReview,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_BOOL(PTP_DPC_NIKON_GridDisplay,PTP_VENDOR_NIKON), + {PTP_DPC_NIKON_AutofocusMode, PTP_VENDOR_NIKON, 0, N_("AF-S")}, + {PTP_DPC_NIKON_AutofocusMode, PTP_VENDOR_NIKON, 1, N_("AF-C")}, {PTP_DPC_NIKON_AFAreaIllumination, PTP_VENDOR_NIKON, 0, N_("Auto")}, {PTP_DPC_NIKON_AFAreaIllumination, PTP_VENDOR_NIKON, 1, N_("Off")}, {PTP_DPC_NIKON_AFAreaIllumination, PTP_VENDOR_NIKON, 2, N_("On")}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-12-20 23:07:15
|
Revision: 11631 http://gphoto.svn.sourceforge.net/gphoto/?rev=11631&view=rev Author: marcusmeissner Date: 2008-12-20 23:07:11 +0000 (Sat, 20 Dec 2008) Log Message: ----------- more canon and nikon property handling/querying Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/library.c trunk/libgphoto2/camlibs/ptp2/ptp.c Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-12-20 23:03:39 UTC (rev 11630) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-12-20 23:07:11 UTC (rev 11631) @@ -1,3 +1,8 @@ +2008-12-21 Marcus Meissner <ma...@je...> + + * library.c: Handle CR2 in Canon ObjectAdd events + * ptp.c, config.c: More Nikon property handling + 2008-12-14 Marcus Meissner <ma...@je...> * ptp.h: Found some Nikon property ids. Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-20 23:03:39 UTC (rev 11630) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-20 23:07:11 UTC (rev 11631) @@ -1420,7 +1420,39 @@ }; GENERIC8TABLE(Nikon_ColorModel,nikon_colormodel) +static struct deviceproptableu8 nikon_padvpvalue[] = { + { "1/125", 0x00, 0 }, + { "1/60", 0x01, 0 }, + { "1/30", 0x02, 0 }, + { "1/15", 0x03, 0 }, + { "1/8", 0x04, 0 }, + { "1/4", 0x05, 0 }, + { "1/2", 0x06, 0 }, + { "1", 0x07, 0 }, + { "2", 0x08, 0 }, + { "4", 0x09, 0 }, + { "8", 0x0a, 0 }, + { "15", 0x0b, 0 }, + { "30", 0x0c, 0 }, +}; +GENERIC8TABLE(Nikon_PADVPValue,nikon_padvpvalue) +static struct deviceproptableu8 nikon_orientation[] = { + { "0'", 0, 0 }, + { "270'", 1, 0 }, + { "90'", 2, 0 }, + { "180'", 3, 0 }, +}; +GENERIC8TABLE(Nikon_CameraOrientation,nikon_orientation) + +static struct deviceproptableu16 canon_orientation[] = { + { "0'", 0, 0 }, + { "90'", 1, 0 }, + { "180'", 2, 0 }, /* guessed */ + { "270'", 3, 0 }, +}; +GENERIC16TABLE(Canon_CameraOrientation,canon_orientation) + static struct deviceproptableu8 nikon_afsensor[] = { { N_("Centre"), 0x00, 0 }, { N_("Top"), 0x01, 0 }, @@ -2709,6 +2741,8 @@ { N_("CSM Menu"), "csmmenu", PTP_DPC_NIKON_CSMMenu, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8 }, { N_("Battery Level"), "battery", PTP_DPC_BatteryLevel, 0, PTP_DTC_UINT8, _get_BatteryLevel, _put_None }, { N_("Camera Output"), "output", PTP_DPC_CANON_CameraOutput, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_CameraOutput, _put_Canon_CameraOutput }, + { N_("Camera Orientation"), "orientation", PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_CameraOrientation, _put_None }, + { N_("Camera Orientation"), "orientation", PTP_DPC_CANON_RotationAngle, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_CameraOrientation, _put_None }, /* virtual */ { N_("Fast Filesystem"), "fastfs", 0, PTP_VENDOR_NIKON, 0, _get_Nikon_FastFS, _put_Nikon_FastFS }, @@ -2734,6 +2768,7 @@ { N_("Photo Effect"), "photoeffect", PTP_DPC_CANON_PhotoEffect, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_PhotoEffect, _put_Canon_PhotoEffect}, { N_("Color Model"), "colormodel", PTP_DPC_NIKON_ColorModel, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_ColorModel, _put_Nikon_ColorModel}, { N_("Auto ISO"), "autoiso", PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, + { N_("Auto ISO PADV Time"), "autoisopadv", PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_PADVPValue, _put_Nikon_PADVPValue}, { 0,0,0,0,0,0,0 }, }; Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2008-12-20 23:03:39 UTC (rev 11630) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2008-12-20 23:07:11 UTC (rev 11631) @@ -520,7 +520,7 @@ /* Peter F Bradshaw <pf...@ex...> */ {"Kodak:C813", 0x040a, 0x05c3, 0}, /* reported by Christian Le Corre <lec...@gm...> */ - {"Kodak:C913", 0x040a, 0x05c6, 0}, + {"Kodak:C913", 0x040a, 0x05c6, 0}, /* HP PTP cameras */ #if 0 Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-20 23:03:39 UTC (rev 11630) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-20 23:07:11 UTC (rev 11631) @@ -3801,9 +3801,27 @@ {PTP_DPC_NIKON_MonitorOff, PTP_VENDOR_NIKON, 5, N_("5 seconds")}, /* d80 observed */ PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_LowLight,PTP_VENDOR_NIKON), + PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_AFLockStatus,PTP_VENDOR_NIKON), + PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_AELockStatus,PTP_VENDOR_NIKON), + PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_FVLockStatus,PTP_VENDOR_NIKON), + PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_ACPower,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_YN(PTP_DPC_NIKON_CSMMenu,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_NIKON_BeepOff,PTP_VENDOR_NIKON), + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 0, "1/125"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 1, "1/60"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 2, "1/30"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 3, "1/15"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 4, "1/8"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 5, "1/4"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 6, "1/2"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 7, "1"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 8, "2"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 9, "4"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 10, "8"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 11, "15"}, + {PTP_DPC_NIKON_ISOAuto, PTP_VENDOR_NIKON, 12, "30"}, + {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 0, "0'"}, {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 1, "270'"}, {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 2, "90'"}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-12-21 19:00:57
|
Revision: 11634 http://gphoto.svn.sourceforge.net/gphoto/?rev=11634&view=rev Author: marcusmeissner Date: 2008-12-21 18:58:10 +0000 (Sun, 21 Dec 2008) Log Message: ----------- added more nikon properties Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ChangeLog trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ChangeLog =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-12-21 18:53:18 UTC (rev 11633) +++ trunk/libgphoto2/camlibs/ptp2/ChangeLog 2008-12-21 18:58:10 UTC (rev 11634) @@ -1,3 +1,7 @@ +2008-12-22 Marcus Meissner <ma...@je...> + + * library.c,ptp.c,ptp.h: Added more Nikon properties. + 2008-12-21 Marcus Meissner <ma...@je...> * library.c: Handle CR2 in Canon ObjectAdd events Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-21 18:53:18 UTC (rev 11633) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-21 18:58:10 UTC (rev 11634) @@ -52,6 +52,12 @@ #include "ptp-bugs.h" #include "ptp-private.h" +#ifdef __GNUC__ +# define __unused__ __attribute__((unused)) +#else +# define __unused__ +#endif + #define GP_MODULE "PTP2" #define CPR(context,result) {short r=(result); if (r!=PTP_RC_OK) {report_result ((context), r, params->deviceinfo.VendorExtensionID); return (translate_ptp_result (r));}} @@ -519,7 +525,7 @@ ); \ } \ \ -static int \ +static int __unused__ \ _put_##name(CONFIG_PUT_ARGS) { \ return _put_Generic16Table(CONFIG_PUT_NAMES, \ tbl,sizeof(tbl)/sizeof(tbl[0]) \ @@ -625,7 +631,7 @@ ); \ } \ \ -static int \ +static int __unused__ \ _put_##name(CONFIG_PUT_ARGS) { \ return _put_Generic8Table(CONFIG_PUT_NAMES, \ tbl,sizeof(tbl)/sizeof(tbl[0]) \ @@ -954,6 +960,50 @@ } static int +_get_Nikon_WBBiasPresetVal(CONFIG_GET_ARGS) { + char buf[20]; + + if (dpd->DataType != PTP_DTC_UINT32) + return (GP_ERROR); + gp_widget_new (GP_WIDGET_TEXT, _(menu->label), widget); + gp_widget_set_name (*widget,menu->name); + sprintf (buf, "%d", dpd->CurrentValue.u32); + gp_widget_set_value (*widget, buf); + return (GP_OK); +} +static int +_get_Nikon_WBBiasPreset(CONFIG_GET_ARGS) { + char buf[20]; + int i; + + if (dpd->DataType != PTP_DTC_UINT8) + return (GP_ERROR); + if (!(dpd->FormFlag & PTP_DPFF_Range)) + return (GP_ERROR); + gp_widget_new (GP_WIDGET_RADIO, _(menu->label), widget); + gp_widget_set_name (*widget,menu->name); + for (i = dpd->FORM.Range.MinimumValue.u8; i < dpd->FORM.Range.MaximumValue.u8; i++) { + sprintf (buf, "%d", i); + gp_widget_add_choice (*widget, buf); + if (dpd->FORM.Enum.SupportedValue[i].u8 == dpd->CurrentValue.u8) + gp_widget_set_value (*widget, buf); + } + return (GP_OK); +} + +static int +_put_Nikon_WBBiasPreset(CONFIG_PUT_ARGS) { + int ret; + char *x; + + ret = gp_widget_get_value (widget,&x); + if (ret != GP_OK) return ret; + sscanf (x, "%u", &ret); + propval->u8 = ret; + return (GP_OK); +} + +static int _get_Nikon_HueAdjustment(CONFIG_GET_ARGS) { float f, t, b, s; @@ -1562,6 +1612,46 @@ } static int +_get_Nikon_FocalLength(CONFIG_GET_ARGS) { + char len[20]; + + gp_widget_new (GP_WIDGET_TEXT, _(menu->label), widget); + gp_widget_set_name (*widget, menu->name); + if (dpd->DataType != PTP_DTC_UINT32) + return (GP_ERROR); + sprintf (len, "%.0f mm", dpd->CurrentValue.u32 * 0.01); + gp_widget_set_value (*widget, len); + return (GP_OK); +} + +static int +_get_Nikon_ApertureAtFocalLength(CONFIG_GET_ARGS) { + char len[20]; + + gp_widget_new (GP_WIDGET_TEXT, _(menu->label), widget); + gp_widget_set_name (*widget, menu->name); + if (dpd->DataType != PTP_DTC_UINT16) + return (GP_ERROR); + sprintf (len, "%.0f mm", dpd->CurrentValue.u16 * 0.01); + gp_widget_set_value (*widget, len); + return (GP_OK); +} + +static int +_get_Nikon_LightMeter(CONFIG_GET_ARGS) { + char meter[20]; + + gp_widget_new (GP_WIDGET_TEXT, _(menu->label), widget); + gp_widget_set_name (*widget, menu->name); + if (dpd->DataType != PTP_DTC_INT8) + return (GP_ERROR); + sprintf (meter, "%.1f", dpd->CurrentValue.i8 * 0.08333); + gp_widget_set_value (*widget, meter); + return (GP_OK); +} + + +static int _get_Nikon_FlashExposureCompensation(CONFIG_GET_ARGS) { float value_float; @@ -1667,8 +1757,8 @@ { N_("6 mm"), 0x00, 0 }, { N_("8 mm"), 0x01, 0 }, { N_("10 mm"), 0x02, 0 }, - { N_("20 mm"), 0x03, 0 }, - { N_("Average"),0x04, 0 }, + { N_("12 mm"), 0x03, 0 }, + { N_("Average"),0x04, 0 }, /* ? */ }; GENERIC8TABLE(Nikon_CenterWeight,nikon_centerweight) @@ -1929,6 +2019,19 @@ }; GENERIC8TABLE(Nikon_BracketOrder,nikon_bracketorder) +/* There is a table for it in the internet */ +static struct deviceproptableu8 nikon_lensid[] = { + {N_("Unknown"), 0, 0}, + {"Sigma 70-300mm 1:4-5.6 D APO Macro", 38, 0}, + {"AF Nikkor 80-200mm 1:2.8 D ED", 83, 0}, + {"AF Nikkor 50mm 1:1.8 D", 118, 0}, + {"AF-S Nikkor 18-70mm 1:3.5-4.5G ED DX", 127, 0}, + {"AF-S Nikkor 18-200mm 1:3.5-5.6 GED DX VR", 139, 0}, + {"AF-S Nikkor 24-70mm 1:2.8G ED DX", 147, 0}, + {"AF-S Nikkor 18-55mm 1:3.5-F5.6G DX VR", 154, 0}, +}; +GENERIC8TABLE(Nikon_LensID,nikon_lensid) + static int _get_BurstNumber(CONFIG_GET_ARGS) { float value_float , start=0.0, end=0.0, step=0.0; @@ -2736,13 +2839,20 @@ { N_("Camera Time"), "time", PTP_DPC_DateTime, 0, PTP_DTC_STR, _get_STR_as_time, _put_STR_as_time }, { N_("Beep Mode"), "beep", PTP_DPC_CANON_BeepMode, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_BeepMode, _put_Canon_BeepMode }, { N_("Image Comment"), "imgcomment", PTP_DPC_NIKON_ImageCommentString, PTP_VENDOR_NIKON, PTP_DTC_STR, _get_STR, _put_STR }, + { N_("Enable Image Comment"), "imgcommentenable", PTP_DPC_NIKON_ImageCommentEnable, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8 }, { N_("LCD Off Time"), "lcdofftime", PTP_DPC_NIKON_MonitorOff, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_LCDOffTime, _put_Nikon_LCDOffTime }, { N_("Meter Off Time"), "meterofftime", PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_MeterOffTime, _put_Nikon_MeterOffTime }, { N_("CSM Menu"), "csmmenu", PTP_DPC_NIKON_CSMMenu, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8 }, + { N_("Reverse Command Dial"), "reversedial", PTP_DPC_NIKON_ReverseCommandDial, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8 }, { N_("Battery Level"), "battery", PTP_DPC_BatteryLevel, 0, PTP_DTC_UINT8, _get_BatteryLevel, _put_None }, { N_("Camera Output"), "output", PTP_DPC_CANON_CameraOutput, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_CameraOutput, _put_Canon_CameraOutput }, { N_("Camera Orientation"), "orientation", PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_CameraOrientation, _put_None }, { N_("Camera Orientation"), "orientation", PTP_DPC_CANON_RotationAngle, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_CameraOrientation, _put_None }, + { N_("AC Power"), "acpower", PTP_DPC_NIKON_ACPower, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_None }, + { N_("External Flash"), "externalflash", PTP_DPC_NIKON_ExternalFlashAttached, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_None }, + { N_("Flash Open"), "flashopen", PTP_DPC_NIKON_FlashOpen, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_None }, + { N_("Flash Charged"), "flashcharged", PTP_DPC_NIKON_FlashCharged, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_None }, + { N_("Lens ID"), "lensid", PTP_DPC_NIKON_LensID, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_LensID, _put_None }, /* virtual */ { N_("Fast Filesystem"), "fastfs", 0, PTP_VENDOR_NIKON, 0, _get_Nikon_FastFS, _put_Nikon_FastFS }, @@ -2782,6 +2892,7 @@ { N_("Self Timer"), "selftimer", PTP_DPC_CANON_SelfTime, PTP_VENDOR_CANON, PTP_DTC_UINT16, _get_Canon_SelfTimer, _put_Canon_SelfTimer}, { N_("Assist Light"), "assistlight", PTP_DPC_NIKON_AFAssist, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, { N_("Exposure Compensation"), "exposurecompensation", PTP_DPC_CANON_ExpCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation, _put_Canon_ExpCompensation}, + { N_("Exposure Compensation"), "exposurecompensation", PTP_DPC_NIKON_ExposureCompensation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, { N_("Flash Compensation"), "flashcompensation", PTP_DPC_CANON_FlashCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation, _put_Canon_ExpCompensation}, { N_("AEB Exposure Compensation"), "aebexpcompensation", PTP_DPC_CANON_AEBExposureCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation, _put_Canon_ExpCompensation}, { N_("EOS Exposure Compensation"), "eos-exposurecompensation", PTP_DPC_CANON_EOS_ExpCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation2, _put_Canon_ExpCompensation2}, @@ -2791,6 +2902,10 @@ { N_("AF Beep Mode"), "afbeep", PTP_DPC_NIKON_BeepOff, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_BeepMode, _put_Nikon_BeepMode}, { N_("F-Number"), "f-number", PTP_DPC_FNumber, 0, PTP_DTC_UINT16, _get_FNumber, _put_FNumber}, { N_("Focal Length"), "focallength", PTP_DPC_FocalLength, 0, PTP_DTC_UINT32, _get_FocalLength, _put_FocalLength}, + { N_("Focal Length Minimum"), "minfocallength", PTP_DPC_NIKON_FocalLengthMin, PTP_VENDOR_NIKON, PTP_DTC_UINT32, _get_Nikon_FocalLength, _put_None}, + { N_("Focal Length Maximum"), "maxfocallength", PTP_DPC_NIKON_FocalLengthMax, PTP_VENDOR_NIKON, PTP_DTC_UINT32, _get_Nikon_FocalLength, _put_None}, + { N_("Maximum Aperture at Focal Length Minimum"), "apertureatminfocallength", PTP_DPC_NIKON_MaxApAtMinFocalLength, PTP_VENDOR_NIKON, PTP_DTC_UINT16, _get_Nikon_ApertureAtFocalLength, _put_None}, + { N_("Maximum Aperture at Focal Length Maximum"), "apertureatmaxfocallength", PTP_DPC_NIKON_MaxApAtMaxFocalLength, PTP_VENDOR_NIKON, PTP_DTC_UINT16, _get_Nikon_ApertureAtFocalLength, _put_None}, { N_("Focus Mode"), "focusmode", PTP_DPC_FocusMode, 0, PTP_DTC_UINT16, _get_FocusMode, _put_FocusMode}, { N_("Exposure Bias Compensation"), "exposurebiascompensation", PTP_DPC_ExposureBiasCompensation, 0, PTP_DTC_INT16, _get_ExpCompensation, _put_ExpCompensation}, { N_("Exposure Time"), "exptime", PTP_DPC_ExposureTime, 0, PTP_DTC_UINT32, _get_ExpTime, _put_ExpTime}, @@ -2823,6 +2938,7 @@ { N_("Flash Mode Manual Power"), "flashmodemanualpower", PTP_DPC_NIKON_FlashModeManualPower, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashModeManualPower, _put_Nikon_FlashModeManualPower}, { N_("Auto Focus Area"), "autofocusarea", PTP_DPC_NIKON_AutofocusArea, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_AutofocusArea, _put_Nikon_AutofocusArea}, { N_("Flash Exposure Compensation"), "flashexposurecompensation", PTP_DPC_NIKON_FlashExposureCompensation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashExposureCompensation, _put_Nikon_FlashExposureCompensation}, + { N_("Bracketing"), "bracketing", PTP_DPC_NIKON_Bracketing, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, { N_("Bracket Set"), "bracketset", PTP_DPC_NIKON_BracketSet, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_BracketSet, _put_Nikon_BracketSet}, { N_("Bracket Order"), "bracketorder", PTP_DPC_NIKON_BracketOrder, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_BracketOrder, _put_Nikon_BracketOrder}, { N_("Burst Number"), "burstnumber", PTP_DPC_BurstNumber, 0, PTP_DTC_UINT16, _get_BurstNumber, _put_BurstNumber}, @@ -2833,6 +2949,12 @@ { N_("Flash White Balance Bias"), "flashwhitebias", PTP_DPC_NIKON_WhiteBalanceFlashBias, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_WBBias, _put_Nikon_WBBias}, { N_("Cloudy White Balance Bias"), "cloudywhitebias", PTP_DPC_NIKON_WhiteBalanceCloudyBias, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_WBBias, _put_Nikon_WBBias}, { N_("Shady White Balance Bias"), "shadewhitebias", PTP_DPC_NIKON_WhiteBalanceShadeBias, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_WBBias, _put_Nikon_WBBias}, + { N_("White Balance Bias Preset Nr"), "whitebiaspresetno", PTP_DPC_NIKON_WhiteBalancePresetNo, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_WBBiasPreset, _put_Nikon_WBBiasPreset}, + { N_("White Balance Bias Preset 0"), "whitebiaspreset0", PTP_DPC_NIKON_WhiteBalancePresetVal0, PTP_VENDOR_NIKON, PTP_DTC_UINT32, _get_Nikon_WBBiasPresetVal, _put_None}, + { N_("White Balance Bias Preset 1"), "whitebiaspreset1", PTP_DPC_NIKON_WhiteBalancePresetVal1, PTP_VENDOR_NIKON, PTP_DTC_UINT32, _get_Nikon_WBBiasPresetVal, _put_None}, + { N_("White Balance Bias Preset 2"), "whitebiaspreset2", PTP_DPC_NIKON_WhiteBalancePresetVal2, PTP_VENDOR_NIKON, PTP_DTC_UINT32, _get_Nikon_WBBiasPresetVal, _put_None}, + { N_("White Balance Bias Preset 3"), "whitebiaspreset3", PTP_DPC_NIKON_WhiteBalancePresetVal3, PTP_VENDOR_NIKON, PTP_DTC_UINT32, _get_Nikon_WBBiasPresetVal, _put_None}, + { N_("White Balance Bias Preset 4"), "whitebiaspreset4", PTP_DPC_NIKON_WhiteBalancePresetVal4, PTP_VENDOR_NIKON, PTP_DTC_UINT32, _get_Nikon_WBBiasPresetVal, _put_None}, { N_("Selftimer Delay"), "selftimerdelay", PTP_DPC_NIKON_SelfTimer, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_SelfTimerDelay, _put_Nikon_SelfTimerDelay }, { N_("Center Weight Area"), "centerweightsize", PTP_DPC_NIKON_CenterWeightArea, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_CenterWeight, _put_Nikon_CenterWeight }, { N_("Flash Shutter Speed"), "flashshutterspeed", PTP_DPC_NIKON_FlashShutterSpeed, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashShutterSpeed, _put_Nikon_FlashShutterSpeed }, @@ -2843,7 +2965,11 @@ { N_("Saturation"), "saturation", PTP_DPC_NIKON_Saturation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_Saturation, _put_Nikon_Saturation }, { N_("Hue Adjustment"), "hueadjustment", PTP_DPC_NIKON_HueAdjustment, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_HueAdjustment, _put_Nikon_HueAdjustment }, - { N_("Low Light"), "lowlight", PTP_DPC_NIKON_LowLight, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_LowLight, _put_None }, + { N_("Low Light"), "lowlight", PTP_DPC_NIKON_LowLight, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_LowLight, _put_None }, + { N_("Light Meter"), "lightmeter", PTP_DPC_NIKON_LightMeter, PTP_VENDOR_NIKON, PTP_DTC_INT8, _get_Nikon_LightMeter, _put_None }, + { N_("AF Locked"), "aflocked", PTP_DPC_NIKON_AFLockStatus, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_None }, + { N_("AE Locked"), "aelocked", PTP_DPC_NIKON_AELockStatus, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_None }, + { N_("FV Locked"), "fvlocked", PTP_DPC_NIKON_FVLockStatus, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_None }, /* { N_("Viewfinder Mode"), "viewfinder", PTP_DPC_CANON_ViewFinderMode, PTP_VENDOR_CANON, PTP_DTC_UINT32, _get_Canon_ViewFinderMode, _put_Canon_ViewFinderMode}, */ { N_("Focus Lock"), "focuslock", 0, PTP_VENDOR_CANON, 0, _get_Canon_FocusLock, _put_Canon_FocusLock}, @@ -2963,7 +3089,12 @@ memset(&dpd,0,sizeof(dpd)); ptp_getdevicepropdesc(&camera->pl->params,cursub->propid,&dpd); - ret = cursub->putfunc (camera, widget, &propval, &dpd); + if (dpd.GetSet == PTP_DPGS_GetSet) { + ret = cursub->putfunc (camera, widget, &propval, &dpd); + } else { + gp_context_error (context, _("Sorry, the property '%s' is currently ready-only."), _(cursub->label)); + ret = GP_ERROR_NOT_SUPPORTED; + } if (ret == GP_OK) ptp_setdevicepropvalue (&camera->pl->params, cursub->propid, &propval, cursub->type); ptp_free_devicepropvalue (cursub->type, &propval); Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-21 18:53:18 UTC (rev 11633) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-21 18:58:10 UTC (rev 11634) @@ -3301,11 +3301,17 @@ {PTP_DPC_NIKON_WhiteBalanceColorTemperature, /* 0xD01e */ N_("White Balance Colour Temperature")}, {PTP_DPC_NIKON_WhiteBalancePresetNo, /* 0xD01f */ - N_("White Balance Present Number")}, + N_("White Balance Preset Number")}, {PTP_DPC_NIKON_WhiteBalancePresetVal0, /* 0xD025 */ - N_("White Balance Present Value 0")}, + N_("White Balance Preset Value 0")}, {PTP_DPC_NIKON_WhiteBalancePresetVal1, /* 0xD026 */ - N_("White Balance Present Value 1")}, + N_("White Balance Preset Value 1")}, + {PTP_DPC_NIKON_WhiteBalancePresetVal2, /* 0xD027 */ + N_("White Balance Preset Value 2")}, + {PTP_DPC_NIKON_WhiteBalancePresetVal3, /* 0xD028 */ + N_("White Balance Preset Value 3")}, + {PTP_DPC_NIKON_WhiteBalancePresetVal4, /* 0xD029 */ + N_("White Balance Preset Value 4")}, {PTP_DPC_NIKON_ImageSharpening, /* 0xD02a */ N_("Sharpening")}, {PTP_DPC_NIKON_ToneCompensation, /* 0xD02b */ @@ -3676,11 +3682,11 @@ {PTP_DPC_WhiteBalance, PTP_VENDOR_NIKON, 32785, N_("Shade")}, {PTP_DPC_WhiteBalance, PTP_VENDOR_NIKON, 32786, N_("Color Temperature")}, {PTP_DPC_WhiteBalance, PTP_VENDOR_NIKON, 32787, N_("Preset")}, + {PTP_DPC_FlashMode, 0, 4, N_("Red-eye Reduction")}, {PTP_DPC_FlashMode, PTP_VENDOR_NIKON, 32784, N_("Default")}, - {PTP_DPC_FlashMode, 0, 4, N_("Red-eye Reduction")}, + {PTP_DPC_FlashMode, PTP_VENDOR_NIKON, 32785, N_("Slow Sync")}, + {PTP_DPC_FlashMode, PTP_VENDOR_NIKON, 32786, N_("Rear Curtain Sync + Slow Sync")}, {PTP_DPC_FlashMode, PTP_VENDOR_NIKON, 32787, N_("Red-eye Reduction + Slow Sync")}, - {PTP_DPC_FlashMode, PTP_VENDOR_NIKON, 32785, N_("Slow Sync")}, - {PTP_DPC_FlashMode, PTP_VENDOR_NIKON, 32785, N_("Rear Curtain Sync + Slow Sync")}, {PTP_DPC_FocusMeteringMode, 0, 2, N_("Dynamic Area")}, {PTP_DPC_FocusMeteringMode, PTP_VENDOR_NIKON, 32784, N_("Single Area")}, {PTP_DPC_FocusMeteringMode, PTP_VENDOR_NIKON, 32785, N_("Closest Subject")}, @@ -3750,6 +3756,7 @@ PTP_VENDOR_VAL_RBOOL(PTP_DPC_NIKON_NoCFCard,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_NIKON_ImageRotation,PTP_VENDOR_NIKON), PTP_VENDOR_VAL_BOOL(PTP_DPC_NIKON_Bracketing,PTP_VENDOR_NIKON), + PTP_VENDOR_VAL_BOOL(PTP_DPC_NIKON_ImageCommentEnable,PTP_VENDOR_NIKON), {PTP_DPC_NIKON_AutofocusArea, PTP_VENDOR_NIKON, 0, N_("Centre")}, {PTP_DPC_NIKON_AutofocusArea, PTP_VENDOR_NIKON, 1, N_("Top")}, {PTP_DPC_NIKON_AutofocusArea, PTP_VENDOR_NIKON, 2, N_("Bottom")}, @@ -3827,6 +3834,26 @@ {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 2, "90'"}, {PTP_DPC_NIKON_CameraOrientation, PTP_VENDOR_NIKON, 3, "180'"}, + {PTP_DPC_NIKON_SelfTimer, PTP_VENDOR_NIKON, 0, N_("2 seconds")}, + {PTP_DPC_NIKON_SelfTimer, PTP_VENDOR_NIKON, 1, N_("5 seconds")}, + {PTP_DPC_NIKON_SelfTimer, PTP_VENDOR_NIKON, 2, N_("10 seconds")}, + {PTP_DPC_NIKON_SelfTimer, PTP_VENDOR_NIKON, 3, N_("20 seconds")}, + + {PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, 0, N_("4 seconds")}, + {PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, 1, N_("6 seconds")}, + {PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, 2, N_("8 seconds")}, + {PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, 3, N_("16 seconds")}, + {PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, 4, N_("30 minutes")}, + {PTP_DPC_NIKON_MeterOff, PTP_VENDOR_NIKON, 5, N_("30 seconds")}, + + {PTP_DPC_NIKON_BracketSet, PTP_VENDOR_NIKON, 0, N_("AE & Flash")}, + {PTP_DPC_NIKON_BracketSet, PTP_VENDOR_NIKON, 1, N_("AE only")}, + {PTP_DPC_NIKON_BracketSet, PTP_VENDOR_NIKON, 2, N_("Flash only")}, + {PTP_DPC_NIKON_BracketSet, PTP_VENDOR_NIKON, 3, N_("WB bracketing")}, + + {PTP_DPC_NIKON_BracketOrder, PTP_VENDOR_NIKON, 0, N_("MTR > Under")}, + {PTP_DPC_NIKON_BracketOrder, PTP_VENDOR_NIKON, 1, N_("Under > MTR")}, + /* Canon stuff */ PTP_VENDOR_VAL_BOOL(PTP_DPC_CANON_AssistLight,PTP_VENDOR_CANON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_CANON_RotationScene,PTP_VENDOR_CANON), Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-12-21 18:53:18 UTC (rev 11633) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2008-12-21 18:58:10 UTC (rev 11634) @@ -1191,6 +1191,9 @@ #define PTP_DPC_NIKON_WhiteBalancePresetNo 0xD01F #define PTP_DPC_NIKON_WhiteBalancePresetVal0 0xD025 #define PTP_DPC_NIKON_WhiteBalancePresetVal1 0xD026 +#define PTP_DPC_NIKON_WhiteBalancePresetVal2 0xD027 +#define PTP_DPC_NIKON_WhiteBalancePresetVal3 0xD028 +#define PTP_DPC_NIKON_WhiteBalancePresetVal4 0xD029 #define PTP_DPC_NIKON_ImageSharpening 0xD02A #define PTP_DPC_NIKON_ToneCompensation 0xD02B #define PTP_DPC_NIKON_ColorModel 0xD02C This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-12-27 13:28:44
|
Revision: 11643 http://gphoto.svn.sourceforge.net/gphoto/?rev=11643&view=rev Author: marcusmeissner Date: 2008-12-27 13:28:35 +0000 (Sat, 27 Dec 2008) Log Message: ----------- more nikon config vars Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/config.c trunk/libgphoto2/camlibs/ptp2/ptp.c Modified: trunk/libgphoto2/camlibs/ptp2/config.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-27 13:27:09 UTC (rev 11642) +++ trunk/libgphoto2/camlibs/ptp2/config.c 2008-12-27 13:28:35 UTC (rev 11643) @@ -1118,6 +1118,25 @@ }; GENERIC8TABLE(Nikon_FlashMode,nikon_flashmode) +static struct deviceproptableu8 nikon_flashcommandermode[] = { + { N_("TTL"), 0, 0 }, + { N_("Auto Aperture"), 1, 0 }, + { N_("Full Manual"), 2, 0 }, +}; +GENERIC8TABLE(Nikon_FlashCommanderMode,nikon_flashcommandermode) + +static struct deviceproptableu8 nikon_flashcommanderpower[] = { + { N_("Full"), 0, 0 }, + { "1/2", 1, 0 }, + { "1/4", 2, 0 }, + { "1/8", 3, 0 }, + { "1/16", 4, 0 }, + { "1/32", 5, 0 }, + { "1/64", 6, 0 }, + { "1/128", 7, 0 }, +}; +GENERIC8TABLE(Nikon_FlashCommanderPower,nikon_flashcommanderpower) + static struct deviceproptableu8 nikon_afmode[] = { { N_("AF-S"), 0, 0 }, { N_("AF-C"), 1, 0 }, @@ -1487,6 +1506,12 @@ }; GENERIC8TABLE(Nikon_PADVPValue,nikon_padvpvalue) +static struct deviceproptableu8 nikon_evstep[] = { + { "1/3", 0, 0 }, + { "1/2", 1, 0 }, +}; +GENERIC8TABLE(Nikon_EVStep,nikon_evstep) + static struct deviceproptableu8 nikon_orientation[] = { { "0'", 0, 0 }, { "270'", 1, 0 }, @@ -2898,6 +2923,8 @@ { N_("EOS Exposure Compensation"), "eos-exposurecompensation", PTP_DPC_CANON_EOS_ExpCompensation, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_ExpCompensation2, _put_Canon_ExpCompensation2}, { N_("Flash Mode"), "canonflashmode", PTP_DPC_CANON_FlashMode, PTP_VENDOR_CANON, PTP_DTC_UINT8, _get_Canon_FlashMode, _put_Canon_FlashMode}, { N_("Flash Mode"), "nikonflashmode", PTP_DPC_NIKON_FlashMode, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashMode, _put_Nikon_FlashMode}, + { N_("Flash Commander Mode"), "nikonflashcommandermode", PTP_DPC_NIKON_FlashCommanderMode, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashCommanderMode, _put_Nikon_FlashCommanderMode}, + { N_("Flash Commander Power"), "nikonflashcommanderpower", PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashCommanderPower, _put_Nikon_FlashCommanderPower}, { N_("AF Area Illumination"), "af-area-illumination", PTP_DPC_NIKON_AFAreaIllumination, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_AFAreaIllum, _put_Nikon_AFAreaIllum}, { N_("AF Beep Mode"), "afbeep", PTP_DPC_NIKON_BeepOff, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_BeepMode, _put_Nikon_BeepMode}, { N_("F-Number"), "f-number", PTP_DPC_FNumber, 0, PTP_DTC_UINT16, _get_FNumber, _put_FNumber}, @@ -2939,6 +2966,7 @@ { N_("Auto Focus Area"), "autofocusarea", PTP_DPC_NIKON_AutofocusArea, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_AutofocusArea, _put_Nikon_AutofocusArea}, { N_("Flash Exposure Compensation"), "flashexposurecompensation", PTP_DPC_NIKON_FlashExposureCompensation, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_FlashExposureCompensation, _put_Nikon_FlashExposureCompensation}, { N_("Bracketing"), "bracketing", PTP_DPC_NIKON_Bracketing, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_OnOff_UINT8, _put_Nikon_OnOff_UINT8}, + { N_("EV Step"), "evstep", PTP_DPC_NIKON_EVStep, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_EVStep, _put_Nikon_EVStep}, { N_("Bracket Set"), "bracketset", PTP_DPC_NIKON_BracketSet, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_BracketSet, _put_Nikon_BracketSet}, { N_("Bracket Order"), "bracketorder", PTP_DPC_NIKON_BracketOrder, PTP_VENDOR_NIKON, PTP_DTC_UINT8, _get_Nikon_BracketOrder, _put_Nikon_BracketOrder}, { N_("Burst Number"), "burstnumber", PTP_DPC_BurstNumber, 0, PTP_DTC_UINT16, _get_BurstNumber, _put_BurstNumber}, Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-27 13:27:09 UTC (rev 11642) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2008-12-27 13:28:35 UTC (rev 11643) @@ -3657,6 +3657,7 @@ {PTP_DPC_NIKON_FocalLengthMax, PTP_VENDOR_NIKON, 0.01, 0.0, "%.0f mm"}, {PTP_DPC_NIKON_MaxApAtMinFocalLength, PTP_VENDOR_NIKON, 0.01, 0.0, "f/%.2g"}, {PTP_DPC_NIKON_MaxApAtMaxFocalLength, PTP_VENDOR_NIKON, 0.01, 0.0, "f/%.2g"}, + {PTP_DPC_NIKON_ExternalFlashCompensation, PTP_VENDOR_NIKON, 1.0/6.0, 0.0,"%.0f"}, {0, 0, 0.0, 0.0, NULL} }; @@ -3854,6 +3855,36 @@ {PTP_DPC_NIKON_BracketOrder, PTP_VENDOR_NIKON, 0, N_("MTR > Under")}, {PTP_DPC_NIKON_BracketOrder, PTP_VENDOR_NIKON, 1, N_("Under > MTR")}, + {PTP_DPC_NIKON_FlashCommanderMode, PTP_VENDOR_NIKON, 0, N_("TTL")}, + {PTP_DPC_NIKON_FlashCommanderMode, PTP_VENDOR_NIKON, 1, N_("Auto Aperture")}, + {PTP_DPC_NIKON_FlashCommanderMode, PTP_VENDOR_NIKON, 2, N_("Full Manual")}, + + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 0, N_("Full")}, + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 1, "1/2"}, + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 2, "1/4"}, + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 3, "1/8"}, + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 4, "1/16"}, + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 5, "1/32"}, + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 6, "1/64"}, + {PTP_DPC_NIKON_FlashModeCommanderPower, PTP_VENDOR_NIKON, 7, "1/128"}, + + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 0, "1/125"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 1, "1/60"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 2, "1/30"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 3, "1/15"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 4, "1/8"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 5, "1/4"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 6, "1/2"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 7, "1"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 8, "2"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 9, "4"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 10, "8"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 11, "15"}, + {PTP_DPC_NIKON_PADVPMode, PTP_VENDOR_NIKON, 12, "30"}, + + {PTP_DPC_NIKON_EVStep, PTP_VENDOR_NIKON, 0, "1/3"}, + {PTP_DPC_NIKON_EVStep, PTP_VENDOR_NIKON, 1, "1/2"}, + /* Canon stuff */ PTP_VENDOR_VAL_BOOL(PTP_DPC_CANON_AssistLight,PTP_VENDOR_CANON), PTP_VENDOR_VAL_RBOOL(PTP_DPC_CANON_RotationScene,PTP_VENDOR_CANON), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |