include/avcap/CaptureManager.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 CAPTUREMANAGER_H_
00025 #define CAPTUREMANAGER_H_
00026 
00027 #if !defined(_MSC_VER) && !defined(USE_PREBUILD_LIBS)
00028 # include "avcap-config.h"
00029 #endif
00030 
00031 #include "avcap-export.h"
00032 
00033 namespace avcap
00034 {
00035         class CaptureHandler;
00036         class IOBuffer;
00037         
00039         
00046         class AVCAP_Export CaptureManager
00047         {
00048         public:
00049                 enum
00050                 {
00051                         MAX_BUFFERS = 32,       
00052                         DEFAULT_BUFFERS = 16    
00053                 };
00054                 
00055                         
00056 #ifdef AVCAP_LINUX
00057                 enum IOMethod
00058                 {
00059                         IO_METHOD_NOCAP = 0,
00060                 IO_METHOD_READ,
00061                 IO_METHOD_MMAP,
00062                 IO_METHOD_USERPTR,
00063                 };
00064 #endif
00065 
00066         private:
00067                 CaptureHandler* mCaptureHandler;
00068                 
00069         public:
00071                 inline CaptureManager() : mCaptureHandler(0)
00072                         {}
00073                 
00075                 virtual inline ~CaptureManager()
00076                         {}
00077                 
00079                 virtual int init() = 0;
00080                 
00082                 virtual int destroy() = 0;
00083                 
00085                 virtual int startCapture() = 0;
00086                 
00088                 virtual int stopCapture() = 0;
00089                 
00091 
00096                 virtual inline void registerCaptureHandler(CaptureHandler *handler) 
00097                         { mCaptureHandler = handler; }
00098 
00100 
00102                 virtual inline void removeCaptureHandler()
00103                         { mCaptureHandler = 0; }
00104                 
00106 
00109                 virtual inline CaptureHandler* getCaptureHandler()
00110                         { return mCaptureHandler; }
00111                 
00113 
00116                 virtual int getNumIOBuffers() = 0;
00117                 
00118         private:
00120 
00121                 virtual IOBuffer* dequeue() = 0;
00122 
00124 
00126                 virtual int enqueue(IOBuffer* buf) = 0;
00127 
00128                 friend class IOBuffer;
00129         };
00130 };
00131 
00132 #endif // CAPTUREMANAGER_H_

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