urgAutoCapture.h
Go to the documentation of this file.00001 #ifndef URG_AUTO_CAPTURE_H
00002 #define URG_AUTO_CAPTURE_H
00003
00013 #include "urgManualCapture.h"
00014 #ifdef HAVE_CONFIG_H
00015 #include <config.h>
00016 #endif
00017 #if !HAVE_CONFIG_H || HAVE_LIBSDL
00018 #include <SDL_thread.h>
00019 #endif
00020
00021
00025 class URGAutoCapture : public URGManualCapture {
00026 #if !HAVE_CONFIG_H || HAVE_LIBSDL
00027 enum { WaitMsec = 10 };
00028 SDL_Thread* thread;
00029 SDL_mutex* mutex;
00030 bool active;
00031 typedef struct {
00032 int first, last, group;
00033 long* length;
00034 bool captured;
00035 int ret_value;
00036 unsigned long raw_timestamp;
00037 long capture_times;
00038 } captureBuffer_t;
00039 captureBuffer_t capture_buffer[2];
00040 int next_first, next_last, next_group;
00041 unsigned long raw_timestamp;
00042 bool initialized;
00043 int active_index;
00044 URGInterface::urgParams_t* urg_params;
00045 long auto_capture_times;
00046
00047 void lock(void);
00048 void unlock(void);
00049 void initCaptureBuffer(URGInterface::urgParams_t& params);
00050 static int captureThread(void* args);
00051
00052 public:
00053 URGAutoCapture(void);
00054 ~URGAutoCapture(void);
00055
00056 int capture(long length[],
00057 int first_index, int last_index, int group,
00058 URGInterface::urgParams_t& params,
00059 unsigned long* raw_timestamp);
00060 int getCaptureTimes(void);
00061 #endif
00062 };
00063
00064 #endif
00065