ios和android录屏视频文件无法播放、线程阻塞,无法GC
parent
509a7278fc
commit
8e8b116492
|
@ -138,15 +138,10 @@ public class AndroidAgentSession {
|
|||
* 安静地关闭流
|
||||
*/
|
||||
public void closeSilence() {
|
||||
try {
|
||||
state = false;
|
||||
logger.debug("关闭设备【{}】的agentSession连接",serial);
|
||||
if (transport != null) {
|
||||
transport.close();
|
||||
}
|
||||
} catch (IOException ignore) {
|
||||
|
||||
if (null != this.sendThread) {
|
||||
this.sendThread.interrupt();
|
||||
}
|
||||
state = false;
|
||||
}
|
||||
|
||||
private class CommandSendThread extends Thread {
|
||||
|
@ -168,7 +163,14 @@ public class AndroidAgentSession {
|
|||
break;
|
||||
}
|
||||
}
|
||||
closeSilence();
|
||||
try {
|
||||
logger.debug("关闭设备【{}】的agentSession连接",serial);
|
||||
if (transport != null) {
|
||||
transport.close();
|
||||
}
|
||||
} catch (IOException ignore) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package net.northking.cctp.upperComputer.service;
|
|||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.img.ImgUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.appium.java_client.AppiumDriver;
|
||||
import io.appium.java_client.android.AndroidDriver;
|
||||
import io.appium.java_client.ios.IOSDriver;
|
||||
|
@ -864,17 +865,20 @@ public class AndroidDebuggerServiceImpl extends AbstractDebuggerService {
|
|||
|
||||
@Override
|
||||
public String endRecord(DebuggerDeviceInfo info) {
|
||||
String result = null;
|
||||
String videoUrl = null;
|
||||
logger.info("收到设备【{}】在任务【{}】关闭录屏的请求............",info.getDeviceId(),info.getTaskId());
|
||||
AndroidScreenResponseThread screenThread = AndroidDeviceManager.getInstance().getScreenThread(info.getDeviceId());
|
||||
if (null != screenThread && screenThread.isAlive() && !screenThread.isInterrupted()) {
|
||||
result = screenThread.stopRecord();
|
||||
return result;
|
||||
String result = screenThread.stopRecord();
|
||||
JSONObject jsonObject = JSON.parseObject(result, JSONObject.class);
|
||||
videoUrl = jsonObject.getString("videoUrl");
|
||||
logger.info("设备【{}】在任务【{}】录屏关闭,得到的视频地址为:{}",info.getDeviceId(),info.getTaskId(),videoUrl);
|
||||
return videoUrl;
|
||||
} else {
|
||||
logger.info("设备【{}】在任务【{}】录屏不存在............",info.getDeviceId(),info.getTaskId());
|
||||
}
|
||||
logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),result);
|
||||
return result;
|
||||
logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),videoUrl);
|
||||
return videoUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -248,17 +248,20 @@ public class IosDebuggerServiceImpl extends AbstractDebuggerService {
|
|||
|
||||
@Override
|
||||
public String endRecord(DebuggerDeviceInfo info) {
|
||||
String result = null;
|
||||
String videoUrl = null;
|
||||
logger.info("收到设备【{}】在任务【{}】关闭录屏的请求............",info.getDeviceId(),info.getTaskId());
|
||||
IosScreenResponseThread screenThread = IOSDeviceManager.getInstance().getScreenThread(info.getDeviceId());
|
||||
if (null != screenThread && screenThread.isAlive() && !screenThread.isInterrupted()) {
|
||||
result = screenThread.stopRecord();
|
||||
return result;
|
||||
String result = screenThread.stopRecord();
|
||||
JSONObject jsonObject = JSON.parseObject(result, JSONObject.class);
|
||||
videoUrl = jsonObject.getString("videoUrl");
|
||||
logger.info("设备【{}】在任务【{}】录屏关闭,得到的视频地址为:{}",info.getDeviceId(),info.getTaskId(),videoUrl);
|
||||
return videoUrl;
|
||||
} else {
|
||||
logger.info("设备【{}】在任务【{}】录屏不存在............",info.getDeviceId(),info.getTaskId());
|
||||
}
|
||||
logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),result);
|
||||
return result;
|
||||
logger.info("设备【{}】在任务【{}】录屏保存的地址:{}............",info.getDeviceId(),info.getTaskId(),videoUrl);
|
||||
return videoUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue