Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

recordmonitor.h

Go to the documentation of this file.
00001 #ifndef RECORDMONITOR_H
00002 #define RECORDMONITOR_H
00003 
00004 #include "avc1394transport.h"
00005 #include "canvas.h"
00006 #include "condition.inc"
00007 #include "guicast.h"
00008 #include "channelpicker.inc"
00009 #include "libmjpeg.h"
00010 #include "meterpanel.inc"
00011 #include "preferences.inc"
00012 #include "record.inc"
00013 #include "recordgui.inc"
00014 #include "recordtransport.inc"
00015 #include "recordmonitor.inc"
00016 #include "videodevice.inc"
00017 
00018 class RecordMonitorThread;
00019 
00020 
00021 class RecordMonitor : public Thread
00022 {
00023 public:
00024         RecordMonitor(MWindow *mwindow, Record *record);
00025         ~RecordMonitor();
00026 
00027 // Show a frame 
00028         int update(VFrame *vframe);
00029 // Update channel textbox
00030         void update_channel(char *text);
00031 
00032         MWindow *mwindow;
00033         Record *record;
00034 // Thread for slippery monitoring
00035         RecordMonitorThread *thread; 
00036         RecordMonitorGUI *window;
00037         VideoDevice *device;
00038 // Fake config for monitoring
00039         VideoOutConfig *config;
00040         
00041         
00042         
00043         
00044         
00045         
00046 
00047 
00048 
00049         void run();
00050 
00051         int close_threads();   // Stop all the child threads on exit
00052         int create_objects();
00053         int fix_size(int &w, int &h, int width_given, float aspect_ratio);
00054         float get_scale(int w);
00055         int get_mbuttons_height();
00056         int get_canvas_height();
00057         int get_channel_x();
00058         int get_channel_y();
00059 };
00060 
00061 class ReverseInterlace;
00062 class RecordMonitorCanvas;
00063 
00064 class RecordMonitorGUI : public BC_Window
00065 {
00066 public:
00067         RecordMonitorGUI(MWindow *mwindow,
00068                 Record *record, 
00069                 RecordMonitor *thread,
00070                 int min_w);
00071         ~RecordMonitorGUI();
00072 
00073         int create_objects();
00074 
00075         MeterPanel *meters;
00076         Canvas *canvas;
00077 //      RecordTransport *record_transport;
00078         AVC1394Transport *avc1394_transport;
00079         AVC1394TransportThread *avc1394transport_thread;
00080         ChannelPicker *channel_picker;
00081         ReverseInterlace *reverse_interlace;
00082         int cursor_x_origin, cursor_y_origin;
00083         int translate_x_origin, translate_y_origin;
00084         BC_PopupMenu *monitor_menu;
00085         int current_operation;
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 
00100         int translation_event();
00101         int resize_event(int w, int h);
00102         int set_title();
00103         int close_event();
00104         int create_bitmap();
00105         int button_press();
00106         int button_release();
00107         int cursor_motion();
00108         int get_virtual_center();
00109         int keypress_event();
00110 
00111         MWindow *mwindow;
00112         BC_SubWindow *mbuttons;
00113         BC_Bitmap *bitmap;
00114         RecordMonitor *thread;
00115         Record *record;
00116         AVC1394Control *avc;
00117         BC_Title *avc1394transport_title;
00118         BC_Title *avc1394transport_timecode;
00119 };
00120 
00121 
00122 
00123 
00124 
00125 class RecVideoMJPGThread;
00126 class RecVideoDVThread;
00127 
00128 class RecordMonitorThread : public Thread
00129 {
00130 public:
00131         RecordMonitorThread(MWindow *mwindow, Record *record, RecordMonitor *record_monitor);
00132         ~RecordMonitorThread();
00133 
00134         void reset_parameters();
00135         void run();
00136 // Calculate the best output format based on input drivers
00137         void init_output_format();
00138         int start_playback();
00139         int stop_playback();
00140         int write_frame(VFrame *new_frame);
00141         int render_frame();
00142         void unlock_input();
00143         void new_output_frame();
00144 
00145 // Input frame being rendered
00146         VFrame *input_frame;    
00147 // Frames for the rendered output
00148         VFrame *output_frame[MAX_CHANNELS];  
00149 // Best color model given by device
00150         int output_colormodel;
00151 // Block until new input data
00152         Condition *output_lock;
00153         Condition *input_lock;
00154         Record *record;
00155         RecordMonitor *record_monitor;
00156         MWindow *mwindow;
00157 // If the input frame is the same data that the file handle uses
00158         int shared_data;
00159 
00160 
00161 private:
00162         void show_output_frame();
00163         void render_uncompressed();
00164         int render_jpeg();
00165         int render_dv();
00166 
00167         int ready;   // Ready to recieve the next frame
00168         int done;
00169         RecVideoMJPGThread *jpeg_engine;
00170         RecVideoDVThread *dv_engine;
00171 };
00172 
00173 class RecordMonitorFullsize : public BC_MenuItem
00174 {
00175 public:
00176         RecordMonitorFullsize(MWindow *mwindow, 
00177                 RecordMonitorGUI *window);
00178 
00179         int handle_event();
00180 
00181         MWindow *mwindow;
00182         RecordMonitorGUI *window;
00183 };
00184 
00185 class RecordMonitorCanvas : public Canvas
00186 {
00187 public:
00188         RecordMonitorCanvas(MWindow *mwindow, 
00189                 RecordMonitorGUI *window, 
00190                 Record *record, 
00191                 int x, 
00192                 int y, 
00193                 int w, 
00194                 int h);
00195         ~RecordMonitorCanvas();
00196         
00197         void zoom_resize_window(float percentage);
00198         int button_press_event();
00199         int button_release_event();
00200         int cursor_motion_event();
00201         int cursor_enter_event();
00202         void reset_translation();
00203         int keypress_event();
00204         int get_output_w();
00205         int get_output_h();
00206 
00207         RecordMonitorGUI *window;
00208         MWindow *mwindow;
00209         Record *record;
00210 };
00211 
00212 class ReverseInterlace : public BC_CheckBox
00213 {
00214 public:
00215         ReverseInterlace(Record *record, int x, int y);
00216         ~ReverseInterlace();
00217         int handle_event();
00218         Record *record;
00219 };
00220 
00221 class RecVideoMJPGThread
00222 {
00223 public:
00224         RecVideoMJPGThread(Record *record, RecordMonitorThread *thread);
00225         ~RecVideoMJPGThread();
00226 
00227         int render_frame(VFrame *frame, long size);
00228         int start_rendering();
00229         int stop_rendering();
00230 
00231         RecordMonitorThread *thread;
00232         Record *record;
00233 
00234 private:
00235         mjpeg_t *mjpeg;
00236 };
00237 
00238 class RecVideoDVThread
00239 {
00240 public:
00241         RecVideoDVThread(Record *record, RecordMonitorThread *thread);
00242         ~RecVideoDVThread();
00243 
00244         int start_rendering();
00245         int stop_rendering();
00246         int render_frame(VFrame *frame, long size);
00247 
00248         RecordMonitorThread *thread;
00249         Record *record;
00250 
00251 private:
00252 // Don't want theme to need libdv to compile
00253         void *dv;
00254 };
00255 
00256 #endif

Generated on Sun Jan 8 13:38:59 2006 for Cinelerra-svn by  doxygen 1.4.4