From 4922755876841b51da5f4dd6cb21aec9c7607932 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 6 Nov 2024 14:06:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B9=E5=90=91=E7=9A=84?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xypower/mpremote/DeviceActivity.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/xypower/mpremote/DeviceActivity.java b/app/src/main/java/com/xypower/mpremote/DeviceActivity.java index c52cda8..d612027 100644 --- a/app/src/main/java/com/xypower/mpremote/DeviceActivity.java +++ b/app/src/main/java/com/xypower/mpremote/DeviceActivity.java @@ -213,7 +213,6 @@ public class DeviceActivity extends AppCompatActivity { } }); - final File fileTmp = new File(getFilesDir(), "tmp"); if (!fileTmp.exists()) { fileTmp.mkdirs(); @@ -664,12 +663,30 @@ public class DeviceActivity extends AppCompatActivity { } private void showStreaming(int channel, int cameraId, final String url, String localIp) { + + int rotation = -1; + int usb = 0; + Integer chVal = Integer.valueOf(channel); + if (mChannelCfgs.containsKey(chVal)) { + JSONObject jsonChannel = mChannelCfgs.get(chVal); + + if (jsonChannel != null) { + int orientation = jsonChannel.optInt("orientation", 0); + if (orientation > 0) { + rotation = (orientation - 1) * 90; + } + usb = jsonChannel.optInt("usbCamera", 0); + } + } + Intent intent = new Intent(this, StreamActivity.class); intent.putExtra("url", url); intent.putExtra("localIp", localIp); intent.putExtra("deviceIp", mDeviceIp); intent.putExtra("cameraId", cameraId); intent.putExtra("channel", channel); + intent.putExtra("rotation", rotation); + intent.putExtra("usb", usb); intent.putExtra("cmdid", TextUtils.isEmpty(mAppConfig.cmdid) ? "" : mAppConfig.cmdid); // intent.putExtra("info", info); startActivity(intent);