00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00019
00020
00021
00022
00023
00025 #ifndef __PLAYERV2L2__H_
00026 #define __PLAYERV2L2__H_
00027
00028 #include <playerclient.h>
00029
00070 #ifndef __PLAYERV2L2C__H_
00071
00073 enum FieldTypes {
00074 PLAYER_V4L2_FIELD_ANY=0,
00075 PLAYER_V4L2_FIELD_NONE,
00076 PLAYER_V4L2_FIELD_TOP,
00077 PLAYER_V4L2_FIELD_BOTTOM,
00078 PLAYER_V4L2_FIELD_INTERLACED,
00079 PLAYER_V4L2_FIELD_SEQ_TB,
00080 PLAYER_V4L2_FIELD_SEQ_BT,
00081 PLAYER_V4L2_FIELD_ALTERNATE
00082 };
00083
00085 enum NormStandards {
00086 PLAYER_V4L2_STD_PAL=0,
00087 PLAYER_V4L2_STD_NTSC,
00088 PLAYER_V4L2_STD_SECAM,
00089 PLAYER_V4L2_STD_OTHER=-1
00090 };
00091
00093 enum PixelFormats {
00094 PLAYER_V4L2_FMT_RGB24=0,
00095 PLAYER_V4L2_FMT_RGB32,
00096 PLAYER_V4L2_FMT_BGR24,
00097 PLAYER_V4L2_FMT_BGR32,
00098 PLAYER_V4L2_FMT_GREY,
00099 PLAYER_V4L2_FMT_RGB565,
00100 PLAYER_V4L2_FMT_SBGGR8,
00101 PLAYER_V4L2_FMT_RGB332,
00102 PLAYER_V4L2_FMT_RGB555,
00103 PLAYER_V4L2_FMT_RGB555X,
00104 PLAYER_V4L2_FMT_RGB565X,
00105 PLAYER_V4L2_FMT_YVU410,
00106 PLAYER_V4L2_FMT_YVU420,
00107 PLAYER_V4L2_FMT_YUYV,
00108 PLAYER_V4L2_FMT_UYVY,
00109 PLAYER_V4L2_FMT_YUV422P,
00110 PLAYER_V4L2_FMT_YUV411P,
00111 PLAYER_V4L2_FMT_Y41P,
00112 PLAYER_V4L2_FMT_NV12,
00113 PLAYER_V4L2_FMT_NV21,
00114 PLAYER_V4L2_FMT_OTHER=-1
00115 };
00116 #endif
00117
00123 class CameraV4L2Proxy : public CameraProxy
00124 {
00125
00126 public:
00128 PixelFormats pixelFormat;
00129
00131 char pixelFormatS[64];
00132
00134 int swapRBFlag;
00135
00137 int noOfControls;
00138
00140 NormStandards norm;
00141
00143 char normS[64];
00144
00146 FieldTypes field;
00147
00149 char fieldS[64];
00150
00152 char name[64];
00153
00155 char inputName[64];
00156
00158 double brighteness;
00159 double contrast;
00160 double saturation;
00161 double hue;
00162
00163
00164 CameraV4L2Proxy (PlayerClient *pc, unsigned short index,
00165 unsigned char access='c');
00166
00167 virtual ~CameraV4L2Proxy(){
00168 }
00169
00170
00171 void FillData(player_msghdr_t hdr, const char* buffer);
00172
00174 int selectSourceI(int src_id);
00175
00177 int selectSourceS(const char *src_name);
00178
00180 int setFrameSize(int w, int h);
00181
00183 int setNormI(int normID);
00184
00186 int setNormS(const char *normID);
00187
00189 int setFieldTypeI(int fielsType);
00190
00192 int setFieldTypeS(const char * fielsType);
00193
00195 int setPixelFormatI(int pixFormat);
00196
00198 int setPixelFormatS(const char * pixFormat);
00199
00201 int setSwapRB(int swap);
00202
00207 int setControlValueI(int id, double value);
00208
00213 int setControlValueS(const char *name, double value);
00214
00216 double getControlValueI(int id);
00217
00219 double getControlValueS(const char *name);
00220
00222 const char * getControlName(int id);
00223
00225 int setBrighteness(double value);
00227 double getBrighteness();
00228
00229 int setSaturation(double value);
00231 double getSaturation();
00232
00233 int setContrast(double value);
00235 double getContrast();
00236
00237 int setHue(double value);
00239 double getHue();
00240
00241
00242 private:
00244 void refreshState();
00245
00247 const char * getInputName();
00248
00250 const char * getName();
00251
00253 const char * getFieldS();
00254
00256 const char * getPixelFormatS();
00257
00259 const char * getNormS();
00260
00262 int countControls();
00263 };
00264
00270 #endif
00271