home *** CD-ROM | disk | FTP | other *** search
- //==========================================================================;
- //
- // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
- // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
- // PURPOSE.
- //
- // Copyright (c) 1992 - 1996 Microsoft Corporation. All Rights Reserved.
- //
- //--------------------------------------------------------------------------;
-
-
- /* Minimal Null filter - derived from CTransInPlaceFilter.
-
- This filter has one input pin, one output pin and
- does its transform in-place (i.e. without copying the data)
- on the push thread (i.e. it is called with a buffer, which it
- transforms and gives to the next filter downstream. It is
- then blocked until that filter returns. It then returns
- to its own caller). This filter in fact does the null transform
- it merely passes the data on unchanged.
- */
-
- #include <streams.h> // Active Movie (includes windows.h)
-
- #include <initguid.h> // declares DEFINE_GUID to declare an EXTERN_C const.
-
- // The CLSID used by the minimal, in-place, null filter
- // DO NOT REUSE IT. Run uuidgen.exe to create a new one.
- // {08af6540-4f21-11cf-aacb-0020af0b99a3}
- DEFINE_GUID(CLSID_NullNull,
- 0x08af6540, 0x4f21, 0x11cf, 0xaa, 0xcb, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3);
-
-
- // setup data
-
- AMOVIESETUP_MEDIATYPE sudPinTypes = { &MEDIATYPE_NULL // clsMajorType
- , &MEDIASUBTYPE_NULL } ; // clsMinorType
-
- AMOVIESETUP_PIN psudPins[] = { { L"Input" // strName
- , FALSE // bRendered
- , FALSE // bOutput
- , FALSE // bZero
- , FALSE // bMany
- , &CLSID_NULL // clsConnectsToFilter
- , L"Output" // strConnectsToPin
- , 1 // nTypes
- , &sudPinTypes } // lpTypes
- , { L"Output" // strName
- , FALSE // bRendered
- , TRUE // bOutput
- , FALSE // bZero
- , FALSE // bMany
- , &CLSID_NULL // clsConnectsToFilter
- , L"Input" // strConnectsToPin
- , 1 // nTypes
- , &sudPinTypes } }; // lpTypes
-
-
- AMOVIESETUP_FILTER sudNullNull = { &CLSID_NullNull // clsID
- , L"Minimal Null" // strName
- , MERIT_DO_NOT_USE // dwMerit
- , 2 // nPins
- , psudPins }; // lpPin
-
- // CNullNull
- //
- class CNullNull
- : public CTransInPlaceFilter
- {
-
- public:
-
- static CUnknown *CreateInstance(LPUNKNOWN punk, HRESULT *phr);
-
- DECLARE_IUNKNOWN;
-
- LPAMOVIESETUP_FILTER GetSetupData()
- {
- return &sudNullNull;
- }
-
- private:
-
- // Constructor - just calls the base class constructor
- CNullNull(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr)
- : CTransInPlaceFilter (tszName, punk, CLSID_NullNull, phr)
- { }
-
- // Overrides the PURE virtual Transform of CTransInPlaceFilter base class
- // This is where the "real work" is done by altering *pSample.
- // We do the Null transform by leaving it alone.
- HRESULT Transform(IMediaSample *pSample){ return NOERROR; }
-
- // We accept any input type. We'd return S_FALSE for any we didn't like.
- HRESULT CheckInputType(const CMediaType* mtIn) { return S_OK; }
- };
-
-
-
- // Needed for the CreateInstance mechanism
- CFactoryTemplate g_Templates[]=
- { {L"Minimal null", &CLSID_NullNull, CNullNull::CreateInstance}
- };
- int g_cTemplates = sizeof(g_Templates)/sizeof(g_Templates[0]);
-
-
- //
- // CreateInstance
- //
- // Provide the way for COM to create a CNullNull object
- CUnknown *CNullNull::CreateInstance(LPUNKNOWN punk, HRESULT *phr) {
-
- CNullNull *pNewObject = new CNullNull(NAME("Minimal, in-place, null filter"), punk, phr );
- if (pNewObject == NULL) {
- *phr = E_OUTOFMEMORY;
- }
-
- return pNewObject;
- } // CreateInstance
-
-
- /******************************Public*Routine******************************\
- * exported entry points for registration and
- * unregistration (in this case they only call
- * through to default implmentations).
- *
- *
- *
- * History:
- *
- \**************************************************************************/
- HRESULT
- DllRegisterServer()
- {
- return AMovieDllRegisterServer();
- }
-
- HRESULT
- DllUnregisterServer()
- {
- return AMovieDllUnregisterServer();
- }
-
- // Microsoft C Compiler will give hundreds of warnings about
- // unused inline functions in header files. Try to disable them.
- #pragma warning( disable:4514)
-