OSDN Git Service

IXY210でスモール画像を取得できるようにするその2。(スモール画像取得シーケンス TYPE1対応)
authorMRSa <mrsa@myad.jp>
Sat, 2 Jan 2021 15:11:56 +0000 (00:11 +0900)
committerMRSa <mrsa@myad.jp>
Sat, 2 Jan 2021 15:11:56 +0000 (00:11 +0900)
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/command/PtpIpCommandPublisher.kt
app/src/main/java/net/osdn/gokigen/pkremote/camera/vendor/ptpip/wrapper/playback/CanonPlaybackControl.java
app/src/main/res/values-ja/strings.xml

index b181035..71fdae6 100644 (file)
@@ -651,7 +651,7 @@ class PtpIpCommandPublisher(private val ipAddress : String, private val portNumb
                 }
                 if (byte_array[offset + 4].toUByte().toInt() == 0x09)
                 {
-                    // データバイト...
+                    // データバイト... (Start Data Packet で データレングスを特定する
                     lenlen = (byte_array[offset + 15].toUByte().toInt() and 0xff shl 24) + (byte_array[offset + 14].toUByte().toInt() and 0xff shl 16) + (byte_array[offset + 13].toUByte().toInt() and 0xff shl 8) + (byte_array[offset + 12].toUByte().toInt() and 0xff)
                 }
             }
index bf250b7..a6fce5e 100644 (file)
@@ -36,10 +36,10 @@ public class CanonPlaybackControl implements IPlaybackControl
     private String raw_suffix = "CR2";
     private boolean useScreennailImage = false;
     private final CanonImageObjectReceiver canonImageObjectReceiver;
+    private int smallImageSequence = 0;
 
     public CanonPlaybackControl(Activity activity, PtpIpInterfaceProvider provider)
     {
-        int smallImageSequence = 0;
         int delayMs = 20;
         try
         {
@@ -147,7 +147,14 @@ public class CanonPlaybackControl implements IPlaybackControl
 
                 // 画像を取得する
                 CanonScreennailImageReceiver receiver = new CanonScreennailImageReceiver(activity, objectId, publisher, callback);
-                publisher.enqueueCommand(new CanonRequestInnerDevelopStart(receiver, objectId, true, objectId, objectId, 0x0f, 0x02));   // 0x9141 : RequestInnerDevelopStart
+                if (smallImageSequence == 1)
+                {
+                    publisher.enqueueCommand(new CanonRequestInnerDevelopStart(receiver, objectId, true, objectId, objectId, 0x06, 0x02));   // 0x9141 : RequestInnerDevelopStart
+                }
+                else
+                {
+                    publisher.enqueueCommand(new CanonRequestInnerDevelopStart(receiver, objectId, true, objectId, objectId, 0x0f, 0x02));   // 0x9141 : RequestInnerDevelopStart
+                }
             }
         }
         catch (Exception e)
index 4c607b8..e0931e3 100644 (file)
     <string name="pref_summary_canon_connection_mode">通常、変更は不要です (初期値: TYPE0)</string>
 
     <string name="pref_canon_small_picture_type">スモール画像取得シーケンス</string>
-    <string name="pref_summary_canon_small_picture_type">(初期値: TYPE0)</string>
+    <string name="pref_summary_canon_small_picture_type">スモール画像がうまく取得できない場合、設定を変更してみてください。 (初期値: TYPE0)</string>
 
 </resources>