1 /* GStreamer 2 * Copyright (C) 2008 Pioneers of the Inevitable <songbird@songbirdnest.com> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 #ifndef __DSHOWVIDEOFAKESRC_H__ 20 #define __DSHOWVIDEOFAKESRC_H__ 21 22 #include <streams.h> 23 #include <gst/gst.h> 24 25 class VideoFakeSrcPin : public CDynamicOutputPin 26 { 27 protected: 28 /* members */ 29 CMediaType m_MediaType; 30 unsigned int m_SampleSize; 31 32 public: 33 /* methods */ 34 VideoFakeSrcPin (CBaseFilter *pFilter, CCritSec *sec, HRESULT *hres); 35 ~VideoFakeSrcPin (); 36 37 STDMETHODIMP CopyToDestinationBuffer (byte *src, byte *dst); 38 GstFlowReturn (PushBuffer) (GstBuffer *buf); 39 40 /* Overrides */ 41 virtual HRESULT CheckMediaType(const CMediaType *pmt); 42 HRESULT GetMediaType(int iPosition, CMediaType *pMediaType); 43 virtual HRESULT DecideBufferSize (IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest); 44 virtual HRESULT BreakConnect(); 45 virtual HRESULT CompleteConnect(IPin *pReceivePin); 46 virtual HRESULT Inactive(); 47 STDMETHOD (SetMediaType) (AM_MEDIA_TYPE *pmt); 48 STDMETHOD (Flush) (); 49 STDMETHODIMP Notify(IBaseFilter * pSender, Quality q); 50 STDMETHODIMP Disconnect(); 51 STDMETHODIMP Block(DWORD dwBlockFlags, HANDLE hEvent); 52 }; 53 54 class VideoFakeSrc : public CBaseFilter 55 { 56 private: 57 /* members */ 58 CCritSec m_critsec; 59 VideoFakeSrcPin *m_pOutputPin; 60 61 CAMEvent m_evFilterStoppingEvent; 62 63 public: 64 /* methods */ 65 VideoFakeSrc (void); ~VideoFakeSrc(void)66 ~VideoFakeSrc (void) {}; 67 68 VideoFakeSrcPin *GetOutputPin(); 69 70 /* Overrides */ 71 int GetPinCount(); 72 CBasePin *GetPin(int n); 73 74 STDMETHODIMP Run(REFERENCE_TIME tStart); 75 STDMETHODIMP Stop(void); 76 STDMETHODIMP Pause(void); 77 STDMETHODIMP JoinFilterGraph(IFilterGraph* pGraph, LPCWSTR pName); 78 }; 79 80 #endif /* __DSHOWVIDEOFAKESRC_H__ */ 81