summaryrefslogtreecommitdiffstats
path: root/media/mtp/MtpDataPacket.h
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-07-14 21:00:02 -0400
committerMike Lockwood <lockwood@android.com>2011-07-17 15:53:53 -0400
commitef441d965504dbf31c5db690e5b34fcdcecd92ff (patch)
tree4c4bd3804dffe1e472c94e1d2d42a3ece615cde6 /media/mtp/MtpDataPacket.h
parente0b5bb23f0a26d248275d203885b820659da7320 (diff)
downloadframeworks_av-ef441d965504dbf31c5db690e5b34fcdcecd92ff.zip
frameworks_av-ef441d965504dbf31c5db690e5b34fcdcecd92ff.tar.gz
frameworks_av-ef441d965504dbf31c5db690e5b34fcdcecd92ff.tar.bz2
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 <lockwood@android.com>
Diffstat (limited to 'media/mtp/MtpDataPacket.h')
-rw-r--r--media/mtp/MtpDataPacket.h3
1 files changed, 1 insertions, 2 deletions
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