apps/astreamer/video.h

Go to the documentation of this file.
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 #define FRAMES_AHEAD_FPS 3 
00013 #define FRAMES_SKIP_FPS  3 
00014 
00015 class Video : public RTP_Stream {
00016 public:
00017         enum vevent {
00018                 VEVENT0,
00019                 DAEMON_DISABLED,
00020                 FPS_CHANGE,
00021                 SIZE_CHANGE
00022         };
00023 
00024         Video(void);
00025 
00026         virtual ~Video(void);
00027         int width(void);
00028         int height(void);
00029         int quality(void);
00030         float fps(void);
00031         void fps(float);
00032 
00033         void Start(string ip, long port);
00034         void Stop(void);
00035 
00037         unsigned long getGPValue(unsigned long GPNumber);
00038         void          setGValue(unsigned long  GNumber,   unsigned long value);
00039         bool          waitDaemonEnabled(int daemonBit); // <0 - use default
00040         bool          isDaemonEnabled(int daemonBit); // <0 - use default
00041 protected:
00042         
00043         long getFramePars(struct interframe_params_t * frame_pars, long before); 
00044         unsigned long prev_jpeg_wp;
00045 
00046         // frame params
00047         int f_width;
00048         int f_height;
00049         int f_quality;
00050         bool qtables_include;
00051         unsigned char qtable[128];
00052 //      struct timeval f_tv;
00053         long buffer_length;
00054         unsigned long *buffer_ptr;
00055         unsigned long *buffer_ptr_s;  
00056         void *frame_ptr;
00057 
00058         long capture(void);
00059 //      bool process(void);
00060         long  process(void);
00061 
00062         // for statistic
00063         long v_t_sec;
00064         long v_t_usec;
00065         int v_frames;
00066         unsigned long used_width;   
00067         unsigned long used_height;  
00068         float used_fps;   
00069 };
00070 
00071 //extern Video *video;
00072 
00073 #endif // _VIDEO__H_

Generated on Fri Nov 28 00:06:21 2008 for elphel by  doxygen 1.5.1