diff options
author | Mike Lockwood <lockwood@android.com> | 2010-11-19 11:20:19 -0500 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-11-19 11:30:10 -0500 |
commit | 954c267725d64a37655d6f3a00de6a5aa00ddaf8 (patch) | |
tree | 9e3681b141c3bc3f6df5c93712bb56067baa06e3 /media/mtp/MtpDataPacket.h | |
parent | a8bbc11afc0f93143c1fd200108a51c95507cc43 (diff) | |
download | frameworks_base-954c267725d64a37655d6f3a00de6a5aa00ddaf8.zip frameworks_base-954c267725d64a37655d6f3a00de6a5aa00ddaf8.tar.gz frameworks_base-954c267725d64a37655d6f3a00de6a5aa00ddaf8.tar.bz2 |
PTP: Improve performance and reliability of file importing
Now the file copy is done completely within the media process
rather than pushing data to the client via ContProvider.openFile().
File system writes are now interleaved with USB reads, which allows us
to copy the data faster and prevents the camera from timing out during transfer.
File is automatically inserted in the media provider after a successful import
and a Uri is returned to the client.
BUG: 2994234
Change-Id: Ie75c63da76f623343d3d966c6a707aa1ae871972
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'media/mtp/MtpDataPacket.h')
-rw-r--r-- | media/mtp/MtpDataPacket.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/media/mtp/MtpDataPacket.h b/media/mtp/MtpDataPacket.h index fab6a07..3ae6226 100644 --- a/media/mtp/MtpDataPacket.h +++ b/media/mtp/MtpDataPacket.h @@ -102,6 +102,8 @@ public: #ifdef MTP_HOST int read(struct usb_endpoint *ep); int readData(struct usb_endpoint *ep, void* buffer, int length); + int readDataAsync(struct usb_endpoint *ep, void* buffer, int length); + int readDataWait(struct usb_endpoint *ep); int readDataHeader(struct usb_endpoint *ep); int writeDataHeader(struct usb_endpoint *ep, uint32_t length); @@ -110,6 +112,7 @@ public: #endif inline bool hasData() const { return mPacketSize > MTP_CONTAINER_HEADER_SIZE; } + inline uint32_t getContainerLength() const { return MtpPacket::getUInt32(MTP_CONTAINER_LENGTH_OFFSET); } void* getData(int& outLength) const; }; |