00001 #ifndef _VIDEO__H_ 00002 #define _VIDEO__H_ 00003 00004 #include <string> 00005 #include "rtp_stream.h" 00006 00007 using namespace std; 00008 00009 #include <asm/elphel/c313a.h> 00010 #include <asm/elphel/hist.h> 00011 00012 class Video : public RTP_Stream { 00013 public: 00014 Video(void); 00015 virtual ~Video(void); 00016 int width(void); 00017 int height(void); 00018 int quality(void); 00019 float fps(void); 00020 void fps(float); 00021 00022 void Start(string ip, long port); 00023 void Stop(void); 00024 protected: 00025 // int fd_stream; 00026 int fd_ctl; 00027 int fd_ioctl; 00028 unsigned long prev_jpeg_wp; 00029 00030 // frame params 00031 int f_width; 00032 int f_height; 00033 int f_quality; 00034 bool qtables_include; 00035 unsigned char qtable[128]; 00036 // struct timeval f_tv; 00037 long buffer_length; 00038 unsigned long *buffer_ptr; 00039 unsigned long *buffer_ptr_s; 00040 void *frame_ptr; 00041 00042 long capture(void); 00043 bool process(void); 00044 // for statistic 00045 long v_t_sec; 00046 long v_t_usec; 00047 int v_frames; 00048 }; 00049 00050 //extern Video *video; 00051 00052 #endif // _VIDEO__H_