use of com.aws.iot.edgeconnectorforkvs.model.EdgeConnectorForKVSConfiguration in project aws-iot-greengrass-edge-connector-for-kinesis-video-stream by awslabs.
the class EdgeConnectorForKVSService method schedulerStartTaskCallback.
@Override
public void schedulerStartTaskCallback(Constants.@NonNull JobType jobType, @NonNull String streamName) {
log.info("Start Scheduled Task - " + jobType.name() + " Stream: " + streamName);
final EdgeConnectorForKVSConfiguration edgeConnectorForKVSConfiguration = edgeConnectorForKVSConfigurationMap.get(streamName);
if (jobType == Constants.JobType.LIVE_VIDEO_STREAMING) {
liveStreamingExecutor.submit(() -> {
try {
startLiveVideoStreaming(edgeConnectorForKVSConfiguration);
} catch (Exception ex) {
log.error("Start Live Streaming Exception ({}): {}", ex.getClass().getName(), ex.getMessage());
edgeConnectorForKVSConfiguration.getFatalStatus().set(true);
}
});
} else if (jobType == Constants.JobType.LOCAL_VIDEO_CAPTURE) {
recorderService.submit(() -> {
try {
startRecordingJob(edgeConnectorForKVSConfiguration);
} catch (Exception ex) {
log.error("Start Recording Exception ({}): {}", ex.getClass().getName(), ex.getMessage());
edgeConnectorForKVSConfiguration.getFatalStatus().set(true);
}
});
}
}
Aggregations