00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef V4L1_DEVICEDESCRIPTOR_H_
00026 #define V4L1_DEVICEDESCRIPTOR_H_
00027
00028 #include <iostream>
00029
00030 #include "DeviceDescriptor.h"
00031
00032 namespace avcap
00033 {
00034 class CaptureDevice;
00035 class V4L1_Device;
00036
00038
00039 class V4L1_DeviceDescriptor : public DeviceDescriptor
00040 {
00041 public:
00042 struct bounds {
00043 unsigned int minwidth, minheight, maxwidth, maxheight;
00044 };
00045
00046 private:
00047 std::string mName;
00048 std::string mDriver;
00049 std::string mCard;
00050 std::string mInfo;
00051 std::string mVersionString;
00052
00053 int mVersion;
00054
00055 DEV_HANDLE_T mHandle;
00056 bool mValid;
00057
00058
00059 int mType;
00060 bounds mBounds;
00061 int mAudios;
00062 int mChannels;
00063 bool mIsStreamingDev;
00064
00065 V4L1_Device* mDevice;
00066
00067 public:
00068 V4L1_DeviceDescriptor(const std::string &name);
00069
00070 virtual ~V4L1_DeviceDescriptor();
00071
00072 virtual CaptureDevice* getDevice();
00073
00074 virtual int open();
00075
00076 virtual int close();
00077
00078 virtual const std::string& getName() const;
00079
00080 inline const std::string& getDriver() const
00081 { return mDriver; }
00082
00083 inline const std::string& getCard() const
00084 { return mCard; }
00085
00086 inline const std::string& getInfo() const
00087 { return mInfo; }
00088
00089 inline int getVersion() const
00090 { return mVersion; }
00091
00092 const std::string& getVersionString() const;
00093
00094 inline const DEV_HANDLE_T getHandle() const
00095 { return mHandle; }
00096
00097 bool isAVDev() const;
00098
00099 bool isVideoCaptureDev() const;
00100
00101 bool isVBIDev() const;
00102
00103 bool isTuner() const;
00104
00105 bool isAudioDev() const;
00106
00107 bool isRadioDev() const;
00108
00109 bool isOverlayDev() const;
00110
00111 bool isRWDev () const;
00112
00113 bool isAsyncIODev() const;
00114
00115 bool isStreamingDev() const;
00116
00117 inline int getChannels() const
00118 { return mChannels; }
00119
00120 inline int getAudios() const
00121 { return mAudios; }
00122
00124 inline bounds& getBounds()
00125 { return mBounds; }
00126
00127 private:
00128 bool queryCapabilities();
00129 };
00130 };
00131
00132 #endif // V4L1_DEVICEDESCRIPTOR_H_