use of co.videofirst.vft.capture.model.display.DisplayCapture in project vft-capture by videofirst.
the class CaptureStatus method record.
/**
* Generate a CaptureStatus object from an existing capture status object
*/
public CaptureStatus record(DisplayCapture displayCapture) {
if (state != CaptureState.recording) {
// 1) Set started to now
LocalDateTime started = LocalDateTime.now();
// 2) Create id from started time + random string
String id = VftUtils.generateId(started);
// 3) Create folder (from categories)
List<String> categoryFolders = VftUtils.getFolderFriendlyCategories(getCategories(), getFeature(), getScenario(), id);
String folder = String.join("/", categoryFolders);
// 4) Create and return capture object from existing one
Capture capture = this.getCapture().toBuilder().started(started).folder(folder).id(id).capture(displayCapture).format(FORMAT_AVI).build();
// 5) Create VideoStatus object and return
CaptureStatus captureStatus = new CaptureStatus(this.getCaptureStartParams(), capture, CaptureState.recording);
return captureStatus;
}
// just return the old one
return this;
}
use of co.videofirst.vft.capture.model.display.DisplayCapture in project vft-capture by videofirst.
the class VideoRecorderMonte method record.
@Override
public void record(VideoRecord videoRecord) {
try {
this.videoRecord = videoRecord;
DisplayCapture displayCapture = videoRecord.getCapture();
Rectangle captureArea = new Rectangle(displayCapture.getX(), displayCapture.getY(), displayCapture.getWidth(), displayCapture.getHeight());
screenRecorder = new EnhancedScreenRecorder(graphicsConfiguration, captureArea, fileFormat, screenFormat, mouseFormat, audioFormat, tempFolder);
screenRecorder.start();
} catch (IOException ioEx) {
throw new VideoRecordException("Record exception when starting recording", ioEx);
} catch (AWTException awtEx) {
throw new VideoRecordException("Record exception when starting recording", awtEx);
}
}
use of co.videofirst.vft.capture.model.display.DisplayCapture in project vft-capture by videofirst.
the class DefaultDisplayService method drawBorder.
private void drawBorder(Graphics g) {
DisplayBorder db = displayUpdate.getBorder();
DisplayCapture dc = displayUpdate.getCapture();
if (db != null && db.isDisplay()) {
g.setColor(db.getColor());
int pad = db.getPadding();
for (int i = 0; i < db.getWidth(); i++) {
// draw rectangle for each pixel of width
int x = dc.getX() - pad;
int y = dc.getY() - pad;
int w = dc.getWidth() - 1 + (pad * 2);
int h = dc.getHeight() - 1 + (pad * 2);
g.drawRect(x, y, w, h);
pad++;
}
}
}
Aggregations