r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / recordvideo.h
blob2d72c10e29cdae700ac1572f3de0b117f5657b6c
1 #ifndef RECORDVIDEO_H
2 #define RECORDVIDEO_H
4 #include "file.inc"
5 #include "mutex.h"
6 #include "mwindow.inc"
7 #include "record.inc"
8 #include "recordgui.inc"
9 #include "thread.h"
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
17 public:
18 RecordVideo(MWindow *mwindow,
19 Record *record,
20 RecordThread *record_thread);
21 ~RecordVideo();
23 void reset_parameters();
24 void run();
25 // Do all initialization
26 int arm_recording();
27 // Trigger the loop to start
28 void start_recording();
29 int stop_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,
34 RecordGUI *gui,
35 int buffer_size, // number of frames to write to disk at a time
36 int realtime,
37 int frames);
38 void write_buffer(int skip_new = 0);
39 void start_file_thread();
40 int unhang_thread();
41 void rewind_file();
42 void finish_timed();
43 void finish_loop();
44 void get_capture_frame();
45 void read_buffer();
47 MWindow *mwindow;
48 Record *record;
50 RecordThread *record_thread;
51 RecordGUI *gui;
52 int single_frame;
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
56 Timer delayer;
57 // result of every disk write
58 int write_result;
59 // result of every frame grab
60 int grab_result;
61 // Capture frame
62 VFrame ***frame_ptr;
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
68 int64_t delay;
69 // Frame start of this recording in the file
70 int64_t record_start;
71 // Want one thread to dictate the other during shared device recording.
72 // Done with batch
73 int batch_done;
76 int is_recording;
77 int is_paused;
78 Mutex unhang_lock;
79 Mutex trigger_lock;
80 private:
81 int cleanup_recording();
85 #endif