1 #ifndef RECORDMONITOR_H
2 #define RECORDMONITOR_H
5 #include "avc1394transport.h"
8 #include "channelpicker.inc"
9 #include "condition.inc"
11 #include "channelpicker.inc"
13 #include "meterpanel.inc"
14 #include "preferences.inc"
16 #include "recordgui.inc"
17 #include "recordtransport.inc"
18 #include "recordmonitor.inc"
19 #include "videodevice.inc"
21 class RecordMonitorThread
;
24 class RecordMonitor
: public Thread
27 RecordMonitor(MWindow
*mwindow
, Record
*record
);
31 int update(VFrame
*vframe
);
32 // Update channel textbox
33 void update_channel(char *text
);
37 // Thread for slippery monitoring
38 RecordMonitorThread
*thread
;
39 RecordMonitorGUI
*window
;
41 // Fake config for monitoring
42 VideoOutConfig
*config
;
54 int close_threads(); // Stop all the child threads on exit
56 int fix_size(int &w
, int &h
, int width_given
, float aspect_ratio
);
57 float get_scale(int w
);
58 int get_mbuttons_height();
59 int get_canvas_height();
64 class ReverseInterlace
;
65 class RecordMonitorCanvas
;
67 class RecordMonitorGUI
: public BC_Window
70 RecordMonitorGUI(MWindow
*mwindow
,
72 RecordMonitor
*thread
,
77 int cursor_leave_event();
78 int cursor_enter_event();
79 int button_release_event();
80 int cursor_motion_event();
84 // RecordTransport *record_transport;
86 AVC1394Transport
*avc1394_transport
;
87 AVC1394TransportThread
*avc1394transport_thread
;
89 RecordChannelPicker
*channel_picker
;
90 ReverseInterlace
*reverse_interlace
;
91 int cursor_x_origin
, cursor_y_origin
;
92 int translate_x_origin
, translate_y_origin
;
93 BC_PopupMenu
*monitor_menu
;
94 int current_operation
;
109 int translation_event();
110 int button_press_event();
111 int resize_event(int w
, int h
);
115 int keypress_event();
118 BC_SubWindow
*mbuttons
;
120 RecordMonitor
*thread
;
124 BC_Title
*avc1394transport_title
;
125 BC_Title
*avc1394transport_timecode
;
133 class RecVideoMJPGThread
;
134 class RecVideoDVThread
;
136 class RecordMonitorThread
: public Thread
139 RecordMonitorThread(MWindow
*mwindow
, Record
*record
, RecordMonitor
*record_monitor
);
140 ~RecordMonitorThread();
142 void reset_parameters();
144 // Calculate the best output format based on input drivers
145 void init_output_format();
146 int start_playback();
148 int write_frame(VFrame
*new_frame
);
151 void new_output_frame();
153 // Input frame being rendered
155 // Frames for the rendered output
156 VFrame
*output_frame
;
157 // Best color model given by device
158 int output_colormodel
;
159 // Block until new input data
160 Condition
*output_lock
;
161 Condition
*input_lock
;
163 RecordMonitor
*record_monitor
;
165 // If the input frame is the same data that the file handle uses
170 void show_output_frame();
171 void render_uncompressed();
175 int ready
; // Ready to recieve the next frame
177 RecVideoMJPGThread
*jpeg_engine
;
178 RecVideoDVThread
*dv_engine
;
181 class RecordMonitorFullsize
: public BC_MenuItem
184 RecordMonitorFullsize(MWindow
*mwindow
,
185 RecordMonitorGUI
*window
);
190 RecordMonitorGUI
*window
;
193 class RecordMonitorCanvas
: public Canvas
196 RecordMonitorCanvas(MWindow
*mwindow
,
197 RecordMonitorGUI
*window
,
203 ~RecordMonitorCanvas();
205 void zoom_resize_window(float percentage
);
206 int button_press_event();
207 int button_release_event();
208 int cursor_motion_event();
209 int cursor_enter_event();
210 void reset_translation();
211 int keypress_event();
214 int get_fullscreen();
215 void set_fullscreen(int value
);
219 RecordMonitorGUI
*window
;
224 class ReverseInterlace
: public BC_CheckBox
227 ReverseInterlace(Record
*record
, int x
, int y
);
233 class RecVideoMJPGThread
236 RecVideoMJPGThread(Record
*record
, RecordMonitorThread
*thread
);
237 ~RecVideoMJPGThread();
239 int render_frame(VFrame
*frame
, long size
);
240 int start_rendering();
241 int stop_rendering();
243 RecordMonitorThread
*thread
;
250 class RecVideoDVThread
253 RecVideoDVThread(Record
*record
, RecordMonitorThread
*thread
);
256 int start_rendering();
257 int stop_rendering();
258 int render_frame(VFrame
*frame
, long size
);
260 RecordMonitorThread
*thread
;
264 // Don't want theme to need libdv to compile
272 // c-file-style: "linux"