8 #include "recordgui.inc"
10 #include "videodevice.inc"
12 // Default behavior is to read frames and flash to display.
13 // Optionally writes to disk.
15 class RecordVideo
: public Thread
18 RecordVideo(MWindow
*mwindow
,
20 RecordThread
*record_thread
);
23 void reset_parameters();
25 // Do all initialization
27 // Trigger the loop to start
28 void start_recording();
30 int pause_recording();
31 int resume_recording();
32 int wait_for_completion(); // For recording to a file.
33 int set_parameters(File
*file
,
35 int buffer_size
, // number of frames to write to disk at a time
38 void write_buffer(int skip_new
= 0);
39 void start_file_thread();
44 void get_capture_frame();
50 RecordThread
*record_thread
;
53 int buffer_size
; // number of frames to write to disk at a time
54 int64_t buffer_position
; // Position in output buffer being captured to
55 VFrame
*capture_frame
; // Output frame for preview mode
57 // result of every disk write
59 // result of every frame grab
63 int64_t current_sample
; // Sample in time of the start of the capture
64 int64_t next_sample
; // Sample of next frame
65 int64_t total_dropped_frames
; // Total number of frames behind
66 int64_t dropped_frames
; // Number of frames currently behind
67 int64_t last_dropped_frames
; // Number of dropped frames during the last calculation
69 // Frame start of this recording in the file
71 // Want one thread to dictate the other during shared device recording.
81 int cleanup_recording();