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_DEVICEDESCRIPTOR_H_
00025 #define V4L2_DEVICEDESCRIPTOR_H_
00026
00027 #include <string>
00028
00029 #include "DeviceDescriptor.h"
00030
00031
00032 #define DRIVER_IVTV "ivtv"
00033
00034 namespace avcap
00035 {
00036 class CaptureDevice;
00037 class V4L2_Device;
00038
00040
00041 class V4L2_DeviceDescriptor : public DeviceDescriptor
00042 {
00043 private:
00044 std::string mName;
00045 std::string mDriver;
00046 std::string mCard;
00047 std::string mInfo;
00048 std::string mVersionString;
00049
00050 int mVersion;
00051 int mCapabilities;
00052
00053 DEV_HANDLE_T mHandle;
00054 bool mValid;
00055 V4L2_Device* mDevice;
00056
00057 public:
00058 V4L2_DeviceDescriptor(const std::string &name);
00059
00060 virtual ~V4L2_DeviceDescriptor();
00061
00062 virtual CaptureDevice* getDevice();
00063
00064 int open();
00065
00066 int close();
00067
00068 virtual const std::string& getName() const;
00069
00070 inline const std::string& getDriver() const
00071 { return mDriver; }
00072
00073 inline const std::string& getCard() const
00074 { return mCard; }
00075
00076 inline const std::string& getInfo() const
00077 { return mInfo; }
00078
00079 inline int getVersion() const
00080 { return mVersion; }
00081
00082 const std::string& getVersionString() const;
00083
00084 inline const DEV_HANDLE_T getHandle() const
00085 { return mHandle; }
00086
00087 bool isAVDev() const;
00088
00089 bool isVideoCaptureDev() const;
00090
00091 bool isVBIDev() const;
00092
00093 bool isTuner() const;
00094
00095 bool isAudioDev() const;
00096
00097 bool isRadioDev() const;
00098
00099 bool isOverlayDev() const;
00100
00101 bool isRWDev () const;
00102
00103 bool isAsyncIODev() const;
00104
00105 bool isStreamingDev() const;
00106
00107 private:
00108 bool queryCapabilities();
00109 };
00110 }
00111
00112 #endif // V4L2_DEVICEDESCRIPTOR_H_