include/avcap/windows/SampleGrabberCallback.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 SAMPLEGRABBER_H_
00025 #define SAMPLEGRABBER_H_
00026 
00027 #include "QEdit.h"
00028 
00029 #include "IOBuffer.h"
00030 #include "avcap-export.h"
00031 
00032 namespace avcap
00033 {
00034 class DS_VidCapManager;
00035 
00037         
00042         class AVCAP_Export SampleGrabberCallback : public ISampleGrabberCB
00043         {
00044         private:
00045                 DS_VidCapManager*       mVidCapMngr;
00046                 ISampleGrabber*         mSampleGrabberFilter;
00047                 HANDLE&                         mLock;
00048 
00049         public:
00050                 SampleGrabberCallback(HANDLE& lock);
00051                 
00052                 ~SampleGrabberCallback();
00053         
00057                 void SetVideoCaptureManager(DS_VidCapManager *vidCapManager);
00058         
00062                 void SetSampleGrabberFilter(ISampleGrabber *SampleGrabberFilter);
00063         
00064                 /* Fake referance counting - This is safe because the application 
00065                  * creates the object on the stack, and the object remains in scope 
00066                  * throughout the lifetime of the filter graph.*/
00067                 STDMETHODIMP_(ULONG) AddRef() 
00068                         { return 1; }
00069                 
00070                 STDMETHODIMP_(ULONG) Release() 
00071                         { return 2; }
00072 
00073                 STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);
00074         
00078                 STDMETHODIMP SampleCB(double Time, IMediaSample *pSample);
00079 
00080                 STDMETHODIMP BufferCB(double Time, BYTE *pBuffer, long BufferLen);
00081         
00082                 friend class IOBuffer;
00083         };
00084 }
00085 
00086 #endif // SAMPLEGRABBER_H_

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