summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2008-03-02 20:22:56 +0000
committerLinus Walleij <triad@df.lth.se>2008-03-02 20:22:56 +0000
commitb8f78c74f10f6e6b0e2e3c68afc0586a70f7c6bc (patch)
treedd835bb2abc807eb02b5d2a079a9dffd9ad55e4e
parent21704fd8e2176ff25edc579c0ecdd11599c41b5b (diff)
downloadlibmtp-0-2-6.tar.gz
File updates for 0.2.6 releaselibmtp-0-2-6
-rw-r--r--ChangeLog9
-rw-r--r--configure.ac2
-rw-r--r--doc/Doxyfile.in26
-rw-r--r--src/Makefile.am6
-rw-r--r--src/libusb-glue.c31
-rw-r--r--src/ptp.c14
-rw-r--r--src/ptp.h4
7 files changed, 52 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index 0780e1f..0c19a02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-03-02 Linus Walleij <triad@df.lth.se>
+
+ * configure.ac: prepare 0.2.6 release.
+ * src/Makefile.am: bump to compatible interface,
+ * src/ptp.c: sync in upstream, a Sansa fix!
+ * src/ptp.h: sync in upstream.
+ * doc/Doxyfile.in: retire obsoleted parameters.
+ * Release this as 0.2.6!
+
2008-02-24 Richard Low <richard@wentnet.com>
* src/music-players.h: add DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL
diff --git a/configure.ac b/configure.ac
index 883bd32..2e04670 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
-AC_INIT([libmtp], [0.2.5], [libmtp-users@lists.sourceforge.net])
+AC_INIT([libmtp], [0.2.6], [libmtp-users@lists.sourceforge.net])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([src/libmtp.c])
AM_CONFIG_HEADER(config.h)
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index ebca8b1..e297dd3 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -54,16 +54,6 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
-# This tag can be used to specify the encoding used in the generated output.
-# The encoding is not always determined by the language that is chosen,
-# but also whether or not the output is meant for Windows or non-Windows users.
-# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
-# forces the Windows encoding (this is the default for the Windows binary),
-# whereas setting the tag to NO uses a Unix-style encoding (the default for
-# all platforms other than Windows).
-
-USE_WINDOWS_ENCODING = NO
-
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
@@ -1120,22 +1110,6 @@ DOT_PATH =
DOTFILE_DIRS =
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_WIDTH = 1024
-
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_HEIGHT = 1024
-
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes that
diff --git a/src/Makefile.am b/src/Makefile.am
index ada5f51..c82dca9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,9 +28,9 @@ EXTRA_DIST=libmtp.h.in libmtp.sym ptp-pack.c
# increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
# REVISION is set to 0, otherwise REVISION is incremented.
# ---------------------------------------------------------------------------
-CURRENT=7
-AGE=0
-REVISION=2
+CURRENT=8
+AGE=1
+REVISION=0
SOVERSION=$(CURRENT):$(REVISION):$(AGE)
if COMPILE_MINGW32
diff --git a/src/libusb-glue.c b/src/libusb-glue.c
index a0292d2..13a2e5c 100644
--- a/src/libusb-glue.c
+++ b/src/libusb-glue.c
@@ -43,7 +43,7 @@
#include "ptp-pack.c"
/* To enable debug prints, switch on this */
-//#define ENABLE_USB_BULK_DEBUG
+#define ENABLE_USB_BULK_DEBUG
/* this must not be too short - the original 4000 was not long
enough for big file transfers. I imagine the player spends a
@@ -534,7 +534,7 @@ ptp_read_func (
while (curread < size) {
#ifdef ENABLE_USB_BULK_DEBUG
- printf("Remaining size to read: 0x%04x bytes\n", size - curread);
+ printf("Remaining size to read: 0x%04lx bytes\n", size - curread);
#endif
// check equal to condition here
if (size - curread < CONTEXT_BLOCK_SIZE)
@@ -559,7 +559,7 @@ ptp_read_func (
(unsigned int) toread, (unsigned int) (size-curread));
#ifdef ENABLE_USB_BULK_DEBUG
- printf("Reading in 0x%04x bytes\n", toread);
+ printf("Reading in 0x%04lx bytes\n", toread);
#endif
result = USB_BULK_READ(ptp_usb->handle, ptp_usb->inep, (char*)bytes, toread, USB_TIMEOUT);
#ifdef ENABLE_USB_BULK_DEBUG
@@ -824,7 +824,12 @@ ptp_usb_sendreq (PTPParams* params, PTPContainer* req)
PTPUSBBulkContainer usbreq;
PTPDataHandler memhandler;
unsigned long written, towrite;
+#ifdef ENABLE_USB_BULK_DEBUG
+ char txt[256];
+ (void) ptp_render_opcode (params, req->Code, sizeof(txt), txt);
+ printf("REQUEST: 0x%04x, %s\n", req->Code, txt);
+#endif
/* build appropriate USB container */
usbreq.length=htod32(PTP_USB_BULK_REQ_LEN-
(sizeof(uint32_t)*(5-req->Nparam)));
@@ -870,6 +875,9 @@ ptp_usb_senddata (PTPParams* params, PTPContainer* ptp,
uint32_t bytes_left_to_transfer;
PTPDataHandler memhandler;
+#ifdef ENABLE_USB_BULK_DEBUG
+ printf("SEND DATA PHASE\n");
+#endif
/* build appropriate USB container */
usbdata.length = htod32(PTP_USB_BULK_HDR_LEN+size);
usbdata.type = htod16(PTP_USB_CONTAINER_DATA);
@@ -955,6 +963,9 @@ ptp_usb_getdata (PTPParams* params, PTPContainer* ptp, PTPDataHandler *handler)
unsigned long written;
PTP_USB *ptp_usb = (PTP_USB *) params->data;
+#ifdef ENABLE_USB_BULK_DEBUG
+ printf("GET DATA PHASE\n");
+#endif
memset(&usbdata,0,sizeof(usbdata));
do {
unsigned long len, rlen;
@@ -1108,14 +1119,17 @@ ptp_usb_getresp (PTPParams* params, PTPContainer* resp)
PTPUSBBulkContainer usbresp;
PTP_USB *ptp_usb = (PTP_USB *)(params->data);
+#ifdef ENABLE_USB_BULK_DEBUG
+ printf("RESPONSE: ");
+#endif
memset(&usbresp,0,sizeof(usbresp));
/* read response, it should never be longer than sizeof(usbresp) */
ret = ptp_usb_getpacket(params, &usbresp, &rlen);
- // Fix for bevahiour reported by Scott Snyder on Samsung YP-U3. The player
- // sends a packet containing just zeroes of length 2 (up to 4 has been seen too)
- // after a NULL packet when it should send the response. This code ignores
- // such illegal packets.
+ // Fix for bevahiour reported by Scott Snyder on Samsung YP-U3. The player
+ // sends a packet containing just zeroes of length 2 (up to 4 has been seen too)
+ // after a NULL packet when it should send the response. This code ignores
+ // such illegal packets.
while (ret==PTP_RC_OK && rlen<PTP_USB_BULK_HDR_LEN && usbresp.length==0) {
ptp_debug (params, "ptp_usb_getresp: detected short response "
"of %d bytes, expect problems! (re-reading "
@@ -1132,6 +1146,9 @@ ptp_usb_getresp (PTPParams* params, PTPContainer* resp)
if (dtoh16(usbresp.code)!=resp->Code) {
ret = dtoh16(usbresp.code);
}
+#ifdef ENABLE_USB_BULK_DEBUG
+ printf("%04x\n", ret);
+#endif
if (ret!=PTP_RC_OK) {
/* ptp_error (params,
"PTP: request code 0x%04x getting resp error 0x%04x",
diff --git a/src/ptp.c b/src/ptp.c
index f57daeb..80b97bb 100644
--- a/src/ptp.c
+++ b/src/ptp.c
@@ -2804,13 +2804,23 @@ ptp_mtp_getobjectreferences (PTPParams* params, uint32_t handle, uint32_t** ohAr
PTPContainer ptp;
uint16_t ret;
unsigned char* dpv=NULL;
+ unsigned int dpvlen = 0;
PTP_CNT_INIT(ptp);
ptp.Code=PTP_OC_MTP_GetObjectReferences;
ptp.Param1=handle;
ptp.Nparam=1;
- ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &dpv, NULL);
- if (ret == PTP_RC_OK) *arraylen = ptp_unpack_uint32_t_array(params, dpv, 0, ohArray);
+ ret=ptp_transaction(params, &ptp, PTP_DP_GETDATA, 0, &dpv, &dpvlen);
+ if (ret == PTP_RC_OK) {
+ /* Sandisk Sansa skips the DATA phase, but returns OK as response.
+ * this will gives us a NULL here. Handle it. -Marcus */
+ if ((dpv == NULL) || (dpvlen == 0)) {
+ *arraylen = 0;
+ *ohArray = NULL;
+ } else {
+ *arraylen = ptp_unpack_uint32_t_array(params, dpv, 0, ohArray);
+ }
+ }
free(dpv);
return ret;
}
diff --git a/src/ptp.h b/src/ptp.h
index 91d0ae3..c20948a 100644
--- a/src/ptp.h
+++ b/src/ptp.h
@@ -62,7 +62,7 @@ typedef struct _PTPContainer PTPContainer;
* 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 512
+#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)
@@ -1065,6 +1065,8 @@ typedef struct _PTPCanon_Property {
#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 9
#define PTP_DPC_CANON_Zoom 0xD02A
#define PTP_DPC_CANON_NamePrefix 0xD02B
#define PTP_DPC_CANON_SizeQualityMode 0xD02C