include/avcap/linux/AVC_VidCapManager.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 #ifdef HAS_AVC_SUPPORT
00026 
00027 #ifndef AVC_VIDCAPMANAGER_H_
00028 #define AVC_VIDCAPMANAGER_H_
00029 
00030 #include "avcap-config.h"
00031 
00032 #include <sys/types.h>
00033 #include <list>
00034 #include <time.h>
00035 
00036 #include "CaptureManager.h"
00037 
00038 namespace avcap
00039 {
00040         class AVC_DeviceDescriptor;
00041         class AVC_FormatManager;
00042         class IOBuffer;
00043         class CaptureHandler;
00044         class AVC_Reader;
00045         class iec61883Connection;
00046         
00048         
00052         class AVC_VidCapManager: public CaptureManager
00053         {
00054         public:
00055                 enum
00056                 {
00057                         MAX_BUFFERS = 32,       
00058                         DEFAULT_BUFFERS = 8     
00059                 };
00060                 
00061         private:
00062                 typedef std::list<IOBuffer*> IOBufList;
00063                 
00064                 AVC_DeviceDescriptor    *mDeviceDescriptor;
00065                 AVC_FormatManager               *mFormatMgr;
00066                 AVC_Reader                              *mReader;
00067                 iec61883Connection              *mConnection;
00068                 
00069                 IOBufList                       mBuffers;
00070                 int                                     mNumBufs;
00071                 int                             mSequence;
00072 
00073         public:
00074         
00075                 AVC_VidCapManager(AVC_DeviceDescriptor* dd, AVC_FormatManager* fmt_mgr, int nbufs = DEFAULT_BUFFERS);
00076                 
00077                 virtual ~AVC_VidCapManager();
00078                 
00079                 int init();
00080                 
00081                 int destroy();
00082                 
00083                 int startCapture();
00084 
00085                 int stopCapture();
00086                 
00087                 void registerCaptureHandler(CaptureHandler *handler); 
00088 
00089                 void removeCaptureHandler(); 
00090                 
00091                 virtual int getNumIOBuffers();
00092 
00093         private:
00094                 virtual IOBuffer* dequeue();
00095 
00096                 virtual int enqueue(IOBuffer* buf);
00097         };
00098 }
00099 #endif // AVC_VIDCAPMANAGER_H_
00100 
00101 #endif // HAS_AVC_SUPPORT
00102 

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