Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

playerv4l2.h

Go to the documentation of this file.
00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00015  *
00016  */
00018 //
00019 // Desc: Client library in C++ to access player_driver_camerav4l2 interface
00020 // Author: Marcin Rudowski
00021 // Email: mar_rud@poczta.onet.pl
00022 // Date: 19 Jun 2006
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         // Constructor.  Leave the access field empty to start unconnected.
00164         CameraV4L2Proxy (PlayerClient *pc, unsigned short index,
00165                      unsigned char access='c');
00166 
00167         virtual ~CameraV4L2Proxy(){
00168         }
00169 
00170         // interface that all proxies must provide
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 

Generated on Thu Jun 29 22:04:43 2006 for Camerav4l2 by  doxygen 1.4.4