4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "condition.inc"
28 #include "mwindow.inc"
30 #include "recordgui.inc"
32 #include "videodevice.inc"
34 // Default behavior is to read frames and flash to display.
35 // Optionally writes to disk.
37 class RecordVideo : public Thread
40 RecordVideo(MWindow *mwindow, Record *record);
43 void reset_parameters();
45 // Do all initialization
47 // Trigger the loop to start
48 void start_recording();
49 void stop_recording();
50 void pause_recording();
51 void resume_recording();
57 int read_buffer(VFrame *frame);
58 void decompress_buffer(VFrame *frame);
65 int writing_file, buffer_frames;
66 int64_t buffer_position; // Position in output buffer being captured
68 int write_result, grab_result;
72 // Frame start of this recording in the file
74 // Want one thread to dictate the other during shared device recording.
75 int done, recording_paused;
76 Condition *trigger_lock;
77 Condition *pause_record_lock;
78 Condition *record_paused_lock;