diff options
author | Mike Lockwood <mike@spruce.(none)> | 2010-05-19 10:33:39 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-05-19 12:38:03 -0400 |
commit | 335dd2be955607f2632eabc25045857f2cc8b674 (patch) | |
tree | 59ad1930089fecf0bd70a8a9dc03db151b5d0028 /media/mtp/MtpDataPacket.cpp | |
parent | fceef46513db3507b413f604cea89e3c7f352663 (diff) | |
download | frameworks_av-335dd2be955607f2632eabc25045857f2cc8b674.zip frameworks_av-335dd2be955607f2632eabc25045857f2cc8b674.tar.gz frameworks_av-335dd2be955607f2632eabc25045857f2cc8b674.tar.bz2 |
More work on PTP host support.
Change-Id: Ifbd5bd5efa3cdb750ae1a2aae38181457554d34d
Signed-off-by: Mike Lockwood <mike@spruce.(none)>
Diffstat (limited to 'media/mtp/MtpDataPacket.cpp')
-rw-r--r-- | media/mtp/MtpDataPacket.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/media/mtp/MtpDataPacket.cpp b/media/mtp/MtpDataPacket.cpp index 71dcaee..fa086c5 100644 --- a/media/mtp/MtpDataPacket.cpp +++ b/media/mtp/MtpDataPacket.cpp @@ -75,6 +75,70 @@ void MtpDataPacket::getString(MtpStringBuffer& string) string.readFromPacket(this); } +Int8List* MtpDataPacket::getAInt8() { + Int8List* result = new Int8List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt8()); + return result; +} + +UInt8List* MtpDataPacket::getAUInt8() { + UInt8List* result = new UInt8List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt8()); + return result; +} + +Int16List* MtpDataPacket::getAInt16() { + Int16List* result = new Int16List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt16()); + return result; +} + +UInt16List* MtpDataPacket::getAUInt16() { + UInt16List* result = new UInt16List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt16()); + return result; +} + +Int32List* MtpDataPacket::getAInt32() { + Int32List* result = new Int32List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt32()); + return result; +} + +UInt32List* MtpDataPacket::getAUInt32() { + UInt32List* result = new UInt32List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt32()); + return result; +} + +Int64List* MtpDataPacket::getAInt64() { + Int64List* result = new Int64List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getInt64()); + return result; +} + +UInt64List* MtpDataPacket::getAUInt64() { + UInt64List* result = new UInt64List; + int count = getUInt32(); + for (int i = 0; i < count; i++) + result->push(getUInt64()); + return result; +} + void MtpDataPacket::putInt8(int8_t value) { allocate(mOffset + 1); mBuffer[mOffset++] = (uint8_t)value; |