home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / mac / SiteBldr / AMOVIE / SDK / _SETUP / COMMON.Z / nullip.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  3.6 KB  |  122 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1992 - 1996  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // NullInPlace filter - derived from CTransInPlaceFilter.
  13.  
  14.  
  15. class CNullInPlaceInputPin : public CTransInPlaceInputPin
  16. {
  17. public:
  18.     CNullInPlaceInputPin(   TCHAR *pObjectName
  19.                           , CTransInPlaceFilter *pTransInPlaceFilter
  20.                           , HRESULT * phr
  21.                           , LPCWSTR pName
  22.                         )
  23.                   : CTransInPlaceInputPin(   pObjectName
  24.                                            , pTransInPlaceFilter
  25.                                            , phr
  26.                                            , pName
  27.                                          )
  28.     {
  29.     }
  30.  
  31.     HRESULT CheckMediaType(const CMediaType* pmt);
  32. };
  33.  
  34. class CNullInPlaceOutputPin : public CTransInPlaceOutputPin
  35. {
  36. public:
  37.     CNullInPlaceOutputPin(   TCHAR *pObjectName
  38.                           , CTransInPlaceFilter *pTransInPlaceFilter
  39.                           , HRESULT * phr
  40.                           , LPCWSTR pName
  41.                         )
  42.                   : CTransInPlaceOutputPin(   pObjectName
  43.                                            , pTransInPlaceFilter
  44.                                            , phr
  45.                                            , pName
  46.                                          )
  47.     {
  48.     }
  49.  
  50.     HRESULT CheckMediaType(const CMediaType* pmt);
  51. };
  52.  
  53. // CNullInPlace
  54. //
  55. class CNullInPlace
  56.     : public CTransInPlaceFilter,
  57.       public INullIPP,
  58.       public ISpecifyPropertyPages
  59. {
  60.  
  61.     friend class CNullInPlaceInputPin;
  62.     friend class CNullInPlaceOutputPin;
  63.  
  64. public:
  65.  
  66.     static CUnknown *CreateInstance(LPUNKNOWN punk, HRESULT *phr);
  67.  
  68.     DECLARE_IUNKNOWN;
  69.  
  70.     //
  71.     // --- CTransInPlaceFilter Overrides --
  72.     //
  73.  
  74.     virtual CBasePin *GetPin( int n );
  75.  
  76.     HRESULT Receive(IMediaSample *pSample);
  77.     HRESULT CompleteConnect(PIN_DIRECTION dir,IPin *pReceivePin);
  78.     HRESULT CheckInputType(const CMediaType* mtIn) { return S_OK; }
  79.  
  80.     // Basic COM - used here to reveal our property interface.
  81.     STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
  82.  
  83.     STDMETHODIMP get_IPin (IPin **ppPin) ;
  84.     STDMETHODIMP put_MediaType(CMediaType *pmt);
  85.     STDMETHODIMP get_MediaType(CMediaType **pmt);
  86.     STDMETHODIMP get_State(FILTER_STATE *state);
  87.  
  88.  
  89.     //
  90.     // --- ISpecifyPropertyPages ---
  91.     //
  92.  
  93.     STDMETHODIMP GetPages(CAUUID *pPages);
  94.  
  95.     // setup helper
  96.     LPAMOVIESETUP_FILTER GetSetupData();
  97.  
  98. private:
  99.  
  100.     // Constructor
  101.     CNullInPlace(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr);
  102.  
  103.     // Overrides the PURE virtual Transform of CTransInPlaceFilter base class
  104.     // This is where the "real work" is done.
  105.     HRESULT Transform(IMediaSample *pSample){ return NOERROR; }
  106.  
  107.     // If there are multiple instances of this filter active, it's
  108.     // useful for debug messages etc. to know which one this is.
  109.     static m_nInstanceCount;                   // total instances
  110.     int m_nThisInstance;
  111.  
  112.     CMediaType m_mtPreferred ;
  113.  
  114.  
  115. #ifdef PERF
  116.     int m_idReceive;
  117. #endif
  118.  
  119.     CCritSec            m_NullIPLock;          // To serialise access.
  120. };
  121.  
  122.