1 /* GStreamer 2 * Copyright (C) 2007 Sebastien Moutte <sebastien@moutte.net> 3 * 4 * gstdshowfakesrc.h: 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 #ifndef _DSHOWDECWRAPPER_FAKESRC_H_ 22 #define _DSHOWDECWRAPPER_FAKESRC_H_ 23 24 #include <gst/gst.h> 25 #include "gstdshowutil.h" 26 27 class FakeOutputPin : public CBaseOutputPin 28 { 29 protected: 30 /* members */ 31 HRESULT m_hres; 32 CMediaType m_MediaType; 33 unsigned int m_SampleSize; 34 35 public: 36 /* methods */ 37 FakeOutputPin (CBaseFilter *pFilter, CCritSec *sec); 38 ~FakeOutputPin (); 39 40 virtual HRESULT CheckMediaType(const CMediaType *pmt); 41 HRESULT GetMediaType(int iPosition, CMediaType *pMediaType); 42 virtual HRESULT DecideBufferSize (IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest); 43 STDMETHOD (SetMediaType) (AM_MEDIA_TYPE *pmt); 44 STDMETHOD (PushBuffer) (byte *buffer, __int64 start, __int64 stop, unsigned int size, bool discont); 45 STDMETHOD (Flush) (); 46 STDMETHOD (SetSampleSize) (unsigned int size); 47 }; 48 49 class FakeSrc : public CBaseFilter 50 { 51 public: 52 /* members */ 53 FakeOutputPin *m_pOutputPin; 54 55 /* methods */ 56 FakeSrc (); 57 virtual ~FakeSrc (); 58 59 virtual int GetPinCount(); 60 virtual CBasePin *GetPin(int n); 61 62 FakeOutputPin *GetOutputPin(); 63 }; 64 65 #endif // _DSHOWDECWRAPPER_FAKESRC_H_