00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef V4L2_CONTROLBASE_H_
00025 #define V4L2_CONTROLBASE_H_
00026
00027 #include <string>
00028 #include <list>
00029 #include <linux/videodev.h>
00030
00031 namespace avcap
00032 {
00033
00034 class V4L2_DeviceDescriptor;
00035
00037
00040 class V4L2_ControlBase
00041 {
00042 protected:
00043 V4L2_DeviceDescriptor *mDeviceDescriptor;
00044 int mId;
00045 int mValue;
00046
00047 private:
00048 std::string mName;
00049 int mDefaultValue;
00050 int mFlags;
00051
00052 public:
00053 V4L2_ControlBase(V4L2_DeviceDescriptor *dd, struct v4l2_queryctrl* query);
00054
00055 virtual ~V4L2_ControlBase();
00056
00057 inline int getId() const
00058 { return mId; }
00059
00060 inline int getDefaultValue() const
00061 { return mDefaultValue; }
00062
00063 inline const std::string& getName() const
00064 { return mName; }
00065
00066 virtual int setValue(int val);
00067
00068 virtual int getValue() const;
00069
00070 virtual int reset();
00071
00073 __u32 getFlags() const { return mFlags; }
00074
00075 protected:
00076
00077 int update();
00078 };
00079 }
00080
00081 #endif // V4L2_CONTROLBASE_H_
00082