00001 #ifndef VDEVICEV4L_H 00002 #define VDEVICEV4L_H 00003 00004 #include "vdevicebase.h" 00005 #include <linux/videodev.h> 00006 #include "videodevice.inc" 00007 00008 class VDeviceV4L : public VDeviceBase 00009 { 00010 public: 00011 VDeviceV4L(VideoDevice *device); 00012 ~VDeviceV4L(); 00013 00014 int initialize(); 00015 int open_input(); 00016 int close_all(); 00017 int read_buffer(VFrame *frame); 00018 int get_best_colormodel(Asset *asset); 00019 int set_channel(Channel *channel); 00020 int set_picture(PictureConfig *picture); 00021 00022 private: 00023 int set_cloexec_flag(int desc, int value); 00024 int set_mute(int muted); 00025 int v4l1_get_inputs(); 00026 int v4l1_set_mute(int muted); 00027 unsigned long translate_colormodel(int colormodel); 00028 int v4l1_set_channel(Channel *channel); 00029 int v4l1_get_norm(int norm); 00030 int v4l1_set_picture(PictureConfig *picture); 00031 void v4l1_start_capture(); 00032 int capture_frame(int capture_frame_number); 00033 int wait_v4l_frame(); 00034 int read_v4l_frame(VFrame *frame); 00035 int frame_to_vframe(VFrame *frame, unsigned char *input); 00036 int next_frame(int previous_frame); 00037 int close_v4l(); 00038 int unmap_v4l_shmem(); 00039 int v4l_init(); 00040 00041 int input_fd, output_fd; 00042 // FourCC Colormodel for device 00043 unsigned long device_colormodel; 00044 // BC colormodel for device 00045 int colormodel; 00046 00047 // Video4Linux 00048 struct video_capability cap1; 00049 struct video_window window_params; 00050 struct video_picture picture_params; 00051 struct video_mbuf capture_params; // Capture for Video4Linux 00052 00053 // Common 00054 char *capture_buffer; // sequentual capture buffers for v4l1 or read buffer for v4l2 00055 int capture_frame_number; // number of frame to capture into 00056 int read_frame_number; // number of the captured frame to read 00057 int shared_memory; // Capturing directly to memory 00058 int initialization_complete; 00059 int got_first_frame; 00060 }; 00061 00062 #endif
1.4.4