OSDN Git Service

IXY210でスモール画像を取得できるようにする。(スモール画像取得シーケンス TYPE1)
authorMRSa <mrsa@myad.jp>
Sat, 2 Jan 2021 11:58:35 +0000 (20:58 +0900)
committerMRSa <mrsa@myad.jp>
Sat, 2 Jan 2021 11:58:35 +0000 (20:58 +0900)
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/command/messages/specific/CanonRequestInnerDevelopStart.java
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonPlaybackControl.java
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonReducedImageReceiver.kt
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonSmallImageReceiver.kt [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonSmallImageReceiverPrev.java [moved from app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonSmallImageReceiver.java with 97% similarity]
app/src/main/res/values/arrays.xml

index 2f8fe8a..9e089ce 100644 (file)
@@ -17,7 +17,18 @@ public class CanonRequestInnerDevelopStart  extends PtpIpCommandBase
     private final byte data2;
     private final byte data3;
 
-    public CanonRequestInnerDevelopStart(@NonNull IPtpIpCommandCallback callback, int id, boolean isDumpLog, int holdId, int objectId)
+    private final byte data4;
+    private final byte data5;
+    private final byte data6;
+    private final byte data7;
+
+    private final byte data8;
+    private final byte data9;
+    private final byte dataA;
+    private final byte dataB;
+
+
+    public CanonRequestInnerDevelopStart(@NonNull IPtpIpCommandCallback callback, int id, boolean isDumpLog, int holdId, int objectId, int dataX, int dataY)
     {
         this.callback = callback;
         this.isDumpLog = isDumpLog;
@@ -28,6 +39,17 @@ public class CanonRequestInnerDevelopStart  extends PtpIpCommandBase
         data1 = ((byte)((0x0000ff00 & objectId) >> 8));
         data2 = ((byte)((0x00ff0000 & objectId) >> 16));
         data3 = ((byte)((0xff000000 & objectId) >> 24));
+
+        data4 = ((byte) (0x000000ff & dataX));
+        data5 = ((byte)((0x0000ff00 & dataX) >> 8));
+        data6 = ((byte)((0x00ff0000 & dataX) >> 16));
+        data7 = ((byte)((0xff000000 & dataX) >> 24));
+
+        data8 = ((byte) (0x000000ff & dataY));
+        data9 = ((byte)((0x0000ff00 & dataY) >> 8));
+        dataA = ((byte)((0x00ff0000 & dataY) >> 16));
+        dataB = ((byte)((0xff000000 & dataY) >> 24));
+
     }
 
     @Override
@@ -101,8 +123,8 @@ public class CanonRequestInnerDevelopStart  extends PtpIpCommandBase
                 (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
 
                 // data
-                (byte) 0x0f, (byte) 0x00, (byte) 0x00, (byte) 0x00,
-                (byte) 0x02, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+                data4, data5, data6, data7,
+                data8, data9, dataA, dataB,
         });
     }
 
@@ -124,5 +146,4 @@ public class CanonRequestInnerDevelopStart  extends PtpIpCommandBase
         return (false);
     }
 
-
 }
index f19658a..bf250b7 100644 (file)
@@ -74,13 +74,13 @@ public class CanonPlaybackControl implements IPlaybackControl
         this.activity = activity;
         this.provider = provider;
         this.fullImageReceiver = new CanonFullImageReceiver(activity, provider.getCommandPublisher());
-        if (smallImageSequence == 1)
+        if (smallImageSequence == 2)
         {
-            this.smallImageReciever = new CanonReducedImageReceiver(activity, provider.getCommandPublisher());
+            this.smallImageReciever = new CanonReducedImageReceiver(activity, provider.getCommandPublisher(), smallImageSequence);
         }
         else
         {
-            this.smallImageReciever = new CanonSmallImageReceiver(activity, provider.getCommandPublisher());
+            this.smallImageReciever = new CanonSmallImageReceiver(activity, provider.getCommandPublisher(), smallImageSequence);
         }
         canonImageObjectReceiver = new CanonImageObjectReceiver(provider, delayMs);
     }
@@ -147,7 +147,7 @@ public class CanonPlaybackControl implements IPlaybackControl
 
                 // 画像を取得する
                 CanonScreennailImageReceiver receiver = new CanonScreennailImageReceiver(activity, objectId, publisher, callback);
-                publisher.enqueueCommand(new CanonRequestInnerDevelopStart(receiver, objectId, true, objectId, objectId));   // 0x9141 : RequestInnerDevelopStart
+                publisher.enqueueCommand(new CanonRequestInnerDevelopStart(receiver, objectId, true, objectId, objectId, 0x0f, 0x02));   // 0x9141 : RequestInnerDevelopStart
             }
         }
         catch (Exception e)
index 7b848e8..d679656 100644 (file)
@@ -4,6 +4,7 @@ import android.app.Activity
 import android.util.Log
 import net.osdn.gokigen.pkremote.camera.interfaces.playback.IDownloadContentCallback
 import net.osdn.gokigen.pkremote.camera.interfaces.playback.IProgressEvent
+import net.osdn.gokigen.pkremote.camera.utils.SimpleLogDumper
 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandCallback
 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandPublisher
 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.PtpIpCommandCanonGetPartialObject
@@ -11,8 +12,9 @@ import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.Pt
 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonRequestInnerDevelopEnd
 import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonRequestInnerDevelopStart
 import java.io.ByteArrayOutputStream
+import java.util.*
 
-class CanonReducedImageReceiver(private val activity: Activity, private val publisher: IPtpIpCommandPublisher) : IPtpIpCommandCallback, ICanonSmallImageReceiver
+class CanonReducedImageReceiver(private val activity: Activity, private val publisher: IPtpIpCommandPublisher, private val sequenceType : Int) : IPtpIpCommandCallback, ICanonSmallImageReceiver
 {
     private val mine = this
 
@@ -36,6 +38,9 @@ class CanonReducedImageReceiver(private val activity: Activity, private val publ
         }
         this.callback = callback
         this.objectId = objectId
+
+        publisher.enqueueCommand(PtpIpCommandGeneric(this, objectId + 11, false, objectId, 0x911b, 4, 0x00)) // 0x911b : SetUILock
+/*
         publisher.enqueueCommand(CanonRequestInnerDevelopStart(object : IPtpIpCommandCallback {
             override fun receivedMessage(id: Int, rx_body: ByteArray?) {
                 Log.v(TAG, " getRequestStatusEvent  : $objectId " + (rx_body?.size ?: 0))
@@ -44,6 +49,7 @@ class CanonReducedImageReceiver(private val activity: Activity, private val publ
             override fun onReceiveProgress(currentBytes: Int, totalBytes: Int, rx_body: ByteArray?) { }
             override fun isReceiveMulti(): Boolean { return (false) }
         }, objectId, false, objectId, objectId))  // 0x9141 : RequestInnerDevelopStart
+*/
     }
 
     override fun receivedMessage(id: Int, rx_body: ByteArray?)
@@ -68,7 +74,26 @@ class CanonReducedImageReceiver(private val activity: Activity, private val publ
                 (objectId + 4) -> {
                     // 画像取得終了
                     Log.v(TAG, " ----- SMALL IMAGE RECEIVE SEQUENCE FINISHED  : $objectId")
-                    callback!!.onCompleted()
+                    callback?.onCompleted()
+                    objectId = 0
+                    callback = null
+                    receivedTotalBytes = 0
+                    receivedRemainBytes = 0
+                    receivedFirstData = false
+                    System.gc()
+                }
+                (objectId + 11) -> {
+                    requestReducedObject()
+                }
+                (objectId + 12) -> {
+                    receivedReducedObject(rx_body)
+                }
+                (objectId + 13) -> {
+                    publisher.enqueueCommand(PtpIpCommandGeneric(this, objectId + 14, false, objectId, 0x911c)) // 0x911c : ResetUILock
+                }
+                (objectId + 14) -> {
+                    Log.v(TAG, " ----- SMALL IMAGE RECEIVE SEQUENCE(0x911c) FINISHED  : $objectId")
+                    callback?.onCompleted()
                     objectId = 0
                     callback = null
                     receivedTotalBytes = 0
@@ -76,8 +101,8 @@ class CanonReducedImageReceiver(private val activity: Activity, private val publ
                     receivedFirstData = false
                     System.gc()
                 }
-                (objectId + 5) -> {
-                    requestGetPartialObject(rx_body)
+                (objectId + 6) -> {
+                    Log.v(TAG, " RECEIVED 0x9141 reply.")
                 }
                 else -> {
                     Log.v(TAG, " RECEIVED UNKNOWN ID : $id")
@@ -187,11 +212,15 @@ class CanonReducedImageReceiver(private val activity: Activity, private val publ
 
     private fun requestGetPartialObject(rx_body: ByteArray?) {
         Log.v(TAG, " requestGetPartialObject() : $objectId")
+        if (rx_body != null)
+        {
+            SimpleLogDumper.dump_bytes(" requestGetPartialObject ", Arrays.copyOfRange(rx_body, 0, 64))
+        }
         isReceiveMulti = true
         receivedFirstData = false
 
         // 0x9107 : GetPartialObject  (元は 0x00020000)
-        val pictureLength: Int
+        var pictureLength: Int
         if (rx_body != null && rx_body.size > 52) {
             val dataIndex = 48
             pictureLength = (rx_body[dataIndex].toUByte().toInt() and 0xff) + (rx_body[dataIndex + 1].toUByte().toInt() and 0xff shl 8) + (rx_body[dataIndex + 2].toUByte().toInt() and 0xff shl 16) + (rx_body[dataIndex + 3].toUByte().toInt() and 0xff shl 24)
@@ -200,9 +229,33 @@ class CanonReducedImageReceiver(private val activity: Activity, private val publ
         {
             pictureLength = 0x020000
         }
+        if ((pictureLength <= 0)&&(pictureLength > 0x020000))
+        {
+            pictureLength = 0x020000
+        }
+        Log.v(TAG, " requestGetPartialObject()  size : $pictureLength ")
         publisher.enqueueCommand(PtpIpCommandCanonGetPartialObject(this, objectId + 1, false, objectId, 0x01, 0x00, pictureLength, pictureLength))
     }
 
+    private fun requestReducedObject()
+    {
+        Log.v(TAG, " requestReducedObject() : $objectId  size : 0x00200000 ")
+        isReceiveMulti = true
+        receivedFirstData = false
+        publisher.enqueueCommand(PtpIpCommandGeneric(this, objectId + 12, true, objectId, 0x916f, 12, objectId, 0x00200000, 0x00)) // 0x916f : GetReducedObject
+    }
+
+    private fun receivedReducedObject(rx_body: ByteArray?)
+    {
+        Log.v(TAG, " receivedReducedObject() : $objectId")
+        if (rx_body != null)
+        {
+            SimpleLogDumper.dump_bytes(" receivedReducedObject ", Arrays.copyOfRange(rx_body, 0, 64))
+        }
+        isReceiveMulti = false
+        publisher.enqueueCommand(PtpIpCommandGeneric(this, objectId + 13, true, objectId, 0x9177, 8, objectId, 0x00)) // 0x9177 : NotifySaveComplete
+    }
+
     private fun sendTransferComplete(rx_body: ByteArray?)
     {
         Log.v(TAG, " sendTransferComplete(), id : $objectId size: " + (rx_body?.size ?: 0))
diff --git a/app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonSmallImageReceiver.kt b/app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonSmallImageReceiver.kt
new file mode 100644 (file)
index 0000000..d9db817
--- /dev/null
@@ -0,0 +1,238 @@
+package net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.playback
+
+import android.app.Activity
+import android.util.Log
+import net.osdn.gokigen.pkremote.camera.interfaces.playback.IDownloadContentCallback
+import net.osdn.gokigen.pkremote.camera.interfaces.playback.IProgressEvent
+import net.osdn.gokigen.pkremote.camera.utils.SimpleLogDumper
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandCallback
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.IPtpIpCommandPublisher
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.PtpIpCommandCanonGetPartialObject
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.PtpIpCommandGeneric
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonRequestInnerDevelopEnd
+import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.specific.CanonRequestInnerDevelopStart
+import java.io.ByteArrayOutputStream
+import java.util.*
+
+class CanonSmallImageReceiver(private val activity: Activity, private val publisher: IPtpIpCommandPublisher, private val sequenceType : Int) : IPtpIpCommandCallback, ICanonSmallImageReceiver
+{
+    private val mine = this
+    private val isDumpLog = false
+
+    private var callback: IDownloadContentCallback? = null
+    private var objectId = 0
+    private var isReceiveMulti = false
+    private var receivedFirstData = false
+    private var receivedTotalBytes = 0
+    private var receivedRemainBytes = 0
+
+    override fun issueCommand(objectId: Int, callback: IDownloadContentCallback?)
+    {
+        Log.v(TAG, " issueCommand() : $objectId")
+        if (this.objectId != 0)
+        {
+            // already issued
+            Log.v(TAG, " COMMAND IS ALREADY ISSUED. : $objectId")
+            return
+        }
+        this.callback = callback
+        this.objectId = objectId
+        publisher.enqueueCommand(PtpIpCommandGeneric(this, objectId + 7, isDumpLog, objectId, 0x902f))
+    }
+
+    override fun receivedMessage(id: Int, rx_body: ByteArray?)
+    {
+        try
+        {
+            when (id)
+            {
+                (objectId + 7) -> {
+                    if (sequenceType == 1)
+                    {
+                        publisher.enqueueCommand(CanonRequestInnerDevelopStart(this, objectId + 8, isDumpLog, objectId, objectId, 0x06, 0x02))  // 0x9141 : RequestInnerDevelopStart
+                    }
+                    else
+                    {
+                        publisher.enqueueCommand(CanonRequestInnerDevelopStart(this, objectId + 8, isDumpLog, objectId, objectId, 0x0f, 0x02))  // 0x9141 : RequestInnerDevelopStart
+                    }
+                }
+                (objectId + 1) -> {
+                    sendTransferComplete(rx_body)
+                }
+                (objectId + 2) -> {
+                    Log.v(TAG, " requestInnerDevelopEnd() : $objectId")
+                    publisher.enqueueCommand(CanonRequestInnerDevelopEnd(this, objectId + 3, isDumpLog, objectId)) // 0x9143 : RequestInnerDevelopEnd
+                }
+                (objectId + 3) -> {
+                    // リセットコマンドを送ってみる
+                    publisher.enqueueCommand(PtpIpCommandGeneric(this, objectId + 4, isDumpLog, objectId, 0x902f))
+                }
+                (objectId + 4) -> {
+                    // 画像取得終了
+                    Log.v(TAG, " ----- SMALL IMAGE RECEIVE SEQUENCE FINISHED  : $objectId")
+                    callback?.onCompleted()
+                    objectId = 0
+                    callback = null
+                    receivedTotalBytes = 0
+                    receivedRemainBytes = 0
+                    receivedFirstData = false
+                    System.gc()
+                }
+                (objectId + 5) -> {
+                    requestGetPartialObject(rx_body)
+                }
+                (objectId + 8) -> {
+                    checkReplyInnerDevelopStart(rx_body)
+                }
+                else -> {
+                    Log.v(TAG, " RECEIVED UNKNOWN ID : $id")
+                }
+            }
+        }
+        catch (e: Exception)
+        {
+            e.printStackTrace()
+            callback?.onErrorOccurred(e)
+        }
+    }
+
+    override fun onReceiveProgress(currentBytes: Int, totalBytes: Int, rx_body: ByteArray?)
+    {
+        val body = cutHeader(rx_body)
+        val length = body?.size ?: 0
+        Log.v(TAG, " onReceiveProgress() $currentBytes/$totalBytes ($length bytes.)")
+        callback?.onProgress(body, length, object : IProgressEvent
+        {
+            override fun getProgress(): Float { return (currentBytes.toFloat() / totalBytes.toFloat()) }
+            override fun isCancellable(): Boolean { return (false) }
+            override fun requestCancellation() { }
+        })
+    }
+
+    private fun cutHeader(rx_body: ByteArray?): ByteArray?
+    {
+        if (rx_body == null)
+        {
+            return (null)
+        }
+        val length = rx_body.size
+        var dataPosition = 0
+        val byteStream = ByteArrayOutputStream()
+        if (!receivedFirstData)
+        {
+            // 初回データを読み込んだ
+            receivedFirstData = true
+
+            // データを最初に読んだとき。ヘッダ部分を読み飛ばす
+            dataPosition = rx_body[0].toUByte().toInt() and 0xff
+        }
+        else if (receivedRemainBytes > 0)
+        {
+            //Log.v(TAG, "  >>> [ remain_bytes : " + received_remain_bytes + "] ( length : " + length + ") " + data_position);
+            //SimpleLogDumper.dump_bytes("[zzz]", Arrays.copyOfRange(rx_body, data_position, (data_position + 160)));
+
+            // データの読み込みが途中だった場合...
+            if (length < receivedRemainBytes)
+            {
+                // 全部コピーする、足りないバイト数は残す
+                receivedRemainBytes = receivedRemainBytes - length
+                receivedTotalBytes = receivedTotalBytes + rx_body.size
+                return rx_body
+            }
+            else
+            {
+                byteStream.write(rx_body, dataPosition, receivedRemainBytes)
+                dataPosition = receivedRemainBytes
+                receivedRemainBytes = 0
+            }
+        }
+        while (dataPosition <= length - 12)
+        {
+            val bodySize: Int = (rx_body[dataPosition].toUByte().toInt() and 0xff) + (rx_body[dataPosition + 1].toUByte().toInt() and 0xff shl 8) + (rx_body[dataPosition + 2].toUByte().toInt() and 0xff shl 16) + (rx_body[dataPosition + 3].toUByte().toInt() and 0xff shl 24)
+            if (bodySize <= 12)
+            {
+                Log.v(TAG, "  BODY SIZE IS SMALL : " + dataPosition + " (" + bodySize + ") [" + receivedRemainBytes + "] " + rx_body.size + "  ")
+                //int startpos = (data_position > 48) ? (data_position - 48) : 0;
+                //SimpleLogDumper.dump_bytes("[xxx]", Arrays.copyOfRange(rx_body, startpos, (data_position + 48)));
+                break
+            }
+
+            // Log.v(TAG, " RX DATA : " + data_position + " (" + body_size + ") [" + received_remain_bytes + "] (" + received_total_bytes + ")");
+            //SimpleLogDumper.dump_bytes("[yyy] " + data_position + ": ", Arrays.copyOfRange(rx_body, data_position, (data_position + 64)));
+            if (dataPosition + bodySize > length)
+            {
+                // データがすべてバッファ内になかったときは、バッファすべてコピーして残ったサイズを記憶しておく。
+                val copysize = length - (dataPosition + 12)
+                byteStream.write(rx_body, dataPosition + 12, copysize)
+                receivedRemainBytes = bodySize - copysize - 12 // マイナス12は、ヘッダ分
+                receivedTotalBytes = receivedTotalBytes + copysize
+                // Log.v(TAG, " --- copy : " + (data_position + 12) + " " + copysize + " remain : " + received_remain_bytes + "  body size : " + body_size);
+                break
+            }
+            try
+            {
+                byteStream.write(rx_body, dataPosition + 12, bodySize - 12)
+                dataPosition = dataPosition + bodySize
+                receivedTotalBytes = receivedTotalBytes + 12
+                //Log.v(TAG, " --- COPY : " + (data_position + 12) + " " + (body_size - 12) + " remain : " + received_remain_bytes);
+            }
+            catch (e: Exception)
+            {
+                Log.v(TAG, "  pos : $dataPosition  size : $bodySize length : $length")
+                e.printStackTrace()
+            }
+        }
+        return byteStream.toByteArray()
+    }
+
+    override fun isReceiveMulti(): Boolean
+    {
+        return (isReceiveMulti)
+    }
+
+    private fun checkReplyInnerDevelopStart(rx_body: ByteArray?)
+    {
+        Log.v(TAG, " getRequestStatusEvent  : $objectId (" + (rx_body?.size ?: 0) + ") ")
+        publisher.enqueueCommand(PtpIpCommandGeneric(mine, objectId + 5, isDumpLog, objectId, 0x9116)) // Event Receive
+    }
+
+    private fun requestGetPartialObject(rx_body: ByteArray?) {
+        Log.v(TAG, " requestGetPartialObject() : $objectId")
+        if (rx_body != null)
+        {
+            SimpleLogDumper.dump_bytes(" requestGetPartialObject ", Arrays.copyOfRange(rx_body, 0, 64))
+        }
+        isReceiveMulti = true
+        receivedFirstData = false
+
+        // 0x9107 : GetPartialObject  (元は 0x00020000)
+        var pictureLength: Int
+        if (rx_body != null && rx_body.size > 52)
+        {
+            val dataIndex = 48
+            pictureLength = (rx_body[dataIndex].toUByte().toInt() and 0xff) + (rx_body[dataIndex + 1].toUByte().toInt() and 0xff shl 8) + (rx_body[dataIndex + 2].toUByte().toInt() and 0xff shl 16) + (rx_body[dataIndex + 3].toUByte().toInt() and 0xff shl 24)
+        }
+        else
+        {
+            pictureLength = 0x020000
+        }
+        if ((pictureLength <= 0)&&(pictureLength > 0x020000))
+        {
+            pictureLength = 0x020000
+        }
+        Log.v(TAG, " requestGetPartialObject()  size : $pictureLength ")
+        publisher.enqueueCommand(PtpIpCommandCanonGetPartialObject(this, objectId + 1, isDumpLog, objectId, 0x01, 0x00, pictureLength, pictureLength))
+    }
+
+    private fun sendTransferComplete(rx_body: ByteArray?)
+    {
+        Log.v(TAG, " sendTransferComplete(), id : $objectId size: " + (rx_body?.size ?: 0))
+        publisher.enqueueCommand(PtpIpCommandGeneric(this, objectId + 2, isDumpLog, objectId, 0x9117, 4, 0x01)) // 0x9117 : TransferComplete
+        isReceiveMulti = false
+    }
+
+    companion object
+    {
+        private val TAG = CanonSmallImageReceiver::class.java.simpleName
+    }
+}
@@ -18,7 +18,7 @@ import net.osdn.gokigen.pkremote.camera.vendor.ptpip.wrapper.command.messages.sp
 import java.io.ByteArrayOutputStream;
 
 
-public class CanonSmallImageReceiver implements IPtpIpCommandCallback, ICanonSmallImageReceiver
+public class CanonSmallImageReceiverPrev implements IPtpIpCommandCallback, ICanonSmallImageReceiver
 {
     private static final String TAG = CanonSmallImageReceiver.class.getSimpleName();
 
@@ -33,7 +33,7 @@ public class CanonSmallImageReceiver implements IPtpIpCommandCallback, ICanonSma
     private int received_total_bytes = 0;
     private int received_remain_bytes = 0;
 
-    public CanonSmallImageReceiver(@NonNull Activity activity, @NonNull IPtpIpCommandPublisher publisher)
+    public CanonSmallImageReceiverPrev(@NonNull Activity activity, @NonNull IPtpIpCommandPublisher publisher)
     {
         this.activity = activity;
         this.publisher = publisher;
@@ -66,7 +66,7 @@ public class CanonSmallImageReceiver implements IPtpIpCommandCallback, ICanonSma
             public boolean isReceiveMulti() {
                 return (false);
             }
-        }, objectId, false, objectId, objectId));   // 0x9141 : RequestInnerDevelopStart
+        }, objectId, false, objectId, objectId, 0x0f, 0x02));   // 0x9141 : RequestInnerDevelopStart
     }
 
     @Override
index d639701..b36f150 100644 (file)
     <string-array name="canon_small_picture_type">
         <item>TYPE0</item>
         <item>TYPE1</item>
+        <item>TYPE2</item>
     </string-array>
 
     <string-array name="canon_small_picture_type_value">
         <item>0</item>
         <item>1</item>
+        <item>2</item>
     </string-array>
 
 </resources>