use of com.att.aro.datacollector.ioscollector.video.VideoCaptureMacOS in project VideoOptimzer by attdevsupport.
the class IOSCollectorImpl method startVideoCapture.
private StatusResult startVideoCapture(StatusResult status) {
LOG.info("startVideoCapture");
GoogleAnalyticsUtil.getGoogleAnalyticsInstance().sendAnalyticsEvents(GoogleAnalyticsUtil.getAnalyticsEvents().getIosCollector(), GoogleAnalyticsUtil.getAnalyticsEvents().getVideoCheck());
if (videoCapture == null) {
final String videofilepath = datadir + Util.FILE_SEPARATOR + TraceDataConst.FileName.VIDEO_MOV_FILE;
videofile = new File(videofilepath);
try {
videoCapture = new VideoCaptureMacOS(videofile, udId);
} catch (IOException e) {
LOG.error(rvi.getErrorMessage());
status.setSuccess(false);
status.setError(ErrorCodeRegistry.getrviError());
return status;
}
videoCapture.setWorkingFolder(datadir);
videoCapture.addSubscriber(this);
}
videoworker = new SwingWorker<String, Object>() {
@Override
protected String doInBackground() throws Exception {
if (videoCapture != null) {
videoCapture.start();
}
return null;
}
@Override
protected void done() {
try {
get();
if (videoCapture.getStatusResult() != null) {
StatusResult temp = videoCapture.getStatusResult();
status.setError(temp.getError());
status.setSuccess(temp.isSuccess());
}
} catch (Exception ex) {
LOG.error("Error thrown by videoworker: ", ex);
}
}
};
videoworker.execute();
return status;
}
Aggregations