00001 #ifndef FCAM_N900_SENSOR_H
00002 #define FCAM_N900_SENSOR_H
00003
00010 #include "../Sensor.h"
00011 #include "Daemon.h"
00012 #include "../Frame.h"
00013 #include <vector>
00014 #include <pthread.h>
00015 #include "Frame.h"
00016
00017 namespace FCam {
00018 namespace N900 {
00019
00023 class Sensor : public FCam::Sensor, public Daemon::RequestGenerator {
00024 public:
00025
00026 Sensor();
00027 ~Sensor();
00028
00029 void capture(const FCam::Shot &);
00030 void capture(const std::vector<FCam::Shot> &);
00031 void stream(const FCam::Shot &s);
00032 void stream(const std::vector<FCam::Shot> &);
00033 bool streaming();
00034 void stopStreaming();
00035
00036 int getRollingShutterTime(const Shot &) const;
00037
00038 int framesPending() const;
00039 int shotsPending() const;
00040
00041 BayerPattern getBayerPattern() const {return GRBG;}
00042
00043 const float *getXYZToRawColorMatrixTungsten() const {return XYZToRawColorMatrixTungsten;}
00044 const float *getXYZToRawColorMatrixDaylight() const {return XYZToRawColorMatrixDaylight;}
00045
00046 const std::string &getManufacturer() {return manufacturer;}
00047 const std::string &getModel() {return model;}
00048
00049 FCam::Frame::Ptr getFrame();
00050
00051 private:
00052
00053 std::vector<Shot> streamingShot;
00054
00055
00056 friend class Daemon;
00057 Daemon daemon;
00058
00059
00060 void generateRequest();
00061
00062 pthread_mutex_t requestMutex;
00063
00064
00065 void enforceDropPolicy();
00066
00067
00068 static float XYZToRawColorMatrixDaylight[];
00069 static float XYZToRawColorMatrixTungsten[];
00070
00071 static std::string manufacturer;
00072 static std::string model;
00073
00074
00075 int shotsPending_;
00076
00077 };
00078
00079 }
00080 }
00081
00082
00083 #endif