4 #include "condition.inc"
9 #include "recordgui.inc"
11 #include "videodevice.inc"
13 // Default behavior is to read frames and flash to display.
14 // Optionally writes to disk.
16 class RecordVideo
: public Thread
19 RecordVideo(MWindow
*mwindow
,
21 RecordThread
*record_thread
);
24 void reset_parameters();
26 // Do all initialization
28 // Trigger the loop to start
29 void start_recording();
31 int pause_recording();
32 int resume_recording();
33 int wait_for_completion(); // For recording to a file.
34 int set_parameters(File
*file
,
36 int buffer_size
, // number of frames to write to disk at a time
39 void write_buffer(int skip_new
= 0);
40 void start_file_thread();
45 void get_capture_frame();
51 RecordThread
*record_thread
;
54 int buffer_size
; // number of frames to write to disk at a time
55 int64_t buffer_position
; // Position in output buffer being captured to
56 VFrame
*capture_frame
; // Output frame for preview mode
58 // result of every disk write
60 // result of every frame grab
64 int64_t current_sample
; // Sample in time of the start of the capture
65 int64_t next_sample
; // Sample of next frame
66 int64_t total_dropped_frames
; // Total number of frames behind
67 int64_t dropped_frames
; // Number of frames currently behind
68 int64_t last_dropped_frames
; // Number of dropped frames during the last calculation
70 // Frame start of this recording in the file
72 // Want one thread to dictate the other during shared device recording.
80 Condition
*trigger_lock
;
82 int cleanup_recording();