diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2009-03-20 12:57:25 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2009-03-20 12:57:25 +0000 |
commit | c070ecdcffa568b401eb7796e5af3002fb186d42 (patch) | |
tree | 5866728955d509623ffd85897545aca07d11f114 | |
parent | a1f7893b96d911b687d1a06728f361381e421bf5 (diff) | |
download | libgphoto2-c070ecdcffa568b401eb7796e5af3002fb186d42.tar.gz |
bugfixes backported from TRUNK
git-svn-id: https://svn.code.sf.net/p/gphoto/code/branches/libgphoto2-2_4/libgphoto2@11868 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | camlibs/ptp2/README.ptp2 | 2 | ||||
-rw-r--r-- | camlibs/ptp2/config.c | 48 | ||||
-rw-r--r-- | camlibs/ptp2/library.c | 8 | ||||
-rw-r--r-- | camlibs/ptp2/ptp-pack.c | 2 |
4 files changed, 50 insertions, 10 deletions
diff --git a/camlibs/ptp2/README.ptp2 b/camlibs/ptp2/README.ptp2 index f13008393..01e9126d1 100644 --- a/camlibs/ptp2/README.ptp2 +++ b/camlibs/ptp2/README.ptp2 @@ -1,7 +1,7 @@ libptp2 (c)2001-2003 Mariusz Woloszyn <emsi@ipartners.pl> libgphoto2 ptp2 camlib driver also -Copyright 2003 - 2005 Marcus Meissner +Copyright 2003 - 2009 Marcus Meissner <marcus@jet.franken.de> Copyright 2005 Hubert Figuire. ======================== diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index 82f44a77e..56c0dcaf0 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -460,10 +460,14 @@ static int _get_Generic16Table(CONFIG_GET_ARGS, struct deviceproptableu16* tbl, int tblsize) { int i, j; - if (!(dpd->FormFlag & PTP_DPFF_Enumeration)) + if (!(dpd->FormFlag & PTP_DPFF_Enumeration)) { + gp_log (GP_LOG_DEBUG, "ptp/get_generic16", "no enumeration in 16bit table code"); return (GP_ERROR); - if (dpd->DataType != PTP_DTC_UINT16) + } + if (dpd->DataType != PTP_DTC_UINT16) { + gp_log (GP_LOG_DEBUG, "ptp/get_generic16", "no uint16 prop in 16bit table code"); return (GP_ERROR); + } gp_widget_new (GP_WIDGET_RADIO, _(menu->label), widget); gp_widget_set_name (*widget, menu->name); @@ -1272,6 +1276,10 @@ static struct deviceproptableu16 canon_shutterspeed[] = { { "1/3000", 0x0094,0 }, { "1/3200", 0x0095,0 }, { "1/4000", 0x0098,0 }, + { "1/5000", 0x009b,0 }, + { "1/6000", 0x009c,0 }, + { "1/6400", 0x009d,0 }, + { "1/8000", 0x00a0,0 }, }; GENERIC16TABLE(Canon_ShutterSpeed,canon_shutterspeed) @@ -1321,9 +1329,17 @@ static struct deviceproptableu16 canon_isospeed[] = { { "64", 0x0043, 0 }, { "80", 0x0045, 0 }, { "100", 0x0048, 0 }, + { "125", 0x004b, 0 }, + { "160", 0x004d, 0 }, { "200", 0x0050, 0 }, + { "250", 0x0053, 0 }, + { "320", 0x0055, 0 }, { "400", 0x0058, 0 }, + { "500", 0x005b, 0 }, + { "640", 0x005d, 0 }, { "800", 0x0060, 0 }, + { "1000", 0x0063, 0 }, + { "1250", 0x0065, 0 }, { "1600", 0x0068, 0 }, { "3200", 0x0070, 0 }, { "6400", 0x0078, 0 }, @@ -1548,10 +1564,30 @@ GENERIC8TABLE(Nikon_CameraOrientation,nikon_orientation) static struct deviceproptableu16 canon_orientation[] = { { "0'", 0, 0 }, { "90'", 1, 0 }, - { "180'", 2, 0 }, /* guessed */ + { "180'", 2, 0 }, { "270'", 3, 0 }, }; -GENERIC16TABLE(Canon_CameraOrientation,canon_orientation) + +static int +_get_Canon_CameraOrientation(CONFIG_GET_ARGS) { + char orient[20]; + int i; + + if (dpd->DataType != PTP_DTC_UINT16) + return (GP_ERROR); + gp_widget_new (GP_WIDGET_TEXT, _(menu->label), widget); + gp_widget_set_name (*widget, menu->name); + for (i=0;i<sizeof(canon_orientation)/sizeof(canon_orientation[0]);i++) { + if (canon_orientation[i].value != dpd->CurrentValue.u16) + continue; + gp_widget_set_value (*widget, canon_orientation[i].label); + return GP_OK; + } + sprintf (orient, _("Unknown value 0x%04x"), dpd->CurrentValue.u16); + gp_widget_set_value (*widget, orient); + return GP_OK; +} + static struct deviceproptableu8 nikon_afsensor[] = { { N_("Centre"), 0x00, 0 }, @@ -3172,8 +3208,10 @@ camera_get_config (Camera *camera, CameraWidget **window, GPContext *context) } else { ret = cursub->getfunc (camera, &widget, cursub, NULL); } - if (ret != GP_OK) + if (ret != GP_OK) { + gp_log (GP_LOG_DEBUG, "camera_get_config", "Unable to set Property %04x (%s), ret %d", cursub->propid, cursub->label, ret); continue; + } gp_widget_append (section, widget); continue; } diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 370e222e9..022f6e433 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -738,7 +738,7 @@ static struct { /* Nikon Coolpix 5700: A. Tanenbaum, 29 Oct 2002 */ {"Nikon:Coolpix 5700 (PTP mode)", 0x04b0, 0x010d, PTP_CAP}, /* Nikon Coolpix 4500: T. Kaproncai, 22 Aug 2003 */ - {"Nikon Coolpix 4500 (PTP mode)", 0x04b0, 0x010b, 0}, + {"Nikon:Coolpix 4500 (PTP mode)", 0x04b0, 0x010b, 0}, /* Nikon Coolpix 4300: Marco Rodriguez, 10 dic 2002 */ {"Nikon:Coolpix 4300 (PTP mode)", 0x04b0, 0x010f, 0}, /* Nikon Coolpix 3500: M. Meissner, 07 May 2003 */ @@ -760,7 +760,7 @@ static struct { /* Nikon Coolpix 3200 */ {"Nikon:Coolpix 3200 (PTP mode)", 0x04b0, 0x0121, 0}, /* Nikon Coolpix 2200 */ - {"Nikon:Coolpix 2200 (PTP mode)", 0x04b0, 0x0122, 0}, + {"Nikon:Coolpix 2200 (PTP mode)", 0x04b0, 0x0122, PTP_CAP|PTP_NIKON_BROKEN_CAP}, /* Nikon Coolpix 4800 */ {"Nikon:Coolpix 4800 (PTP mode)", 0x04b0, 0x0129, 0}, /* Nikon Coolpix SQ: M. Holzbauer, 07 Jul 2003 */ @@ -783,7 +783,7 @@ static struct { {"Nikon:Coolpix S2 (PTP mode)", 0x04b0, 0x014e, 0}, {"Nikon:Coolpix S6 (PTP mode)", 0x04b0, 0x014e, 0}, /* Ole Aamot <ole@gnome.org> */ - {"Nikon:Coolpix P5000 (PTP mode)",0x04b0, 0x015b, PTP_CAP},/* mm: sends capture complete */ + {"Nikon:Coolpix P5000 (PTP mode)",0x04b0, 0x015b, PTP_CAP|PTP_NIKON_BROKEN_CAP}, /* Peter Pregler <Peter_Pregler@email.com> */ {"Nikon:Coolpix S500 (PTP mode)", 0x04b0, 0x015d, 0}, {"Nikon:Coolpix L12 (PTP mode)", 0x04b0, 0x015f, 0}, @@ -3863,6 +3863,8 @@ put_file_func (CameraFilesystem *fs, const char *folder, CameraFile *file, gp_context_error (context, _("Metadata only supported for MTP devices.")); return GP_ERROR; } + if (type != GP_FILE_TYPE_NORMAL) + return GP_ERROR_BAD_PARAMETERS; /* compute storage ID value from folder patch */ folder_to_storage(folder,storage); diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c index e1e3780a4..fb4dc4e53 100644 --- a/camlibs/ptp2/ptp-pack.c +++ b/camlibs/ptp2/ptp-pack.c @@ -1274,7 +1274,7 @@ ptp_unpack_CANON_changes (PTPParams *params, unsigned char* data, int datasize, uint8_t len = 0; dpd->FactoryDefaultValue.str = ptp_unpack_string(params, data, 0, &len); dpd->CurrentValue.str = ptp_unpack_string(params, data, 0, &len); - ptp_debug (params,"event %d: currentvalue of %x is %s", i, proptype, dpd->CurrentValue.str); + ptp_debug (params,"event %d: currentvalue of %x is %s", i, proptype, dpd->CurrentValue.u8); break; } default: |