Loading media/mtp/MtpDevice.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -483,17 +483,18 @@ MtpObjectHandle MtpDevice::sendObjectInfo(MtpObjectInfo* info) { return (MtpObjectHandle)-1; } bool MtpDevice::sendObject(MtpObjectInfo* info, int srcFD) { bool MtpDevice::sendObject(MtpObjectHandle handle, int size, int srcFD) { Mutex::Autolock autoLock(mMutex); int remaining = info->mCompressedSize; int remaining = size; mRequest.reset(); mRequest.setParameter(1, info->mHandle); mRequest.setParameter(1, handle); if (sendRequest(MTP_OPERATION_SEND_OBJECT)) { // send data header writeDataHeader(MTP_OPERATION_SEND_OBJECT, remaining); char buffer[65536]; // USB writes greater than 16K don't work char buffer[MTP_BUFFER_SIZE]; while (remaining > 0) { int count = read(srcFD, buffer, sizeof(buffer)); if (count > 0) { Loading media/mtp/MtpDevice.h +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public: MtpObjectInfo* getObjectInfo(MtpObjectHandle handle); void* getThumbnail(MtpObjectHandle handle, int& outLength); MtpObjectHandle sendObjectInfo(MtpObjectInfo* info); bool sendObject(MtpObjectInfo* info, int srcFD); bool sendObject(MtpObjectHandle handle, int size, int srcFD); bool deleteObject(MtpObjectHandle handle); MtpObjectHandle getParent(MtpObjectHandle handle); MtpObjectHandle getStorageID(MtpObjectHandle handle); Loading Loading
media/mtp/MtpDevice.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -483,17 +483,18 @@ MtpObjectHandle MtpDevice::sendObjectInfo(MtpObjectInfo* info) { return (MtpObjectHandle)-1; } bool MtpDevice::sendObject(MtpObjectInfo* info, int srcFD) { bool MtpDevice::sendObject(MtpObjectHandle handle, int size, int srcFD) { Mutex::Autolock autoLock(mMutex); int remaining = info->mCompressedSize; int remaining = size; mRequest.reset(); mRequest.setParameter(1, info->mHandle); mRequest.setParameter(1, handle); if (sendRequest(MTP_OPERATION_SEND_OBJECT)) { // send data header writeDataHeader(MTP_OPERATION_SEND_OBJECT, remaining); char buffer[65536]; // USB writes greater than 16K don't work char buffer[MTP_BUFFER_SIZE]; while (remaining > 0) { int count = read(srcFD, buffer, sizeof(buffer)); if (count > 0) { Loading
media/mtp/MtpDevice.h +1 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,7 @@ public: MtpObjectInfo* getObjectInfo(MtpObjectHandle handle); void* getThumbnail(MtpObjectHandle handle, int& outLength); MtpObjectHandle sendObjectInfo(MtpObjectInfo* info); bool sendObject(MtpObjectInfo* info, int srcFD); bool sendObject(MtpObjectHandle handle, int size, int srcFD); bool deleteObject(MtpObjectHandle handle); MtpObjectHandle getParent(MtpObjectHandle handle); MtpObjectHandle getStorageID(MtpObjectHandle handle); Loading