[*] 服务端录像资源释放
This commit is contained in:
@@ -8,8 +8,6 @@ android {
|
||||
defaultConfig {
|
||||
minSdk rootProject.ext.taoyao.minSdk
|
||||
targetSdk rootProject.ext.taoyao.targetSdk
|
||||
versionCode rootProject.ext.taoyao.versionCode
|
||||
versionName rootProject.ext.taoyao.versionName
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
}
|
||||
buildTypes {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id 'com.android.library' version '7.4.2' apply false
|
||||
id 'com.android.application' version '7.4.2' apply false
|
||||
id 'com.android.library' version '8.0.1' apply false
|
||||
id 'com.android.application' version '8.0.1' apply false
|
||||
}
|
||||
ext {
|
||||
taoyao = [
|
||||
|
||||
@@ -10,7 +10,6 @@ android {
|
||||
targetSdk rootProject.ext.taoyao.targetSdk
|
||||
versionCode rootProject.ext.taoyao.versionCode
|
||||
versionName rootProject.ext.taoyao.versionName
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
applicationId "com.acgist.taoyao.client"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
org.gradle.jvmargs=-Xmx512m -Dfile.encoding=UTF-8
|
||||
android.useAndroidX=true
|
||||
android.nonFinalResIds=false
|
||||
android.nonTransitiveRClass=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Mon Mar 20 09:51:37 CST 2023
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
|
||||
@@ -12,8 +12,6 @@ android {
|
||||
defaultConfig {
|
||||
minSdk rootProject.ext.taoyao.minSdk
|
||||
targetSdk rootProject.ext.taoyao.targetSdk
|
||||
versionCode rootProject.ext.taoyao.versionCode
|
||||
versionName rootProject.ext.taoyao.versionName
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
|
||||
@@ -900,7 +900,7 @@ class Taoyao {
|
||||
if(!filepath || !videoConsumer) {
|
||||
return;
|
||||
}
|
||||
if(++index >= 10) {
|
||||
if(++index > 10) {
|
||||
console.warn("请求录像关键帧次数超限", filepath, index);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,16 +31,17 @@ import com.acgist.taoyao.signal.protocol.ProtocolControlAdapter;
|
||||
body = {
|
||||
"""
|
||||
{
|
||||
"to": "目标终端ID",
|
||||
"roomId": "房间ID",
|
||||
"to" : "目标终端ID",
|
||||
"roomId" : "房间ID",
|
||||
"enabled": 是否录像(true|false)
|
||||
}
|
||||
""",
|
||||
"""
|
||||
{
|
||||
"roomId": "房间ID",
|
||||
"enabled": 是否录像(true|false),
|
||||
"filepath": "视频文件路径"
|
||||
"roomId" : "房间ID",
|
||||
"enabled" : 是否录像(true|false),
|
||||
"filepath": "视频文件路径",
|
||||
"clientId": "录像终端ID"
|
||||
}
|
||||
"""
|
||||
},
|
||||
@@ -75,6 +76,7 @@ public class ControlServerRecordProtocol extends ProtocolControlAdapter implemen
|
||||
filepath = this.stop(room, room.clientWrapper(client));
|
||||
}
|
||||
body.put(Constant.FILEPATH, filepath);
|
||||
body.put(Constant.CLIENT_ID, clientId);
|
||||
client.push(message);
|
||||
}
|
||||
|
||||
@@ -97,7 +99,8 @@ public class ControlServerRecordProtocol extends ProtocolControlAdapter implemen
|
||||
return Message.success(Map.of(
|
||||
Constant.ROOM_ID, roomId,
|
||||
Constant.ENABLED, enabled,
|
||||
Constant.FILEPATH, filepath
|
||||
Constant.FILEPATH, filepath,
|
||||
Constant.CLIENT_ID, clientId
|
||||
));
|
||||
}
|
||||
|
||||
@@ -181,14 +184,14 @@ public class ControlServerRecordProtocol extends ProtocolControlAdapter implemen
|
||||
// 关闭媒体录像
|
||||
final Message message = this.build();
|
||||
final Map<String, Object> body = new HashMap<>();
|
||||
body.put(Constant.ROOM_ID, room.getRoomId());
|
||||
body.put(Constant.ENABLED, false);
|
||||
body.put(Constant.AUDIO_STREAM_ID, recorder.getAudioStreamId());
|
||||
body.put(Constant.VIDEO_STREAM_ID, recorder.getVideoStreamId());
|
||||
body.put(Constant.AUDIO_CONSUMER_ID, recorder.getAudioConsumerId());
|
||||
body.put(Constant.VIDEO_CONSUMER_ID, recorder.getVideoConsumerId());
|
||||
body.put(Constant.AUDIO_TRANSPORT_ID, recorder.getAudioTransportId());
|
||||
body.put(Constant.VIDEO_TRANSPORT_ID, recorder.getVideoConsumerId());
|
||||
body.put(Constant.ROOM_ID, room.getRoomId());
|
||||
body.put(Constant.ENABLED, false);
|
||||
body.put(Constant.VIDEO_TRANSPORT_ID, recorder.getVideoTransportId());
|
||||
message.setBody(body);
|
||||
final Client mediaClient = room.getMediaClient();
|
||||
mediaClient.request(message);
|
||||
|
||||
Reference in New Issue
Block a user