Mailinglist Archive: opensuse-commit (2092 mails)
| < Previous | Next > |
commit libmtp
- From: root@xxxxxxxxxxxxxxx (h_root)
- Date: Mon, 06 Aug 2007 21:27:00 +0200
- Message-id: <20070806192700.CAC8467817A@xxxxxxxxxxxxxxx>
Hello community,
here is the log from the commit of package libmtp
checked in at Mon Aug 6 21:27:00 CEST 2007.
--------
--- libmtp/libmtp.changes 2007-07-26 16:23:39.000000000 +0200
+++ /mounts/work_src_done/STABLE/libmtp/libmtp.changes 2007-08-04 23:47:09.000000000 +0200
@@ -1,0 +2,7 @@
+Sat Aug 4 23:46:47 CEST 2007 - meissner@xxxxxxx
+
+- upgraded to 0.2.0 release
+ - more USB ids
+ - 64bit handling
+
+-------------------------------------------------------------------
Old:
----
libmtp-0.1.5.tar.bz2
New:
----
libmtp-0.2.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libmtp.spec ++++++
--- /var/tmp/diff_new_pack.o21724/_old 2007-08-06 21:26:31.000000000 +0200
+++ /var/tmp/diff_new_pack.o21724/_new 2007-08-06 21:26:31.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package libmtp (Version 0.1.5)
+# spec file for package libmtp (Version 0.2.0)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -21,8 +21,8 @@
Group: Productivity/Multimedia/Sound/Players
Autoreqprov: on
Summary: Access to MTP Players
-Version: 0.1.5
-Release: 24
+Version: 0.2.0
+Release: 1
Source0: %name-%version.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -110,6 +110,10 @@
%{_prefix}/include/libmtp.h
%changelog
+* Sat Aug 04 2007 - meissner@xxxxxxx
+- upgraded to 0.2.0 release
+ - more USB ids
+ - 64bit handling
* Thu Jul 26 2007 - meissner@xxxxxxx
- uprgaded to current CVS state
- caching of fs and metadata
++++++ libmtp-0.1.5.tar.bz2 -> libmtp-0.2.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/ChangeLog new/libmtp-0.2.0/ChangeLog
--- old/libmtp-0.1.5/ChangeLog 2007-07-26 11:52:55.000000000 +0200
+++ new/libmtp-0.2.0/ChangeLog 2007-08-04 23:29:37.000000000 +0200
@@ -1,3 +1,46 @@
+2007-08-04 Linus Walleij <triad@xxxxxxxxx>
+
+ * src/libmtp.c: fix up the 64bit filesize and tracksize support.
+ There were some bugs...
+ * src/Makefile.am: tweak interface revision so that we produce
+ libmtp.so.6 now.
+ * configure.ac: bump library revision to 0.2.0.
+ * examples/hotplug.c: switch to use ATTR{} instead of SYSFS{}
+
+2007-08-04 Richard Low <richard@xxxxxxxxxxx>
+
+ * src/libusb-glue.c: add Sansa m240 (a different ID to before)
+ Give the Toshiba Gigabeat S
+ DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL.
+
+2007-08-03 Marcus Meissner <meissner@xxxxxxx>
+
+ * m4/byteorder.m4: byteorder fixes.
+
+2007-07-30 Richard Low <richard@xxxxxxxxxxx>
+
+ * src/ptp-pack.c: fix up array packing
+
+2007-07-30 Linus Walleij <triad@xxxxxxxxx>
+
+ * src/ptp-pack.c: try to get a uniform 64 bit
+ support, use some old macro code.
+
+2007-07-29 Richard Low <richard@xxxxxxxxxxx>
+
+ * src/libmtp.c: 64 bit filesize support for tracks
+ * src/ptp-pack.c: ditto
+ * src/ptp.h: ditto
+
+2007-07-27 Richard Low <richard@xxxxxxxxxxx>
+
+ * src/libmtp.c: Some better NULL checks
+
+2007-07-27 Linus Walleij <triad@xxxxxxxxx>
+
+ * examples/hotplug.c: changed subsystem from "usb_device"
+ to "usb". Presumably a change in the kernel some time ago.
+
2007-07-21 Richard Low <richard@xxxxxxxxxxx>
* src/libmtp.c: Correctly bail out of LIBMTP_Get_Storage
@@ -30,8 +73,9 @@
2007-07-10 Linus Walleij <triad@xxxxxxxxx>
- * examples/hotplug.c: force HAL OGG support on iriver devices. They all
- have it! Also force for two other devices that does this.
+ * examples/hotplug.c: force HAL OGG support on iriver devices.
+ They all have it! Also force for two other devices that does
+ this.
2007-07-07 Linus Walleij <triad@xxxxxxxxx>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/configure new/libmtp-0.2.0/configure
--- old/libmtp-0.1.5/configure 2007-03-27 08:56:16.000000000 +0200
+++ new/libmtp-0.2.0/configure 2007-08-04 23:29:55.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.60 for libmtp 0.1.5.
+# Generated by GNU Autoconf 2.60 for libmtp 0.2.0.
#
# Report bugs to <libmtp-users@xxxxxxxxxxxxxxxxxxxxx>.
#
@@ -713,8 +713,8 @@
# Identity of this package.
PACKAGE_NAME='libmtp'
PACKAGE_TARNAME='libmtp'
-PACKAGE_VERSION='0.1.5'
-PACKAGE_STRING='libmtp 0.1.5'
+PACKAGE_VERSION='0.2.0'
+PACKAGE_STRING='libmtp 0.2.0'
PACKAGE_BUGREPORT='libmtp-users@xxxxxxxxxxxxxxxxxxxxx'
ac_unique_file="src/libmtp.c"
@@ -1383,7 +1383,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libmtp 0.1.5 to adapt to many kinds of systems.
+\`configure' configures libmtp 0.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1453,7 +1453,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libmtp 0.1.5:";;
+ short | recursive ) echo "Configuration of libmtp 0.2.0:";;
esac
cat <<\_ACEOF
@@ -1554,7 +1554,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libmtp configure 0.1.5
+libmtp configure 0.2.0
generated by GNU Autoconf 2.60
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1568,7 +1568,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libmtp $as_me 0.1.5, which was
+It was created by libmtp $as_me 0.2.0, which was
generated by GNU Autoconf 2.60. Invocation command line was
$ $0 $@
@@ -2238,7 +2238,7 @@
# Define the identity of the package.
PACKAGE='libmtp'
- VERSION='0.1.5'
+ VERSION='0.2.0'
cat >>confdefs.h <<_ACEOF
@@ -22191,10 +22191,72 @@
# This m4 macros has caused severe pain, I am considering creating a
# hard-coded byte swapper that will be eternally portable.
-ac_dir=`echo src/gphoto2-endian.h|sed 's%/[^/][^/]*$%%'`
+ac_dir=`$as_dirname -- "src/gphoto2-endian.h" ||
+$as_expr X"src/gphoto2-endian.h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"src/gphoto2-endian.h" : 'X\(//\)[^/]' \| \
+ X"src/gphoto2-endian.h" : 'X\(//\)$' \| \
+ X"src/gphoto2-endian.h" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"src/gphoto2-endian.h" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
if test "$ac_dir" != "src/gphoto2-endian.h" && test "$ac_dir" != .; then
# The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
+ test ! -d "$ac_dir" && { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
fi
# We're only interested in the target CPU, but it's not always set
@@ -22879,6 +22941,7 @@
#define htole32(x) swap32(x)
#define le16toh(x) swap16(x)
#define le32toh(x) swap32(x)
+#define le64toh(x) swap64(x)
#define htobe64(x) (x)
#define be64toh(x) (x)
@@ -22887,6 +22950,7 @@
#define HTOLE32(x) (x) = htole32(x)
#define LE16TOH(x) (x) = le16toh(x)
#define LE32TOH(x) (x) = le32toh(x)
+#define LE64TOH(x) (x) = le64toh(x)
#define HTOBE64(x) (void) (x)
#define BE64TOH(x) (void) (x)
@@ -22965,12 +23029,14 @@
/* Non-optimized but portable macros */
#define be16atoh(x) ((uint16_t)(((x)[0]<<8)|(x)[1]))
#define be32atoh(x) ((uint32_t)(((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3]))
-#define be64atoh(x) ((uint64_t)(((x)[0]<<56)|((x)[1]<<48)|((x)[2]<<40)| \\
- ((x)[3]<<32)|((x)[4]<<24)|((x)[5]<<16)|((x)[6]<<8)|(x)[7]))
+#define be64atoh_x(x,off,shift) (((uint64_t)((x)[off]))<<shift)
+#define be64atoh(x) ((uint64_t)(be64atoh_x(x,0,56)|be64atoh_x(x,1,48)|be64atoh_x(x,2,40)| \\
+ be64atoh_x(x,3,32)|be64atoh_x(x,4,24)|be64atoh_x(x,5,16)|be64atoh_x(x,6,8)|((x)[7])))
#define le16atoh(x) ((uint16_t)(((x)[1]<<8)|(x)[0]))
#define le32atoh(x) ((uint32_t)(((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0]))
-#define le64atoh(x) ((uint64_t)(((x)[7]<<56)|((x)[6]<<48)|((x)[5]<<40)| \\
- ((x)[4]<<32)|((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0]))
+#define le64atoh_x(x,off,shift) (((uint64_t)(x)[off])<<shift)
+#define le64atoh(x) ((uint64_t)(le64atoh_x(x,7,56)|le64atoh_x(x,6,48)|le64atoh_x(x,5,40)| \\
+ le64atoh_x(x,4,32)|le64atoh_x(x,3,24)|le64atoh_x(x,2,16)|le64atoh_x(x,1,8)|((x)[0])))
#define htobe16a(a,x) (a)[0]=(uint8_t)((x)>>8), (a)[1]=(uint8_t)(x)
#define htobe32a(a,x) (a)[0]=(uint8_t)((x)>>24), (a)[1]=(uint8_t)((x)>>16), \\
@@ -23416,7 +23482,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libmtp $as_me 0.1.5, which was
+This file was extended by libmtp $as_me 0.2.0, which was
generated by GNU Autoconf 2.60. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23469,7 +23535,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libmtp config.status 0.1.5
+libmtp config.status 0.2.0
configured by $0, generated by GNU Autoconf 2.60,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/configure.ac new/libmtp-0.2.0/configure.ac
--- old/libmtp-0.1.5/configure.ac 2007-03-27 08:56:00.000000000 +0200
+++ new/libmtp-0.2.0/configure.ac 2007-08-04 23:29:37.000000000 +0200
@@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
-AC_INIT([libmtp], [0.1.5], [libmtp-users@xxxxxxxxxxxxxxxxxxxxx])
+AC_INIT([libmtp], [0.2.0], [libmtp-users@xxxxxxxxxxxxxxxxxxxxx])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([src/libmtp.c])
AM_CONFIG_HEADER(config.h)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/examples/hotplug.c new/libmtp-0.2.0/examples/hotplug.c
--- old/libmtp-0.1.5/examples/hotplug.c 2007-07-26 11:52:56.000000000 +0200
+++ new/libmtp-0.2.0/examples/hotplug.c 2007-08-04 23:29:38.000000000 +0200
@@ -82,8 +82,12 @@
case style_udev:
printf("# UDEV-style hotplug map for libmtp\n");
printf("# Put this file in /etc/udev/rules.d\n\n");
- printf("SUBSYSTEM!=\"usb_device\", GOTO=\"libmtp_rules_end\"\n");
- printf("ACTION!=\"add\", GOTO=\"libmtp_rules_end\"\n\n");
+ printf("ACTION!=\"add\", GOTO=\"libmtp_rules_end\"\n"
+ "SUBSYSTEM==\"usb\", GOTO=\"libmtp_rules\"\n"
+ "# The following line will be deprecated when older kernels are phased out.\n"
+ "SUBSYSTEM==\"usb_device\", GOTO=\"libmtp_rules\"\n\n"
+ "GOTO=\"libmtp_rules_end\"\n\n"
+ "LABEL=\"libmtp_rules\"\n\n");
break;
case style_usbmap:
printf("# This usermap will call the script \"libmtp.sh\" whenever a known MTP device is attached.\n\n");
@@ -113,7 +117,10 @@
} else {
action = default_udev_action;
}
- printf("SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", %s\n", entry->vendor_id, entry->product_id, action);
+ // Old style directly SYSFS named.
+ // printf("SYSFS{idVendor}==\"%04x\", SYSFS{idProduct}==\"%04x\", %s\n", entry->vendor_id, entry->product_id, action);
+ // Newer style
+ printf("ATTR{idVendor}==\"%04x\", ATTR{idProduct}==\"%04x\", %s\n", entry->vendor_id, entry->product_id, action);
break;
}
case style_usbmap:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/libmtp.pc new/libmtp-0.2.0/libmtp.pc
--- old/libmtp-0.1.5/libmtp.pc 2007-03-27 08:56:39.000000000 +0200
+++ new/libmtp-0.2.0/libmtp.pc 2007-08-04 23:30:23.000000000 +0200
@@ -7,7 +7,7 @@
Name: libmtp
Description: libmtp is a library for accessing Media Transfer Protocol devices
-Version: 0.1.5
+Version: 0.2.0
Requires: libusb
Conflicts:
Libs: -L${libdir} -lmtp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/m4/byteorder.m4 new/libmtp-0.2.0/m4/byteorder.m4
--- old/libmtp-0.1.5/m4/byteorder.m4 2006-03-28 09:19:22.000000000 +0200
+++ new/libmtp-0.2.0/m4/byteorder.m4 2007-08-04 09:01:45.000000000 +0200
@@ -32,12 +32,10 @@
dnl Create a header file that defines extended byte swapping macros
AC_DEFUN([AC_NEED_BYTEORDER_H],
[
-changequote(, )dnl
-ac_dir=`echo $1|sed 's%/[^/][^/]*$%%'`
-changequote([, ])dnl
+ac_dir=`AS_DIRNAME(["$1"])`
if test "$ac_dir" != "$1" && test "$ac_dir" != .; then
# The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
+ test ! -d "$ac_dir" && AS_MKDIR_P(["$ac_dir"])
fi
# We're only interested in the target CPU, but it's not always set
@@ -236,6 +234,7 @@
#define htole32(x) swap32(x)
#define le16toh(x) swap16(x)
#define le32toh(x) swap32(x)
+#define le64toh(x) swap64(x)
#define htobe64(x) (x)
#define be64toh(x) (x)
@@ -244,6 +243,7 @@
#define HTOLE32(x) (x) = htole32(x)
#define LE16TOH(x) (x) = le16toh(x)
#define LE32TOH(x) (x) = le32toh(x)
+#define LE64TOH(x) (x) = le64toh(x)
#define HTOBE64(x) (void) (x)
#define BE64TOH(x) (void) (x)
@@ -322,12 +322,14 @@
/* Non-optimized but portable macros */
#define be16atoh(x) ((uint16_t)(((x)[0]<<8)|(x)[1]))
#define be32atoh(x) ((uint32_t)(((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3]))
-#define be64atoh(x) ((uint64_t)(((x)[0]<<56)|((x)[1]<<48)|((x)[2]<<40)| \\
- ((x)[3]<<32)|((x)[4]<<24)|((x)[5]<<16)|((x)[6]<<8)|(x)[7]))
+#define be64atoh_x(x,off,shift) (((uint64_t)((x)[off]))<<shift)
+#define be64atoh(x) ((uint64_t)(be64atoh_x(x,0,56)|be64atoh_x(x,1,48)|be64atoh_x(x,2,40)| \\
+ be64atoh_x(x,3,32)|be64atoh_x(x,4,24)|be64atoh_x(x,5,16)|be64atoh_x(x,6,8)|((x)[7])))
#define le16atoh(x) ((uint16_t)(((x)[1]<<8)|(x)[0]))
#define le32atoh(x) ((uint32_t)(((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0]))
-#define le64atoh(x) ((uint64_t)(((x)[7]<<56)|((x)[6]<<48)|((x)[5]<<40)| \\
- ((x)[4]<<32)|((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0]))
+#define le64atoh_x(x,off,shift) (((uint64_t)(x)[off])<<shift)
+#define le64atoh(x) ((uint64_t)(le64atoh_x(x,7,56)|le64atoh_x(x,6,48)|le64atoh_x(x,5,40)| \\
+ le64atoh_x(x,4,32)|le64atoh_x(x,3,24)|le64atoh_x(x,2,16)|le64atoh_x(x,1,8)|((x)[0])))
#define htobe16a(a,x) (a)[0]=(uint8_t)((x)>>8), (a)[1]=(uint8_t)(x)
#define htobe32a(a,x) (a)[0]=(uint8_t)((x)>>24), (a)[1]=(uint8_t)((x)>>16), \\
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/README new/libmtp-0.2.0/README
--- old/libmtp-0.1.5/README 2007-07-05 18:58:14.000000000 +0200
+++ new/libmtp-0.2.0/README 2007-08-04 23:29:37.000000000 +0200
@@ -108,7 +108,11 @@
The most common flag that needs to be set is the
DEVICE_FLAG_UNLOAD_DRIVER that detach any Linux kernel
drivers that may have attached to the device making
-MTP access impossible.
+MTP access impossible. This is however not expected to
+really work: this is a problem being tracked as of
+now (2007-08-04). See the "last resort" solutions below
+if you really need to get your dual-mode device to work
+with MTP.
If your device is very problematic we are curious of how it
works under Windows, so we enjoy reading USB packet sniffs
@@ -140,11 +144,14 @@
Some devices that are dual-mode are simply impossible to get
to work under Linux because the usb-storage(.ko) kernel
module hook them first, and refuse to release them, even
-when we specify the DEVICE_FLAG_UNLOAD_DRIVER flag.
+when we specify the DEVICE_FLAG_UNLOAD_DRIVER flag. (Maybe
+it DOES release it but the device will immediately be probed
+at the USB mass storage interface AGAIN because it
+enumerates.)
Try this, if you have a recent 2.6.x Linux kernel:
-* Go into /etc/modprobe.d/blacklist
+* Edit /etc/modprobe.d/blacklist
* Add the line "blacklist usb-storage"
@@ -156,6 +163,12 @@
is no longer a USB mass storage driver that tries to hook onto
the mass storage interface of your device.
+If not even blacklisting works (check with
+"lsmod | grep usb-storage"), there is some problem with
+something else and you may need to remove or rename the file
+/lib/modules/<VERSION>/kernel/drivers/usb/storage/usb-storage.ko
+manually.
+
If you find the PerfectSolution(TM) to this dilemma, so you
can properly switch for individual devices whether to use it
as USB mass storage or not, please tell us how you did it. We
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/gphoto2-endian.h new/libmtp-0.2.0/src/gphoto2-endian.h
--- old/libmtp-0.1.5/src/gphoto2-endian.h 2007-03-27 08:56:37.000000000 +0200
+++ new/libmtp-0.2.0/src/gphoto2-endian.h 2007-08-04 23:30:21.000000000 +0200
@@ -44,6 +44,7 @@
#define htole32(x) swap32(x)
#define le16toh(x) swap16(x)
#define le32toh(x) swap32(x)
+#define le64toh(x) swap64(x)
#define htobe64(x) (x)
#define be64toh(x) (x)
@@ -52,6 +53,7 @@
#define HTOLE32(x) (x) = htole32(x)
#define LE16TOH(x) (x) = le16toh(x)
#define LE32TOH(x) (x) = le32toh(x)
+#define LE64TOH(x) (x) = le64toh(x)
#define HTOBE64(x) (void) (x)
#define BE64TOH(x) (void) (x)
@@ -68,12 +70,14 @@
/* Non-optimized but portable macros */
#define be16atoh(x) ((uint16_t)(((x)[0]<<8)|(x)[1]))
#define be32atoh(x) ((uint32_t)(((x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3]))
-#define be64atoh(x) ((uint64_t)(((x)[0]<<56)|((x)[1]<<48)|((x)[2]<<40)| \
- ((x)[3]<<32)|((x)[4]<<24)|((x)[5]<<16)|((x)[6]<<8)|(x)[7]))
+#define be64atoh_x(x,off,shift) (((uint64_t)((x)[off]))<<shift)
+#define be64atoh(x) ((uint64_t)(be64atoh_x(x,0,56)|be64atoh_x(x,1,48)|be64atoh_x(x,2,40)| \
+ be64atoh_x(x,3,32)|be64atoh_x(x,4,24)|be64atoh_x(x,5,16)|be64atoh_x(x,6,8)|((x)[7])))
#define le16atoh(x) ((uint16_t)(((x)[1]<<8)|(x)[0]))
#define le32atoh(x) ((uint32_t)(((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0]))
-#define le64atoh(x) ((uint64_t)(((x)[7]<<56)|((x)[6]<<48)|((x)[5]<<40)| \
- ((x)[4]<<32)|((x)[3]<<24)|((x)[2]<<16)|((x)[1]<<8)|(x)[0]))
+#define le64atoh_x(x,off,shift) (((uint64_t)(x)[off])<<shift)
+#define le64atoh(x) ((uint64_t)(le64atoh_x(x,7,56)|le64atoh_x(x,6,48)|le64atoh_x(x,5,40)| \
+ le64atoh_x(x,4,32)|le64atoh_x(x,3,24)|le64atoh_x(x,2,16)|le64atoh_x(x,1,8)|((x)[0])))
#define htobe16a(a,x) (a)[0]=(uint8_t)((x)>>8), (a)[1]=(uint8_t)(x)
#define htobe32a(a,x) (a)[0]=(uint8_t)((x)>>24), (a)[1]=(uint8_t)((x)>>16), \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/libmtp.c new/libmtp-0.2.0/src/libmtp.c
--- old/libmtp-0.1.5/src/libmtp.c 2007-07-26 11:52:56.000000000 +0200
+++ new/libmtp-0.2.0/src/libmtp.c 2007-08-04 23:29:38.000000000 +0200
@@ -91,6 +91,8 @@
char **unicstring, uint16_t property);
static char *get_string_from_object(LIBMTP_mtpdevice_t *device, uint32_t const object_id,
uint16_t const attribute_id);
+static uint64_t get_u64_from_object(LIBMTP_mtpdevice_t *device,uint32_t const object_id,
+ uint16_t const attribute_id, uint64_t const value_default);
static uint32_t get_u32_from_object(LIBMTP_mtpdevice_t *device,uint32_t const object_id,
uint16_t const attribute_id, uint32_t const value_default);
static uint16_t get_u16_from_object(LIBMTP_mtpdevice_t *device, uint32_t const object_id,
@@ -383,6 +385,53 @@
}
/**
+* Retrieves an unsigned 64-bit integer from an object attribute
+ *
+ * @param device a pointer to an MTP device.
+ * @param object_id Object reference
+ * @param attribute_id PTP attribute ID
+ * @param value_default Default value to return on failure
+ * @return the value
+ */
+static uint64_t get_u64_from_object(LIBMTP_mtpdevice_t *device,uint32_t const object_id,
+ uint16_t const attribute_id, uint64_t const value_default)
+{
+ PTPPropertyValue propval;
+ uint64_t retval = value_default;
+ PTPParams *params = (PTPParams *) device->params;
+ uint16_t ret;
+
+ if ( device == NULL ) {
+ return value_default;
+ }
+
+ // This O(n) search should not be used so often, since code
+ // using the cached properties don't usually call this function.
+ if (params->proplist) {
+ MTPPropList *prop = params->proplist;
+
+ while (prop) {
+ if (object_id == prop->ObjectHandle && attribute_id == prop->property) {
+ return prop->propval.u64;
+ }
+ prop = prop->next;
+ }
+ }
+
+ ret = ptp_mtp_getobjectpropvalue(params, object_id,
+ attribute_id,
+ &propval,
+ PTP_DTC_UINT64);
+ if (ret == PTP_RC_OK) {
+ retval = propval.u64;
+ } else {
+ add_ptp_error_to_errorstack(device, ret, "get_u64_from_object(): could not get unsigned 64bit integer from object.");
+ }
+
+ return retval;
+}
+
+/**
* Retrieves an unsigned 32-bit integer from an object attribute
*
* @param device a pointer to an MTP device.
@@ -1136,7 +1185,10 @@
params->objectinfo[i].ObjectFormat = prop->propval.u16;
break;
case PTP_OPC_ObjectSize:
- params->objectinfo[i].ObjectCompressedSize = prop->propval.u32;
+ // We loose precision here, up to 32 bits! However the commands that
+ // retrieve metadata for files and tracks will make sure that the
+ // PTP_OPC_ObjectSize is read in and duplicated again.
+ params->objectinfo[i].ObjectCompressedSize = (uint32_t) prop->propval.u64;
break;
case PTP_OPC_StorageID:
params->objectinfo[i].StorageID = prop->propval.u32;
@@ -2398,6 +2450,8 @@
LIBMTP_file_t *retfiles = NULL;
LIBMTP_file_t *curfile = NULL;
PTPParams *params = (PTPParams *) device->params;
+ PTP_USB *ptp_usb = (PTP_USB*) device->usbinfo;
+ int ret;
// Get all the handles if we haven't already done that
if (params->handles.Handler == NULL) {
@@ -2414,7 +2468,7 @@
oi = ¶ms->objectinfo[i];
if (oi->ObjectFormat == PTP_OFC_Association) {
- // MTP use thesis object format for folders which means
+ // MTP use this object format for folders which means
// these "files" will turn up on a folder listing instead.
continue;
}
@@ -2424,18 +2478,90 @@
file->parent_id = oi->ParentObject;
+ // This is some sort of unique ID so we can keep track of the track.
+ file->item_id = params->handles.Handler[i];
+
// Set the filetype
file->filetype = map_ptp_type_to_libmtp_type(oi->ObjectFormat);
// Original file-specific properties
+ // We only have 32-bit file size here; if we find it, we use the
+ // PTP_OPC_ObjectSize property which has 64bit precision.
file->filesize = oi->ObjectCompressedSize;
if (oi->Filename != NULL) {
file->filename = strdup(oi->Filename);
}
- // This is some sort of unique ID so we can keep track of the track.
- file->item_id = params->handles.Handler[i];
-
+ /*
+ * If we have a cached, large set of metadata, then use it!
+ */
+ if (params->proplist) {
+ MTPPropList *prop = params->proplist;
+
+ while (prop != NULL && prop->ObjectHandle != file->item_id) {
+ prop = prop->next;
+ }
+ while (prop != NULL && prop->ObjectHandle == file->item_id) {
+ // Pick ObjectSize here...
+ if (prop->property == PTP_OPC_ObjectSize) {
+ // This may already be set, but this 64bit precision value
+ // is better than the PTP 32bit value, so let it override.
+ file->filesize = prop->propval.u64;
+ break;
+ }
+ prop = prop->next;
+ }
+ } else if (ptp_operation_issupported(params,PTP_OC_MTP_GetObjPropList)
+ && !(ptp_usb->device_flags & DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST)) {
+ MTPPropList *proplist = NULL;
+ MTPPropList *prop;
+
+ /*
+ * This should retrieve all properties for an object, but on devices
+ * which are inherently broken it will not, so these need the
+ * special flag DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST.
+ */
+ ret = ptp_mtp_getobjectproplist(params, file->item_id, &proplist);
+ if (ret != PTP_RC_OK) {
+ add_ptp_error_to_errorstack(device, ret, "LIBMTP_Get_Filelisting_With_Callback(): call to ptp_mtp_getobjectproplist() failed.");
+ // Silently fall through.
+ }
+ prop = proplist;
+ while (prop != NULL && prop->ObjectHandle == file->item_id) {
+ // Pick ObjectSize here...
+ if (prop->property == PTP_OPC_ObjectSize) {
+ // This may already be set, but this 64bit precision value
+ // is better than the PTP 32bit value, so let it override.
+ file->filesize = prop->propval.u64;
+ break;
+ }
+ prop = prop->next;
+ }
+ destroy_mtp_prop_list(proplist);
+ } else {
+ uint16_t *props = NULL;
+ uint32_t propcnt = 0;
+
+ // First see which properties can be retrieved for this object format
+ ret = ptp_mtp_getobjectpropssupported(params, map_libmtp_type_to_ptp_type(file->filetype), &propcnt, &props);
+ if (ret != PTP_RC_OK) {
+ add_ptp_error_to_errorstack(device, ret, "LIBMTP_Get_Filelisting_With_Callback(): call to ptp_mtp_getobjectpropssupported() failed.");
+ // Silently fall through.
+ } else {
+ for (i=0;i<propcnt;i++) {
+ switch (props[i]) {
+ case PTP_OPC_ObjectSize:
+ file->filesize = get_u64_from_object(device, file->item_id, PTP_OPC_ObjectSize, 0);
+ break;
+ default:
+ break;
+ }
+ }
+ free(props);
+ }
+ }
+
+
// Add track to a list that will be returned afterwards.
if (retfiles == NULL) {
retfiles = file;
@@ -2502,6 +2628,8 @@
file->filetype = map_ptp_type_to_libmtp_type(oi->ObjectFormat);
// Original file-specific properties
+
+ // FIXME: we only have 32-bit file size here; use the PTP_OPC_ObjectSize property
file->filesize = oi->ObjectCompressedSize;
if (oi->Filename != NULL) {
file->filename = strdup(oi->Filename);
@@ -2652,6 +2780,13 @@
case PTP_OPC_UseCount:
track->usecount = prop->propval.u32;
break;
+ case PTP_OPC_ObjectSize:
+ // This may already be set, but this 64bit precision value
+ // is better than the PTP 32bit value, so let it override.
+ track->filesize = prop->propval.u64;
+ break;
+ default:
+ break;
}
}
@@ -2761,6 +2896,11 @@
case PTP_OPC_UseCount:
track->usecount = get_u32_from_object(device, track->item_id, PTP_OPC_UseCount, 0);
break;
+ case PTP_OPC_ObjectSize:
+ // This may already be set, but this 64bit precision value
+ // is better than the PTP 32bit value, so let it override.
+ track->filesize = get_u64_from_object(device, track->item_id, PTP_OPC_ObjectSize, 0);
+ break;
}
}
free(props);
@@ -3895,6 +4035,8 @@
for (i=0;i<propcnt;i++) {
switch (props[i]) {
case PTP_OPC_Name:
+ if (metadata->title == NULL)
+ break;
ret = ptp_mtp_getobjectpropdesc(params, PTP_OPC_Name, map_libmtp_type_to_ptp_type(metadata->filetype), &opd);
if (ret != PTP_RC_OK) {
add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Update_Track_Metadata(): "
@@ -3907,14 +4049,15 @@
prop->ObjectHandle = metadata->item_id;
prop->property = PTP_OPC_Name;
prop->datatype = PTP_DTC_STR;
- if (metadata->title != NULL)
- prop->propval.str = strdup(metadata->title);
+ prop->propval.str = strdup(metadata->title);
proplist = add_mtp_prop_to_proplist(proplist, prop);
}
ptp_free_objectpropdesc(&opd);
break;
case PTP_OPC_AlbumName:
+ if (metadata->album == NULL)
+ break;
ret = ptp_mtp_getobjectpropdesc(params, PTP_OPC_AlbumName, map_libmtp_type_to_ptp_type(metadata->filetype), &opd);
if (ret != PTP_RC_OK) {
add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Update_Track_Metadata(): "
@@ -3927,14 +4070,15 @@
prop->ObjectHandle = metadata->item_id;
prop->property = PTP_OPC_AlbumName;
prop->datatype = PTP_DTC_STR;
- if (metadata->album != NULL)
- prop->propval.str = strdup(metadata->album);
- proplist = add_mtp_prop_to_proplist(proplist, prop);
+ prop->propval.str = strdup(metadata->album);
+ proplist = add_mtp_prop_to_proplist(proplist, prop);
}
ptp_free_objectpropdesc(&opd);
break;
case PTP_OPC_Artist:
+ if (metadata->artist == NULL)
+ break;
ret = ptp_mtp_getobjectpropdesc(params, PTP_OPC_Artist, map_libmtp_type_to_ptp_type(metadata->filetype), &opd);
if (ret != PTP_RC_OK) {
add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Update_Track_Metadata(): "
@@ -3947,14 +4091,15 @@
prop->ObjectHandle = metadata->item_id;
prop->property = PTP_OPC_Artist;
prop->datatype = PTP_DTC_STR;
- if (metadata->artist != NULL)
- prop->propval.str = strdup(metadata->artist);
+ prop->propval.str = strdup(metadata->artist);
proplist = add_mtp_prop_to_proplist(proplist, prop);
}
ptp_free_objectpropdesc(&opd);
break;
case PTP_OPC_Genre:
+ if (metadata->genre == NULL)
+ break;
ret = ptp_mtp_getobjectpropdesc(params, PTP_OPC_Genre, map_libmtp_type_to_ptp_type(metadata->filetype), &opd);
if (ret != PTP_RC_OK) {
add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Update_Track_Metadata(): "
@@ -3967,8 +4112,7 @@
prop->ObjectHandle = metadata->item_id;
prop->property = PTP_OPC_Genre;
prop->datatype = PTP_DTC_STR;
- if (metadata->genre != NULL)
- prop->propval.str = strdup(metadata->genre);
+ prop->propval.str = strdup(metadata->genre);
proplist = add_mtp_prop_to_proplist(proplist, prop);
}
ptp_free_objectpropdesc(&opd);
@@ -4012,6 +4156,8 @@
ptp_free_objectpropdesc(&opd);
break;
case PTP_OPC_OriginalReleaseDate:
+ if (metadata->date == NULL)
+ break;
ret = ptp_mtp_getobjectpropdesc(params, PTP_OPC_OriginalReleaseDate, map_libmtp_type_to_ptp_type(metadata->filetype), &opd);
if (ret != PTP_RC_OK) {
add_error_to_errorstack(device, LIBMTP_ERROR_GENERAL, "LIBMTP_Update_Track_Metadata(): "
@@ -4024,8 +4170,7 @@
prop->ObjectHandle = metadata->item_id;
prop->property = PTP_OPC_OriginalReleaseDate;
prop->datatype = PTP_DTC_STR;
- if (metadata->date != NULL)
- prop->propval.str = strdup(metadata->date);
+ prop->propval.str = strdup(metadata->date);
proplist = add_mtp_prop_to_proplist(proplist, prop);
}
ptp_free_objectpropdesc(&opd);
@@ -4952,7 +5097,7 @@
return -1;
}
- // now send the blank objet
+ // now send the blank object
ret = ptp_sendobject(params, NULL, 0);
if (ret != PTP_RC_OK) {
add_ptp_error_to_errorstack(device, ret, "create_new_abstract_list(): Could not send blank object data.");
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/libmtp.h new/libmtp-0.2.0/src/libmtp.h
--- old/libmtp-0.1.5/src/libmtp.h 2007-07-26 13:42:21.000000000 +0200
+++ new/libmtp-0.2.0/src/libmtp.h 2007-08-04 23:30:22.000000000 +0200
@@ -28,8 +28,8 @@
#ifndef LIBMTP_H_INCLUSION_GUARD
#define LIBMTP_H_INCLUSION_GUARD
-#define LIBMTP_VERSION 0.1.5
-#define LIBMTP_VERSION_STRING "0.1.5"
+#define LIBMTP_VERSION 0.2.0
+#define LIBMTP_VERSION_STRING "0.2.0"
/* This handles MSVC pecularities */
#ifdef _MSC_VER
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/libusb-glue.c new/libmtp-0.2.0/src/libusb-glue.c
--- old/libmtp-0.1.5/src/libusb-glue.c 2007-07-26 11:52:57.000000000 +0200
+++ new/libmtp-0.2.0/src/libusb-glue.c 2007-08-04 23:29:38.000000000 +0200
@@ -123,6 +123,8 @@
{ "Samsung YP-F2J", 0x04e8, 0x5057, DEVICE_FLAG_UNLOAD_DRIVER },
// Reported by Patrick <skibler@xxxxxxxxx>
{ "Samsung YP-K5", 0x04e8, 0x505a, DEVICE_FLAG_NO_ZERO_READS },
+ // From m.eik michalke
+ { "Samsung YP-U3", 0x04e8, 0x507d, DEVICE_FLAG_NONE },
// Reported by Matthew Wilcox <matthew@xxxxxx>
{ "Samsung YP-T9", 0x04e8, 0x507f, DEVICE_FLAG_NONE },
// From Paul Clinch
@@ -190,6 +192,8 @@
// Reported by Troy Curtis Jr.
{ "SanDisk Sansa Express", 0x0781, 0x7460, DEVICE_FLAG_UNLOAD_DRIVER |
DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST },
+ // Reported by XNJB user
+ { "SanDisk Sansa m240", 0x0781, 0x7430, DEVICE_FLAG_UNLOAD_DRIVER },
/*
@@ -252,6 +256,10 @@
{ "iRiver X20", 0x4102, 0x1132,
DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS |
DEVICE_FLAG_IRIVER_OGG_ALZHEIMER },
+ // Reported by Robert Ugo <robert_ugo@xxxxxxxxxxxxxxxxxxxxx>
+ { "iRiver T60", 0x4102, 0x1134,
+ DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS |
+ DEVICE_FLAG_IRIVER_OGG_ALZHEIMER },
// Reported by Scott Call
{ "iRiver H10 20GB", 0x4102, 0x2101,
DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST | DEVICE_FLAG_NO_ZERO_READS |
@@ -274,9 +282,11 @@
// Reported by Nicholas Tripp
{ "Toshiba Gigabeat P20", 0x0930, 0x000f, DEVICE_FLAG_NONE },
// From libgphoto2
- { "Toshiba Gigabeat S", 0x0930, 0x0010, DEVICE_FLAG_NONE },
+ { "Toshiba Gigabeat S", 0x0930, 0x0010, DEVICE_FLAG_BROKEN_MTPGETOBJPROPLIST_ALL },
// Reported by Rob Brown
{ "Toshiba Gigabeat P10", 0x0930, 0x0011, DEVICE_FLAG_NONE },
+ // Reported by Michael Davis <slithy@xxxxxxxxx>
+ { "Toshiba Gigabeat U", 0x0930, 0x0016, DEVICE_FLAG_NONE },
/*
* Archos
@@ -355,6 +365,8 @@
* Their datasheet claims their devices are dualmode so probably needs to
* unload the attached drivers here.
*/
+ // Reported by Cristi Magherusan <majeru@xxxxxxxxx>
+ {"TrekStor Vibez i.Beat sweez FM", 0x0402, 0x0611, DEVICE_FLAG_UNLOAD_DRIVER },
// Reported by Stefan Voss <svoss@xxxxxx>
{"TrekStor Vibez 8/12GB", 0x066f, 0x842a, DEVICE_FLAG_UNLOAD_DRIVER },
@@ -365,6 +377,15 @@
{"Disney MixMax", 0x0aa6, 0x6021, DEVICE_FLAG_NONE },
/*
+ * Cowon Systems, Inc.
+ * The iAudio audiophile devices don't encourage the use of MTP.
+ */
+ // Reported by Roberth Karman
+ {"Cowon iAudio 7 (MTP mode)", 0x0e21, 0x0751, DEVICE_FLAG_NONE },
+ // Reported by TJ Something <tjbk_tjb@xxxxxxxxxxxxxxxxxxxxx>
+ {"Cowon D2 (MTP mode)", 0x0e21, 0x0801, DEVICE_FLAG_NONE },
+
+ /*
* Other strange stuff.
*/
{"Isabella's prototype", 0x0b20, 0xddee, DEVICE_FLAG_NONE }
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/Makefile.am new/libmtp-0.2.0/src/Makefile.am
--- old/libmtp-0.1.5/src/Makefile.am 2007-03-27 08:56:02.000000000 +0200
+++ new/libmtp-0.2.0/src/Makefile.am 2007-08-04 23:29:38.000000000 +0200
@@ -29,9 +29,9 @@
# increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
# REVISION is set to 0, otherwise REVISION is incremented.
# ---------------------------------------------------------------------------
-CURRENT=7
-AGE=2
-REVISION=1
+CURRENT=6
+AGE=0
+REVISION=0
SOVERSION=$(CURRENT):$(REVISION):$(AGE)
if COMPILE_MINGW32
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/Makefile.in new/libmtp-0.2.0/src/Makefile.in
--- old/libmtp-0.1.5/src/Makefile.in 2007-03-27 08:56:15.000000000 +0200
+++ new/libmtp-0.2.0/src/Makefile.in 2007-08-04 23:29:53.000000000 +0200
@@ -224,9 +224,9 @@
# increment AGE, Otherwise AGE is reset to 0. If CURRENT has changed,
# REVISION is set to 0, otherwise REVISION is incremented.
# ---------------------------------------------------------------------------
-CURRENT = 7
-AGE = 2
-REVISION = 1
+CURRENT = 6
+AGE = 0
+REVISION = 0
SOVERSION = $(CURRENT):$(REVISION):$(AGE)
@COMPILE_MINGW32_TRUE@noinst_DATA = libmtp.lib
@COMPILE_MINGW32_TRUE@W32LF = -export-dynamic -no-undefined -export-symbols libmtp.sym
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/ptp.h new/libmtp-0.2.0/src/ptp.h
--- old/libmtp-0.1.5/src/ptp.h 2007-07-26 11:52:57.000000000 +0200
+++ new/libmtp-0.2.0/src/ptp.h 2007-08-03 15:18:48.000000000 +0200
@@ -761,7 +761,9 @@
int16_t i16;
uint32_t u32;
int32_t i32;
- /* XXXX: 64bit and 128 bit signed and unsigned missing */
+ uint64_t u64;
+ int64_t i64;
+ /* XXXX: 128 bit signed and unsigned missing */
struct array {
uint32_t count;
union _PTPPropertyValue *v; /* malloced, count elements */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/src/ptp-pack.c new/libmtp-0.2.0/src/ptp-pack.c
--- old/libmtp-0.1.5/src/ptp-pack.c 2007-07-26 11:52:57.000000000 +0200
+++ new/libmtp-0.2.0/src/ptp-pack.c 2007-08-03 15:18:47.000000000 +0200
@@ -32,6 +32,15 @@
htobe32a(a,val);
}
+static inline void
+htod64ap (PTPParams *params, unsigned char *a, uint64_t val)
+{
+ if (params->byteorder==PTP_DL_LE)
+ htole64a(a,val);
+ else
+ htobe64a(a,val);
+}
+
static inline uint16_t
dtoh16p (PTPParams *params, uint16_t var)
{
@@ -44,6 +53,12 @@
return ((params->byteorder==PTP_DL_LE)?le32toh(var):be32toh(var));
}
+static inline uint64_t
+dtoh64p (PTPParams *params, uint64_t var)
+{
+ return ((params->byteorder==PTP_DL_LE)?le64toh(var):be64toh(var));
+}
+
static inline uint16_t
dtoh16ap (PTPParams *params, unsigned char *a)
{
@@ -59,24 +74,16 @@
static inline uint64_t
dtoh64ap (PTPParams *params, unsigned char *a)
{
- uint64_t tmp = 0;
- int i;
-
- if (params->byteorder==PTP_DL_LE) {
- for (i=0;i<8;i++)
- tmp |= (((uint64_t)a[i]) << (8*i));
- } else {
- for (i=0;i<8;i++)
- tmp |= (((uint64_t)a[i]) << (8*(7-i)));
- }
- return tmp;
+ return ((params->byteorder==PTP_DL_LE)?le64atoh(a):be64atoh(a));
}
#define htod8a(a,x) *(uint8_t*)(a) = x
#define htod16a(a,x) htod16ap(params,a,x)
#define htod32a(a,x) htod32ap(params,a,x)
+#define htod64a(a,x) htod64ap(params,a,x)
#define htod16(x) htod16p(params,x)
#define htod32(x) htod32p(params,x)
+#define htod64(x) htod64p(params,x)
#define dtoh8a(x) (*(uint8_t*)(x))
#define dtoh16a(a) dtoh16ap(params,a)
@@ -84,6 +91,7 @@
#define dtoh64a(a) dtoh64ap(params,a)
#define dtoh16(x) dtoh16p(params,x)
#define dtoh32(x) dtoh32p(params,x)
+#define dtoh64(x) dtoh64p(params,x)
static inline char*
@@ -587,17 +595,13 @@
case PTP_DTC_UINT32:
CTVAL(value->u32,dtoh32a);
break;
-
-
-
- case PTP_DTC_UINT64:
- *offset += 8;
- /*fprintf(stderr,"unhandled unpack of uint64\n");*/
- break;
case PTP_DTC_INT64:
- *offset += 8;
- /*fprintf(stderr,"unhandled unpack of int64\n");*/
+ CTVAL(value->i64,dtoh64a);
+ break;
+ case PTP_DTC_UINT64:
+ CTVAL(value->u64,dtoh64a);
break;
+
case PTP_DTC_UINT128:
*offset += 16;
/*fprintf(stderr,"unhandled unpack of uint128n");*/
@@ -627,6 +631,12 @@
case PTP_DTC_AINT32:
RARR(value,i32,dtoh32a);
break;
+ case PTP_DTC_AUINT64:
+ RARR(value,u64,dtoh64a);
+ break;
+ case PTP_DTC_AINT64:
+ RARR(value,i64,dtoh64a);
+ break;
/* XXX: other int types are unimplemented */
/* XXX: other int arrays are unimplemented also */
case PTP_DTC_STR: {
@@ -830,47 +840,71 @@
dpv=malloc(size);
htod32a(dpv,value->u32);
break;
+ case PTP_DTC_INT64:
+ size=sizeof(int64_t);
+ dpv=malloc(size);
+ htod64a(dpv,value->i64);
+ break;
+ case PTP_DTC_UINT64:
+ size=sizeof(uint64_t);
+ dpv=malloc(size);
+ htod64a(dpv,value->u64);
+ break;
case PTP_DTC_AUINT8:
size=sizeof(uint32_t)+value->a.count*sizeof(uint8_t);
dpv=malloc(size);
htod32a(dpv,value->a.count);
for (i=0;i<value->a.count;i++)
- htod8a(&dpv[4+i],value->a.v[i].u8);
+ htod8a(&dpv[sizeof(uint32_t)+i*sizeof(uint8_t)],value->a.v[i].u8);
break;
case PTP_DTC_AINT8:
size=sizeof(uint32_t)+value->a.count*sizeof(int8_t);
dpv=malloc(size);
htod32a(dpv,value->a.count);
for (i=0;i<value->a.count;i++)
- htod8a(&dpv[4+i],value->a.v[i].i8);
+ htod8a(&dpv[sizeof(uint32_t)+i*sizeof(int8_t)],value->a.v[i].i8);
break;
case PTP_DTC_AUINT16:
size=sizeof(uint32_t)+value->a.count*sizeof(uint16_t);
dpv=malloc(size);
htod32a(dpv,value->a.count);
for (i=0;i<value->a.count;i++)
- htod16a(&dpv[4+i],value->a.v[i].u16);
+ htod16a(&dpv[sizeof(uint32_t)+i*sizeof(uint16_t)],value->a.v[i].u16);
break;
case PTP_DTC_AINT16:
size=sizeof(uint32_t)+value->a.count*sizeof(int16_t);
dpv=malloc(size);
htod32a(dpv,value->a.count);
for (i=0;i<value->a.count;i++)
- htod16a(&dpv[4+i],value->a.v[i].i16);
+ htod16a(&dpv[sizeof(uint32_t)+i*sizeof(int16_t)],value->a.v[i].i16);
break;
case PTP_DTC_AUINT32:
size=sizeof(uint32_t)+value->a.count*sizeof(uint32_t);
dpv=malloc(size);
htod32a(dpv,value->a.count);
for (i=0;i<value->a.count;i++)
- htod32a(&dpv[4+i],value->a.v[i].u32);
+ htod32a(&dpv[sizeof(uint32_t)+i*sizeof(uint32_t)],value->a.v[i].u32);
break;
case PTP_DTC_AINT32:
size=sizeof(uint32_t)+value->a.count*sizeof(int32_t);
dpv=malloc(size);
htod32a(dpv,value->a.count);
for (i=0;i<value->a.count;i++)
- htod32a(&dpv[4+i],value->a.v[i].i32);
+ htod32a(&dpv[sizeof(uint32_t)+i*sizeof(int32_t)],value->a.v[i].i32);
+ break;
+ case PTP_DTC_AUINT64:
+ size=sizeof(uint32_t)+value->a.count*sizeof(uint64_t);
+ dpv=malloc(size);
+ htod32a(dpv,value->a.count);
+ for (i=0;i<value->a.count;i++)
+ htod64a(&dpv[sizeof(uint32_t)+i*sizeof(uint64_t)],value->a.v[i].u64);
+ break;
+ case PTP_DTC_AINT64:
+ size=sizeof(uint32_t)+value->a.count*sizeof(int64_t);
+ dpv=malloc(size);
+ htod32a(dpv,value->a.count);
+ for (i=0;i<value->a.count;i++)
+ htod64a(&dpv[sizeof(uint32_t)+i*sizeof(int64_t)],value->a.v[i].i64);
break;
/* XXX: other int types are unimplemented */
case PTP_DTC_STR: {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libmtp-0.1.5/TODO new/libmtp-0.2.0/TODO
--- old/libmtp-0.1.5/TODO 2007-07-26 11:52:55.000000000 +0200
+++ new/libmtp-0.2.0/TODO 2007-08-04 23:29:37.000000000 +0200
@@ -1,6 +1,22 @@
TODO file:
----------
+COMPATIBILITY fixes:
+
+1. COMPATIBILITY: dual-mode devices, i.e. devices exposing both an MTP
+ and a USB Mass Storage Device Class (flashdrive) interface are and
+ have always been problematic. We must find a way to get this to work,
+ eventually. The problem is that the in-kernel mass storage driver hogs
+ the device before the MTP mode gets a chance of being used, whereas
+ the Windows kernel driver apparently does it the other way around,
+ trying the MTP mode first and then not fall back on mass storage if
+ MTP is available. (For some more explanations se src/libusb-glue.h.)
+ This may involve kernel modifications.
+
+2. COMPATIBILITY: several devices tend to "hang" after disconnect,
+ needing to be unplugged and replugged before they can be used again.
+ We don't know why, it may be related to low-level USB behaviour that
+ is not exposed in the logs we read.
SPEEDUP fixes:
@@ -10,6 +26,7 @@
The cache would be an array of size params->deviceinfo.ImageFormats_len
with a list for each format of the properties it will support. Notice
that this needs to be updated whenever flush_handles() is called too.
+ (THIS MAY BE DISCARDED, IT DOESN'T SEEM TO YIELD MUCH.)
FEATURE fixes:
@@ -30,18 +47,18 @@
into some /Music or /My Music folder if one exists.
5. FEATURE: Integrate libmtp with HAL / D-Bus so applications can dynamically
- know when a device has been plugged in or removed. Need a mechanism to
- connect a specific hal UDI.
-
+ know when a device has been plugged in or removed. Need a mechanism to
+ connect a specific hal UDI.
+
6. FEATURE: Mechanism to retrieve the device icon device property, else if not
- present, look for DevIcon.fil (Windows ICO format) and
- DevLogo.fil (PNG Format) images from the device (if available).
+ present, look for DevIcon.fil (Windows ICO format) and
+ DevLogo.fil (PNG Format) images from the device (if available).
-9. FEATURE: Shared device access so that multiple client applications can have
- an open connection to the device at the same time via a handle. For example,
- it should be somehow possible to run mtp-detect at the same time as amarok or
- mtpfs is connected to a device. This would require some form of resource
- sharing.
+7. FEATURE: Shared device access so that multiple client applications can have
+ an open connection to the device at the same time via a handle. For example,
+ it should be somehow possible to run mtp-detect at the same time as amarok or
+ mtpfs is connected to a device. This would require some form of resource
+ sharing.
THOSE ARE ALREADY DONE:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx
| < Previous | Next > |