summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2012-04-03 13:26:00 +0000
committerMarcus Meissner <marcus@jet.franken.de>2012-04-03 13:26:00 +0000
commitb78773d84be2f44c3e19a1f64b372173bb37d1b1 (patch)
tree957e49f4ac59b883b46d020a19fdb6d16c28d91b
parenta90b42ef09e006e2b54bacc1954daeb09fdf63ed (diff)
downloadlibgphoto2-b78773d84be2f44c3e19a1f64b372173bb37d1b1.tar.gz
added EOS 5D Mark III support by Axel
git-svn-id: https://svn.code.sf.net/p/gphoto/code/branches/libgphoto2-2_4/libgphoto2@13959 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r--camlibs/ptp2/config.c41
-rw-r--r--camlibs/ptp2/library.c2
-rw-r--r--camlibs/ptp2/ptp-pack.c25
3 files changed, 46 insertions, 22 deletions
diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c
index c8782a8db..e179bd441 100644
--- a/camlibs/ptp2/config.c
+++ b/camlibs/ptp2/config.c
@@ -2013,32 +2013,38 @@ GENERIC16TABLE(Canon_ISO,canon_isospeed)
/* see ptp-pack.c:ptp_unpack_EOS_ImageFormat */
static struct deviceproptableu16 canon_eos_image_format[] = {
{ N_("RAW"), 0x0400, 0 },
- { N_("sRAW1"), 0x1400, 0 },
- { N_("sRAW2"), 0x2400, 0 },
+ { N_("mRAW"), 0x1400, 0 },
+ { N_("sRAW"), 0x2400, 0 },
{ N_("Large Fine JPEG"), 0x0300, 0 },
{ N_("Large Normal JPEG"), 0x0200, 0 },
{ N_("Medium Fine JPEG"), 0x1300, 0 },
{ N_("Medium Normal JPEG"), 0x1200, 0 },
{ N_("Small Fine JPEG"), 0x2300, 0 },
{ N_("Small Normal JPEG"), 0x2200, 0 },
+ { N_("Small Fine JPEG"), 0xd300, 0 },
+ { N_("Small Normal JPEG"), 0xd200, 0 },
+ { N_("Smaller JPEG"), 0xe300, 0 },
+ { N_("Tiny JPEG"), 0xf300, 0 },
{ N_("RAW + Large Fine JPEG"), 0x0403, 0 },
- { N_("sRAW1 + Large Fine JPEG"), 0x1403, 0 },
- { N_("sRAW2 + Large Fine JPEG"), 0x2403, 0 },
+ { N_("mRAW + Large Fine JPEG"), 0x1403, 0 },
+ { N_("sRAW + Large Fine JPEG"), 0x2403, 0 },
{ N_("RAW + Medium Fine JPEG"), 0x0413, 0 },
- { N_("sRAW1 + Medium Fine JPEG"), 0x1413, 0 },
- { N_("sRAW2 + Medium Fine JPEG"), 0x2413, 0 },
+ { N_("mRAW + Medium Fine JPEG"), 0x1413, 0 },
+ { N_("sRAW + Medium Fine JPEG"), 0x2413, 0 },
{ N_("RAW + Small Fine JPEG"), 0x0423, 0 },
- { N_("sRAW1 + Small Fine JPEG"), 0x1423, 0 },
- { N_("sRAW2 + Small Fine JPEG"), 0x2423, 0 },
+ { N_("mRAW + Small Fine JPEG"), 0x1423, 0 },
+ { N_("sRAW + Small Fine JPEG"), 0x2423, 0 },
{ N_("RAW + Large Normal JPEG"), 0x0402, 0 },
- { N_("sRAW1 + Large Normal JPEG"), 0x1402, 0 },
- { N_("sRAW2 + Large Normal JPEG"), 0x2402, 0 },
+ { N_("mRAW + Large Normal JPEG"), 0x1402, 0 },
+ { N_("sRAW + Large Normal JPEG"), 0x2402, 0 },
{ N_("RAW + Medium Normal JPEG"), 0x0412, 0 },
- { N_("sRAW1 + Medium Normal JPEG"), 0x1412, 0 },
- { N_("sRAW2 + Medium Normal JPEG"), 0x2412, 0 },
+ { N_("mRAW + Medium Normal JPEG"), 0x1412, 0 },
+ { N_("sRAW + Medium Normal JPEG"), 0x2412, 0 },
{ N_("RAW + Small Normal JPEG"), 0x0422, 0 },
- { N_("sRAW1 + Small Normal JPEG"), 0x1422, 0 },
- { N_("sRAW2 + Small Normal JPEG"), 0x2422, 0 },
+ { N_("mRAW + Small Normal JPEG"), 0x1422, 0 },
+ { N_("sRAW + Small Normal JPEG"), 0x2422, 0 },
+/* There are more RAW + 'smallish' JPEG combinations for at least the 5DM3 possible.
+ Axel was simply to lazy to exercise the combinatorial explosion. :-/ */
};
GENERIC16TABLE(Canon_EOS_ImageFormat,canon_eos_image_format)
@@ -2066,6 +2072,8 @@ static struct deviceproptableu16 canon_eos_drive_mode[] = {
{ N_("Continuous low speed"), 0x0005, 0 },
{ N_("Timer 10 sec"), 0x0010, 0 },
{ N_("Timer 2 sec"), 0x0011, 0 },
+ { N_("Single silent"), 0x0013, 0 },
+ { N_("Continuous silent"), 0x0014, 0 },
};
GENERIC16TABLE(Canon_EOS_DriveMode,canon_eos_drive_mode)
@@ -3199,8 +3207,9 @@ GENERIC16TABLE(FocusMode,focusmodes)
static struct deviceproptableu16 eos_focusmodes[] = {
{ N_("One Shot"), 0x0000, 0 },
- { N_("AI Focus"), 0x0001, 0 },
- { N_("AI Servo"), 0x0002, 0 },
+ { N_("AI Servo"), 0x0001, 0 },
+ { N_("AI Focus"), 0x0002, 0 },
+ { N_("Manual"), 0x0003, 0 },
};
GENERIC16TABLE(Canon_EOS_FocusMode,eos_focusmodes)
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index 1c4c5411c..135a831bb 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -1096,6 +1096,8 @@ static struct {
/* IRC Reporter */
{"Canon:EOS 5D Mark II", 0x04a9, 0x3199, PTP_CAP|PTP_CAP_PREVIEW|PTPBUG_DELETE_SENDS_EVENT},
+ /* Axel Waggershauser <awagger@web.de> */
+ {"Canon:EOS 5D Mark III", 0x04a9, 0x323a, PTP_CAP|PTP_CAP_PREVIEW|PTPBUG_DELETE_SENDS_EVENT},
/* Thomas Tanner <thomas@tannerlab.com> */
{"Canon:EOS 7D", 0x04a9, 0x319a, PTP_CAP|PTP_CAP_PREVIEW|PTPBUG_DELETE_SENDS_EVENT},
/* mitch <debianuser@mll.dissimulo.com> */
diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c
index bedf629d0..1059b247d 100644
--- a/camlibs/ptp2/ptp-pack.c
+++ b/camlibs/ptp2/ptp-pack.c
@@ -1247,13 +1247,13 @@ static inline uint16_t
ptp_unpack_EOS_ImageFormat (PTPParams* params, unsigned char** data )
{
/*
- EOS ImageFormat entries (of at least the 5DMII and the 400D ) look like this:
+ EOS ImageFormat entries (of at least the 5DM2 and the 400D) look like this:
uint32: number of entries / generated files (1 or 2)
uint32: size of this entry in bytes (most likely allways 0x10)
uint32: image type (1 == JPG, 6 == RAW)
- uint32: image size (0 == Large, 1 == Medium, 2 == Small)
+ uint32: image size (0 == Large, 1 == Medium, 2 == Small, 0xe == S1, 0xf == S2, 0x10 == S3)
uint32: image compression (2 == Standard/JPG, 3 == Fine/JPG, 4 == Lossles/RAW)
- If number of entries is 2 the last uint32 repeat.
+ If the number of entries is 2 the last 4 uint32 repeat.
example:
0: 0x 1
@@ -1262,11 +1262,14 @@ ptp_unpack_EOS_ImageFormat (PTPParams* params, unsigned char** data )
3: 0x 1
4: 0x 4
- The idea is to simply 'condense' these values to just one uint16 to be able to conveniontly
+ The idea is to simply 'condense' these values to just one uint16 to be able to conveniently
use the available enumeration facilities (look-up table). The image size and compression
values fully describe the image format. Hence we generate a uint16 with the four nibles set
as follows: entry 1 size | entry 1 compression | entry 2 size | entry 2 compression.
The above example would result in the value 0x1400.
+
+ The EOS 5D Mark III (and possibly other high-end EOS as well) added the extra fancy S1, S2
+ and S3 JPEG options. S1 replaces the old Small. -1 the S1/S2/S3 to prevent the 0x10 overflow.
*/
const unsigned char* d = *data;
@@ -1301,6 +1304,12 @@ ptp_unpack_EOS_ImageFormat (PTPParams* params, unsigned char** data )
*data = (unsigned char*) d+4;
+ /* deal with S1/S2/S3 JPEG sizes, see above. */
+ if( s1 >= 0xe )
+ s1--;
+ if( s2 >= 0xe )
+ s2--;
+
return ((s1 & 0xF) << 12) | ((c1 & 0xF) << 8) | ((s2 & 0xF) << 4) | ((c2 & 0xF) << 0);
}
@@ -1313,19 +1322,23 @@ ptp_pack_EOS_ImageFormat (PTPParams* params, unsigned char* data, uint16_t value
if( !data )
return s;
+#define PACK_5DM3_SMALL_JPEG_SIZE( X ) (X) >= 0xd ? (X)+1 : (X)
+
htod32a(data+=0, n);
htod32a(data+=4, 0x10);
htod32a(data+=4, ((value >> 8) & 0xF) == 4 ? 6 : 1);
- htod32a(data+=4, (value >> 12) & 0xF);
+ htod32a(data+=4, PACK_5DM3_SMALL_JPEG_SIZE((value >> 12) & 0xF));
htod32a(data+=4, (value >> 8) & 0xF);
if (n==2) {
htod32a(data+=4, 0x10);
htod32a(data+=4, ((value >> 0) & 0xF) == 4 ? 6 : 1);
- htod32a(data+=4, (value >> 4) & 0xF);
+ htod32a(data+=4, PACK_5DM3_SMALL_JPEG_SIZE((value >> 4) & 0xF));
htod32a(data+=4, (value >> 0) & 0xF);
}
+#undef PACK_5DM3_SMALL_JPEG_SIZE
+
return s;
}