Search in sources :

Example 1 with VideoCaptureMacOS

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;
}
Also used : VideoCaptureMacOS(com.att.aro.datacollector.ioscollector.video.VideoCaptureMacOS) StatusResult(com.att.aro.core.datacollector.pojo.StatusResult) IOException(java.io.IOException) File(java.io.File) IOException(java.io.IOException)

Aggregations

StatusResult (com.att.aro.core.datacollector.pojo.StatusResult)1 VideoCaptureMacOS (com.att.aro.datacollector.ioscollector.video.VideoCaptureMacOS)1 File (java.io.File)1 IOException (java.io.IOException)1