include/avcap/linux/V4L1_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 
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                 // Video4Linux1 specific data
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_

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