include/avcap/linux/V4L2_DeviceDescriptor.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2005, 2008 Nico Pranke <Nico.Pranke@googlemail.com>, Robin Luedtke <RobinLu@gmx.de>
00003  *
00004  * This file is part of avcap.
00005  *
00006  * avcap is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation, either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * avcap is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with avcap.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 /* avcap is free for non-commercial use.
00021  * To use it in commercial endeavors, please contact Nico Pranke <Nico.Pranke@googlemail.com>.
00022  */
00023 
00024 #ifndef V4L2_DEVICEDESCRIPTOR_H_
00025 #define V4L2_DEVICEDESCRIPTOR_H_
00026 
00027 #include <string>
00028 
00029 #include "DeviceDescriptor.h"
00030 
00031 // IVTV driver name
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_

Generated on Mon Nov 30 11:10:30 2009 for avcap-0.1 by  doxygen 1.5.1