From ef441d965504dbf31c5db690e5b34fcdcecd92ff Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 14 Jul 2011 21:00:02 -0400 Subject: MTP: Use a single packet for the data phase instead of sending 12 byte header in a separate packet. PTP on the Mac is much happier with this approach. Change-Id: I7d1ca498f6346afd88876d24332187b466fc469c Signed-off-by: Mike Lockwood --- media/mtp/MtpDataPacket.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'media/mtp/MtpDataPacket.h') diff --git a/media/mtp/MtpDataPacket.h b/media/mtp/MtpDataPacket.h index 8a08948..2b81063 100644 --- a/media/mtp/MtpDataPacket.h +++ b/media/mtp/MtpDataPacket.h @@ -41,6 +41,7 @@ public: void setOperationCode(MtpOperationCode code); void setTransactionID(MtpTransactionID id); + inline const uint8_t* getData() const { return mBuffer + MTP_CONTAINER_HEADER_SIZE; } inline uint8_t getUInt8() { return (uint8_t)mBuffer[mOffset++]; } inline int8_t getInt8() { return (int8_t)mBuffer[mOffset++]; } uint16_t getUInt16(); @@ -95,11 +96,9 @@ public: #ifdef MTP_DEVICE // fill our buffer with data from the given file descriptor int read(int fd); - int readDataHeader(int fd); // write our data to the given file descriptor int write(int fd); - int writeDataHeader(int fd, uint32_t length); int writeData(int fd, void* data, uint32_t length); #endif -- cgit v1.1