RtspSourceOutputPin.h

Go to the documentation of this file.
00001 
00035 #pragma once
00036 
00037 #pragma warning(push)     // disable for this header only
00038 #pragma warning(disable:4312) 
00039 // DirectShow
00040 #include <Streams.h>
00041 #pragma warning(pop)      // restore original warning level
00042 // STL
00043 #include <string>
00044 #include <queue>
00045 
00046 // Forward
00047 class MediaSample;
00048 class RtspSourceFilter;
00049 class MediaSubsession;
00050 
00051 
00052 class RtspSourceOutputPin : public CSourceStream,
00053                                                         public IAMPushSource
00054 {
00056         DECLARE_IUNKNOWN; // Need this for the IAMPushSource interface
00057 
00058         friend class RtspSourceFilter;
00059 public:
00061         RtspSourceOutputPin(HRESULT* pHr, RtspSourceFilter* pFilter, MediaSubsession* pMediaSubsession, int nID);
00062 
00064         virtual ~RtspSourceOutputPin(void);
00065 
00067         STDMETHODIMP Notify(IBaseFilter* pSelf, Quality q)
00068         {
00069                 return E_FAIL;
00070         }
00071 
00073         STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void **ppv)
00074         {
00075                 if (riid == IID_IAMPushSource)
00076                         return GetInterface((IAMPushSource *)this, ppv);
00077                 else
00078                         return CSourceStream::NonDelegatingQueryInterface(riid, ppv); 
00079         }
00080 
00082         STDMETHODIMP GetMaxStreamOffset(REFERENCE_TIME *prtMaxOffset){return E_NOTIMPL;}
00084         STDMETHODIMP GetPushSourceFlags(ULONG *pFlags)
00085         { 
00086                 *pFlags = AM_PUSHSOURCECAPS_PRIVATE_CLOCK;return S_OK;
00087         }
00089         STDMETHODIMP GetStreamOffset(REFERENCE_TIME *prtOffset){return E_NOTIMPL;}
00091         STDMETHODIMP SetMaxStreamOffset(REFERENCE_TIME rtMaxOffset)     {return E_NOTIMPL;}
00093         STDMETHODIMP SetPushSourceFlags(ULONG Flags)    {return E_NOTIMPL;}
00095         STDMETHODIMP SetStreamOffset(REFERENCE_TIME rtOffset){return E_NOTIMPL;}
00097         STDMETHODIMP GetLatency(REFERENCE_TIME *prtLatency)
00098         { 
00099                 return E_NOTIMPL;
00100                 //TODO: set different latencies for audio and video
00101                 //Set 450ms Latency 
00102                 *prtLatency = 45000000; return S_OK;
00103         }
00104 
00107         void setOffset(double dOffset);
00108 
00109 protected:
00110 
00111         void initialiseMediaType(MediaSubsession* pMediaSubsession, HRESULT* phr);
00112 
00114         virtual HRESULT GetMediaType(CMediaType* pMediaType);
00115 
00117         HRESULT DecideBufferSize(IMemAllocator* pAlloc, ALLOCATOR_PROPERTIES* pRequestProperties);
00118 
00120         HRESULT FillBuffer(IMediaSample* pSample);
00121 
00123         virtual HRESULT DoBufferProcessingLoop(void);    // the loop executed whilst running
00124         
00125 private:
00127         RtspSourceFilter* m_pFilter;
00129         CCritSec m_cSharedState;
00130 
00132         CMediaType* m_pMediaType;
00133 
00134         // Audio parameters
00135         int m_nBitsPerSample;
00136         int m_nChannels;
00137         int m_nBytesPerSecond;
00138         int m_nSamplesPerSecond;
00139 
00140         // ID
00141         int m_nID;
00142 
00144         bool m_bOffsetSet;
00146         bool m_bHasBeenSynced;
00147 
00149         double m_dGlobalStartTime;
00152         double m_dLocalStartTime;
00153 };

Generated on Fri Mar 13 14:12:38 2009 for RTVC by  doxygen 1.5.3