[*] 本地录像

This commit is contained in:
acgist
2023-06-02 07:17:10 +08:00
parent a06f6a251f
commit becc68b05f
19 changed files with 404 additions and 179 deletions

View File

@@ -8,7 +8,9 @@
android:extractNativeLibs="true"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:killAfterRestore="true"
android:label="@string/app_name"
android:persistent="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true">
<activity

View File

@@ -625,10 +625,10 @@ public final class Taoyao implements ITaoyao {
case "client::reboot" -> this.clientReboot(message, message.body());
case "client::register" -> this.clientRegister(message, message.body());
case "client::shutdown" -> this.clientShutdown(message, message.body());
case "control::client::record" -> this.controlClientRecord(message, message.body());
case "control::config::audio" -> this.controlConfigAudio(message, message.body());
case "control::config::video" -> this.controlConfigVideo(message, message.body());
case "control::photograph" -> this.controlPhotograph(message, message.body());
case "control::record" -> this.controlRecord(message, message.body());
case "media::audio::volume" -> this.mediaAudioVolume(message, message.body());
case "media::consume" -> this.mediaConsume(message, message.body());
case "media::consumer::close" -> this.mediaConsumerClose(message, message.body());
@@ -751,6 +751,26 @@ public final class Taoyao implements ITaoyao {
Process.killProcess(Process.myPid());
}
/**
* 录像
*
* @param message 信令消息
* @param body 信令主体
*/
private void controlClientRecord(Message message, Map<String, Object> body) {
String filepath;
final Boolean enabled = MapUtils.getBoolean(body, "enabled");
if(Boolean.TRUE.equals(enabled)) {
final RecordClient recordClient = this.mediaManager.startRecord();
filepath = recordClient.getFilepath();
} else {
filepath = this.mediaManager.stopRecord();
}
body.put("enabled", enabled);
body.put("filepath", filepath);
this.push(message);
}
/**
* 更新音频配置
*
@@ -785,26 +805,6 @@ public final class Taoyao implements ITaoyao {
this.push(message);
}
/**
* 录像
*
* @param message 信令消息
* @param body 信令主体
*/
private void controlRecord(Message message, Map<String, Object> body) {
String filepath;
final Boolean enabled = MapUtils.getBoolean(body, "enabled");
if(Boolean.TRUE.equals(enabled)) {
final RecordClient recordClient = this.mediaManager.startRecord();
filepath = recordClient.getFilepath();
} else {
filepath = this.mediaManager.stopRecord();
}
body.put("enabled", enabled);
body.put("filepath", filepath);
this.push(message);
}
/**
* 远程音量
*