mirror of https://github.com/OpenVidu/openvidu.git
RecordingDownloader logic
parent
3ca64d9cca
commit
78602702b8
|
@ -44,6 +44,12 @@ public class Recording {
|
|||
*/
|
||||
stopped,
|
||||
|
||||
/**
|
||||
* The recording has stopped but is being processed. This status will change to
|
||||
* stopped/available or failed
|
||||
*/
|
||||
processing,
|
||||
|
||||
/**
|
||||
* The recording is available for downloading. This status is reached for all
|
||||
* stopped recordings if
|
||||
|
|
|
@ -115,6 +115,12 @@ export namespace Recording {
|
|||
*/
|
||||
stopped = 'stopped',
|
||||
|
||||
/**
|
||||
* The recording has stopped but is being processed. This status will change to
|
||||
* stopped/available or failed when processing ends
|
||||
*/
|
||||
processing = 'processing',
|
||||
|
||||
/**
|
||||
* The recording is available for downloading. This status is reached for all
|
||||
* stopped recordings if [OpenVidu Server configuration](https://openvidu.io/docs/reference-docs/openvidu-server-params/)
|
||||
|
|
|
@ -56,6 +56,8 @@ import io.openvidu.server.kurento.kms.DummyLoadManager;
|
|||
import io.openvidu.server.kurento.kms.FixedOneKmsManager;
|
||||
import io.openvidu.server.kurento.kms.KmsManager;
|
||||
import io.openvidu.server.kurento.kms.LoadManager;
|
||||
import io.openvidu.server.recording.DummyRecordingDownloader;
|
||||
import io.openvidu.server.recording.RecordingDownloader;
|
||||
import io.openvidu.server.recording.service.RecordingManager;
|
||||
import io.openvidu.server.rpc.RpcHandler;
|
||||
import io.openvidu.server.rpc.RpcNotificationService;
|
||||
|
@ -151,6 +153,12 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
|||
return new RecordingManager();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public RecordingDownloader recordingDownload() {
|
||||
return new DummyRecordingDownloader();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public CoturnCredentialsService coturnCredentialsService() {
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package io.openvidu.server.recording;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
public class DummyRecordingDownloader implements RecordingDownloader {
|
||||
|
||||
@Override
|
||||
public void downloadRecording(Recording recording, Collection<String> streamIds) throws IOException {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* (C) Copyright 2017-2019 OpenVidu (https://openvidu.io/)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package io.openvidu.server.recording;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
|
||||
public interface RecordingDownloader {
|
||||
|
||||
public void downloadRecording(Recording recording, Collection<String> streamIds) throws IOException;
|
||||
|
||||
}
|
|
@ -65,6 +65,7 @@ import io.openvidu.server.core.SessionManager;
|
|||
import io.openvidu.server.kurento.core.KurentoSession;
|
||||
import io.openvidu.server.kurento.kms.KmsManager;
|
||||
import io.openvidu.server.recording.Recording;
|
||||
import io.openvidu.server.recording.RecordingDownloader;
|
||||
import io.openvidu.server.utils.CustomFileManager;
|
||||
import io.openvidu.server.utils.DockerManager;
|
||||
|
||||
|
@ -82,6 +83,9 @@ public class RecordingManager {
|
|||
@Autowired
|
||||
private SessionManager sessionManager;
|
||||
|
||||
@Autowired
|
||||
private RecordingDownloader recordingDownloader;
|
||||
|
||||
@Autowired
|
||||
protected OpenviduConfig openviduConfig;
|
||||
|
||||
|
@ -109,8 +113,8 @@ public class RecordingManager {
|
|||
RecordingManager.IMAGE_TAG = openviduConfig.getOpenViduRecordingVersion();
|
||||
|
||||
this.dockerManager = new DockerManager();
|
||||
this.composedRecordingService = new ComposedRecordingService(this, openviduConfig);
|
||||
this.singleStreamRecordingService = new SingleStreamRecordingService(this, openviduConfig);
|
||||
this.composedRecordingService = new ComposedRecordingService(this, recordingDownloader, openviduConfig);
|
||||
this.singleStreamRecordingService = new SingleStreamRecordingService(this, recordingDownloader, openviduConfig);
|
||||
|
||||
log.info("Recording module required: Downloading openvidu/openvidu-recording:"
|
||||
+ openviduConfig.getOpenViduRecordingVersion() + " Docker image (350MB aprox)");
|
||||
|
@ -225,7 +229,8 @@ public class RecordingManager {
|
|||
}
|
||||
break;
|
||||
case INDIVIDUAL:
|
||||
recording = this.singleStreamRecordingService.stopRecording(session, recording, reason, kmsDisconnectionTime);
|
||||
recording = this.singleStreamRecordingService.stopRecording(session, recording, reason,
|
||||
kmsDisconnectionTime);
|
||||
break;
|
||||
}
|
||||
this.abortAutomaticRecordingStopThread(session);
|
||||
|
|
|
@ -30,6 +30,7 @@ import io.openvidu.server.config.OpenviduConfig;
|
|||
import io.openvidu.server.core.EndReason;
|
||||
import io.openvidu.server.core.Session;
|
||||
import io.openvidu.server.recording.Recording;
|
||||
import io.openvidu.server.recording.RecordingDownloader;
|
||||
import io.openvidu.server.utils.CommandExecutor;
|
||||
import io.openvidu.server.utils.CustomFileManager;
|
||||
|
||||
|
@ -39,10 +40,13 @@ public abstract class RecordingService {
|
|||
|
||||
protected OpenviduConfig openviduConfig;
|
||||
protected RecordingManager recordingManager;
|
||||
protected RecordingDownloader recordingDownloader;
|
||||
protected CustomFileManager fileWriter = new CustomFileManager();
|
||||
|
||||
RecordingService(RecordingManager recordingManager, OpenviduConfig openviduConfig) {
|
||||
RecordingService(RecordingManager recordingManager, RecordingDownloader recordingDownloader,
|
||||
OpenviduConfig openviduConfig) {
|
||||
this.recordingManager = recordingManager;
|
||||
this.recordingDownloader = recordingDownloader;
|
||||
this.openviduConfig = openviduConfig;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue