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 DEVICEDESCRIPTOR_H_
00026 #define DEVICEDESCRIPTOR_H_
00027
00028 #include <iostream>
00029 #include <string>
00030
00031 #if !defined(_MSC_VER) && !defined(USE_PREBUILD_LIBS)
00032 # include "avcap-config.h"
00033 #endif
00034
00035 #include "avcap-export.h"
00036
00037
00038 #define DRIVER_IVTV "ivtv"
00039
00040 namespace avcap
00041 {
00042 class CaptureDevice;
00043
00045
00057 class AVCAP_Export DeviceDescriptor
00058 {
00059 public:
00060 #ifdef AVCAP_LINUX
00061 typedef int DEV_HANDLE_T;
00062 #endif
00063
00064 #ifdef AVCAP_OSX
00065 typedef int DEV_HANDLE_T;
00066 #endif
00067
00068 #ifdef _WIN32
00070
00071
00072 typedef void* DEV_HANDLE_T;
00073 #endif
00074
00075 private:
00076 const static std::string mEmptyString;
00077
00078 public:
00080 DeviceDescriptor();
00081
00083 virtual ~DeviceDescriptor() = 0;
00084
00086
00090 virtual int open() = 0;
00091
00093
00097 virtual int close() = 0;
00098
00100
00101 virtual const std::string& getName() const = 0;
00102
00104
00106 virtual inline const std::string& getDriver() const
00107 { return mEmptyString; }
00108
00110
00112 virtual inline const std::string& getCard() const
00113 { return mEmptyString; }
00114
00116
00118 virtual inline const std::string& getInfo() const
00119 { return mEmptyString; }
00120
00122
00124 virtual inline int getVersion() const
00125 { return 0; }
00126
00128
00130 virtual inline const std::string& getVersionString() const
00131 { return mEmptyString; }
00132
00134
00135 virtual const DEV_HANDLE_T getHandle() const = 0;
00136
00138 virtual inline bool isAVDev() const
00139 { return false; }
00140
00142 virtual inline bool isVideoCaptureDev() const
00143 { return false; }
00144
00146 virtual inline bool isVBIDev() const
00147 { return false; }
00148
00150 virtual inline bool isTuner() const
00151 { return false; }
00152
00154 virtual inline bool isAudioDev() const
00155 { return false; }
00156
00158 virtual inline bool isRadioDev() const
00159 { return false; }
00160
00162 virtual inline bool isOverlayDev() const
00163 { return false; }
00164
00166
00167 virtual inline bool isRWDev () const
00168 { return false; }
00169
00171
00172 virtual inline bool isAsyncIODev() const
00173 { return false; }
00174
00176
00177 virtual inline bool isStreamingDev() const
00178 { return false; }
00179
00181
00191 virtual CaptureDevice* getDevice() = 0;
00192 };
00193 }
00194
00195
00196 #endif //DEVICEDESCRIPTOR_H_