text: //MediaFoundation.h
  
  // Copyright Querysoft Limited 2015
  //
  // Permission is hereby granted, free of charge, to any person or organization
  // obtaining a copy of the software and accompanying documentation covered by
  // this license (the "Software") to use, reproduce, display, distribute,
  // execute, and transmit the Software, and to prepare derivative works of the
  // Software, and to permit third-parties to whom the Software is furnished to
  // do so, all subject to the following:
  //
  // The copyright notices in the Software and this entire statement, including
  // the above license grant, this restriction and the following disclaimer,
  // must be included in all copies of the Software, in whole or in part, and
  // all derivative works of the Software, unless such copies or derivative
  // works are solely in the form of machine-executable object code generated by
  // a source language processor.
  //
  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  // DEALINGS IN THE SOFTWARE.
  
  #ifndef WINQL_MEDIAFOUNDATION_H_3
  #define WINQL_MEDIAFOUNDATION_H_3
  
  #ifdef	__QCMP_OPTIMIZEINCLUDE
  #pragma __QCMP_OPTIMIZEINCLUDE
  #endif//__QCMP_OPTIMIZEINCLUDE
  
  #include "WinQL/Definitions/Handles.h"
  #include "WinQL/Definitions/Data.h"
  #include "WinQL/COM/ServerObjectBase.h"
  #include "WinQL/COM/ClientBase.h"
  #include "WinQL/MediaFoundation/MediaInterfaces.h"
  
  //--------------------------------------------------------------------------------
  namespace nsWinQAPI
  {
  	class __QOR_INTERFACE( __WINQL_MEDIA ) CMFAPI;
  	class __QOR_INTERFACE( __WINQL_MEDIA ) CMF;
  	class __QOR_INTERFACE( __WINQL_MEDIA ) CMFReadWrite;
  	class __QOR_INTERFACE( __WINQL_MEDIA ) CEVRAPI;
  	class __QOR_INTERFACE( __WINQL_MEDIA ) CMFPlay;
  }
  
  //--------------------------------------------------------------------------------
  namespace nsWin32
  {
  	//--------------------------------------------------------------------------------
  	namespace nsMediaFoundation
  	{
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CMediaFoundation
  		{	
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CMediaFoundation );
  
  			//--------------------------------------------------------------------------------
  			class __QOR_INTERFACE(__WINQL_MEDIA) CLock
  			{
  			public:
  
  				__QOR_DECLARE_OCLASS_ID( CLock );
  
  				CLock();
  				~CLock();
  
  			private:
  
  				nsWinQAPI::CMFAPI& MediaFoundationHelper;
  				unsigned long m_ulStatus;
  
  				CLock( const CLock& );
  				CLock& operator = ( const CLock& );
  			};
  
  			friend class CLock;
  
  			CMediaFoundation( unsigned long ulVersion, unsigned long ulFlags );
  			~CMediaFoundation();
  			unsigned long GetTimerPeriodicity( void );
  			void AverageTimerPerFrameToFrameRate( Cmp_unsigned__int64 uiAverageTimePerFrame, Cmp_unsigned__int32* puiNumerator, Cmp_unsigned__int32* puiDenominator );
  
  		protected:
  
  			nsWinQAPI::CMFAPI& MediaFoundationHelper;
  			unsigned long m_ulStatus;
  
  		private:
  
  			CMediaFoundation();
  			CMediaFoundation( CMediaFoundation& );
  			CMediaFoundation& operator = ( const CMediaFoundation& );
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CTMediaFouncdationAPIBase
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CTMediaFouncdationAPIBase );
  
  			CTMediaFouncdationAPIBase();
  			CTMediaFouncdationAPIBase( const CTMediaFouncdationAPIBase& );
  			virtual ~CTMediaFouncdationAPIBase();
  			CTMediaFouncdationAPIBase& operator = ( const CTMediaFouncdationAPIBase& );
  
  		protected:
  
  			nsWinQAPI::CMFAPI& MediaFoundationHelper;
  
  		};
  
  		//--------------------------------------------------------------------------------
  		template< class Interface >
  		class CTMediaFoundationAPIObject : public CComPtr< Interface >, public CTMediaFouncdationAPIBase
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CTMediaFoundationAPIObject );
  
  			CTMediaFoundationAPIObject(){}
  			virtual ~CTMediaFoundationAPIObject(){}
  
  		protected:
  
  			unsigned long m_ulStatus;
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CTMediaFoundationBase
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CTMediaFoundationBase );
  
  			CTMediaFoundationBase();
  			CTMediaFoundationBase( const CTMediaFoundationBase& );
  			CTMediaFoundationBase& operator = ( const CTMediaFoundationBase& );
  			virtual ~CTMediaFoundationBase();			
  
  		protected:
  
  			nsWinQAPI::CMF& m_MFLibrary;
  		};
  
  		//--------------------------------------------------------------------------------
  		template< class Interface >
  		class CTMediaFoundationObject : public CComPtr< Interface >, public CTMediaFoundationBase
  		{
  		public:
  
  			CTMediaFoundationObject(){}
  			virtual ~CTMediaFoundationObject(){}
  
  		protected:
  
  			unsigned long m_ulStatus;
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CTMediaReadWriteBase
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CTMediaReadWriteBase );
  
  			CTMediaReadWriteBase();
  			CTMediaReadWriteBase( const CTMediaReadWriteBase& );
  			CTMediaReadWriteBase& operator = ( const CTMediaReadWriteBase& );
  			virtual ~CTMediaReadWriteBase();
  
  		protected:
  
  			nsWinQAPI::CMFReadWrite& m_ReadWriteLibrary;
  		};
  
  		//--------------------------------------------------------------------------------
  		template< class Interface >
  		class CTMediaReadWriteObject : public CComPtr< Interface >, public CTMediaReadWriteBase
  		{
  		public:
  
  			CTMediaReadWriteObject(){}
  			virtual ~CTMediaReadWriteObject(){}
  
  		protected:
  			
  			unsigned long m_ulStatus;
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CTEnhancedVideoRendererBase
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CTEnhancedVideoRendererBase );
  
  			CTEnhancedVideoRendererBase();
  			CTEnhancedVideoRendererBase( const CTEnhancedVideoRendererBase& );
  			CTEnhancedVideoRendererBase& operator = ( const CTEnhancedVideoRendererBase& );
  			virtual ~CTEnhancedVideoRendererBase();
  
  		protected:
  
  			nsWinQAPI::CEVRAPI& m_EVRLibrary;
  		};
  
  		//--------------------------------------------------------------------------------
  		template< class TInterface >
  		class CTEnhancedVideoRendererObject : public CComPtr< TInterface >, public CTEnhancedVideoRendererBase
  		{
  		public:
  
  			CTEnhancedVideoRendererObject(){}
  			virtual ~CTEnhancedVideoRendererObject(){}
  
  		protected:
  
  			unsigned long m_ulStatus;
  		};
  
  		//--------------------------------------------------------------------------------
  		template< class Interface = IMFVideoSampleAllocator >
  		class CVideoSampleAllocator : public CTEnhancedVideoRendererObject< Interface >
  		{
  		public:
  
  			//--------------------------------------------------------------------------------
  			CVideoSampleAllocator()
  			{
  				m_ulStatus = m_EVRLibrary.MFCreateVideoSampleAllocator( 
  					reinterpret_cast< const ::GUID& >( Interface::_IID ),
  					reinterpret_cast< void** >( &m_p ) );
  			}
  
  			//--------------------------------------------------------------------------------
  			virtual ~CVideoSampleAllocator()
  			{
  			}
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CVideoSample : public CTEnhancedVideoRendererObject< IMFSample >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CVideoSample );
  
  			CVideoSample( IUnknown* pUnkSurface );
  			virtual ~CVideoSample();
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CAMMediaTypeFromMFMediaType
  		{
  			
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CAMMediaTypeFromMFMediaType );
  
  			CAMMediaTypeFromMFMediaType( IMFMediaType* pMFType, GUID& guidFormatBlockType );
  			virtual ~CAMMediaTypeFromMFMediaType();
  
  			//--------------------------------------------------------------------------------
  			AM_MEDIA_TYPE* operator ->()
  			{
  				return m_pAMMediaType;
  			}
  
  		protected:
  
  			nsWinQAPI::COLE32& OLE32Helper;
  			nsWinQAPI::CMFAPI& MediaFoundationHelper;
  			unsigned long m_ulStatus;
  			AM_MEDIA_TYPE* m_pAMMediaType;
  
  		private:
  
  			CAMMediaTypeFromMFMediaType();
  			CAMMediaTypeFromMFMediaType( const CAMMediaTypeFromMFMediaType& );
  			CAMMediaTypeFromMFMediaType& operator = ( const CAMMediaTypeFromMFMediaType& );
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CASFContentInfo : public CTMediaFoundationObject< IMFASFContentInfo >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CASFContentInfo );
  
  			CASFContentInfo();
  			virtual ~CASFContentInfo();
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CASFIndexer : public CTMediaFoundationObject< IMFASFIndexer >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CASFIndexer );
  
  			CASFIndexer();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CASFIndexer()
  			{
  			}
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CASFIndexerByteStream : CTMediaFoundationObject< IMFByteStream >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CASFIndexerByteStream );
  
  			CASFIndexerByteStream( IMFByteStream* pIContentByteStream, Cmp_unsigned_long_long cbIndexStartOffset );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CASFIndexerByteStream()
  			{
  			}
  
  		};
  				
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CMediaBuffer : public CTMediaFoundationAPIObject< IMFMediaBuffer >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CMediaBuffer );
  
  			
  			//Create a media buffer that wraps another media buffer
  			CMediaBuffer( IMFMediaBuffer* pBuffer, unsigned long cbOffset, unsigned long dwLength );
  			//Create a memory aligned memory media buffer
  			CMediaBuffer( unsigned long ulMaxLength, unsigned long ulAlignmentFlags );
  			//Create a memory media buffer
  			CMediaBuffer( unsigned long ulMaxLength );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CMediaBuffer()
  			{
  			}
  
  		};
  
  		//--------------------------------------------------------------------------------
  		template< class Interface = IMFSchemeHandler >
  		class __QOR_INTERFACE(__WINQL_MEDIA) CNetSchemePlugin : public CTMediaFoundationObject< Interface >
  		{
  		public:
  
  			//--------------------------------------------------------------------------------
  			CNetSchemePlugin()
  			{
  				m_ulStatus = m_MFLibrary.MFCreateNetSchemePlugin(
  					*( reinterpret_cast< const ::GUID* >( &Interface::_IID ) ),
  					reinterpret_cast< void** >( &m_p ) );
  			}
  
  			//--------------------------------------------------------------------------------
  			virtual ~CNetSchemePlugin()
  			{
  			}			
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CPMPServer : public CTMediaFoundationObject< IMFPMPServer >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CPMPServer );
  
  			CPMPServer( unsigned long ulCreationFlags );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CPMPServer()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CPresentationClock : public CTMediaFoundationObject< IMFPresentationClock >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CPresentationClock );
  
  			CPresentationClock();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CPresentationClock()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CASFSplitter : public CTMediaFoundationObject< IMFASFSplitter >
  		{
  			
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CASFSplitter );
  
  			CASFSplitter();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CASFSplitter()
  			{
  			}
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CASFProfile : public CTMediaFoundationObject< IMFASFProfile >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CASFProfile );
  
  			CASFProfile();
  			CASFProfile( IMFPresentationDescriptor* pIPD );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CASFProfile()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CASFMultiplexer : public CTMediaFoundationObject< IMFASFMultiplexer >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CASFMultiplexer );
  
  			CASFMultiplexer();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CASFMultiplexer()
  			{
  				//_WINQ_FCONTEXT( "CASFMultplexer::~CASFMultiplexer" );
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CProxyLocator : public CTMediaFoundationObject< IMFNetProxyLocator >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CProxyLocator );
  
  			CProxyLocator( const wchar_t* pszProtocol, IPropertyStore* pProxyConfig );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CProxyLocator()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSampleCopier : public CTMediaFoundationObject< IMFTransform >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSampleCopier );
  
  			CSampleCopier();
  
  			//--------------------------------------------------------------------------------
  			~CSampleCopier()
  			{
  			}
  		};
  
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSimpleTypeHandler : public CTMediaFoundationObject< IMFMediaTypeHandler >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSimpleTypeHandler );
  
  			CSimpleTypeHandler();
  			//--------------------------------------------------------------------------------
  			virtual ~CSimpleTypeHandler()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		//Modifies a topology for use in a Terminal Services environment.
  		class __QOR_INTERFACE(__WINQL_MEDIA) CRemoteDesktopPlugin : public CTMediaFoundationObject< IMFRemoteDesktopPlugin >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CRemoteDesktopPlugin );
  
  			CRemoteDesktopPlugin();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CRemoteDesktopPlugin()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSample : public CTMediaFoundationAPIObject< IMFSample >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSample );
  
  			CSample();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CSample()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CAsyncCallback : public CServerObjectBase< IMFAsyncCallback >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CAsyncCallback );
  
  			//--------------------------------------------------------------------------------
  			CAsyncCallback()
  			{
  			}
  
  			//--------------------------------------------------------------------------------
  			virtual ~CAsyncCallback()
  			{
  			}
  
  			//--------------------------------------------------------------------------------
  			virtual unsigned long __QCMP_STDCALLCONVENTION GetParameters( unsigned long* pdwFlags, unsigned long* pdwQueue )
  			{
  				return 0;
  			}
  
  			//--------------------------------------------------------------------------------
  			virtual unsigned long __QCMP_STDCALLCONVENTION Invoke( IMFAsyncResult* pAsyncResult )
  			{
  				return 0;
  			}
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CAsyncResult : public CComPtr< IMFAsyncResult >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CAsyncResult );
  
  			CAsyncResult( IUnknown* punkObject, IMFAsyncCallback* pCallback, IUnknown* punkState );
  			virtual ~CAsyncResult();
  
  		protected:
  
  			nsWinQAPI::CMFAPI& MediaFoundationHelper;
  			unsigned long m_ulStatus;
  
  		private:
  
  			CAsyncResult();
  			CAsyncResult( const CAsyncResult& );
  			CAsyncResult& operator = ( const CAsyncResult& );
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CCreateFromFile : public CAsyncCallback
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CCreateFromFile );
  
  			CCreateFromFile( MF_FILE_ACCESSMODE AccessMode, MF_FILE_OPENMODE OpenMode, MF_FILE_FLAGS fFlags, const wchar_t* pwszFilePath, IUnknown* pState );
  			virtual unsigned long __QCMP_STDCALLCONVENTION GetParameters( unsigned long* pdwFlags, unsigned long* pdwQueue );
  			virtual unsigned long __QCMP_STDCALLCONVENTION Invoke( IMFAsyncResult* pAsyncResult );
  			virtual ~CCreateFromFile();
  			void Cancel( void );
  
  		protected:
  
  			nsWinQAPI::CMFAPI& m_MFLibrary;
  			unsigned long m_ulStatus;
  			IUnknown* m_pCancelCookie;
  			IMFByteStream* m_pIMFByteStream;
  
  		private:
  
  			CCreateFromFile();
  			CCreateFromFile( const CCreateFromFile& );
  			CCreateFromFile& operator = ( const CCreateFromFile& );
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CScheduledWorkItem : public CAsyncCallback
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CScheduledWorkItem );
  
  			CScheduledWorkItem( IUnknown* pState, Cmp_signed__int64 Timeout );
  			virtual ~CScheduledWorkItem();
  			virtual unsigned long __QCMP_STDCALLCONVENTION GetParameters( unsigned long* pdwFlags, unsigned long* pdwQueue );
  			virtual unsigned long __QCMP_STDCALLCONVENTION Invoke( IMFAsyncResult* pAsyncResult );
  			unsigned long Cancel( void );
  
  		protected:
  
  			unsigned long m_ulStatus;
  			nsWinQAPI::CMFAPI& m_MFLibrary;
  			Cmp_unsigned_long_long m_Key;
  
  		private:
  
  			CScheduledWorkItem();
  			CScheduledWorkItem( const CScheduledWorkItem& );
  			CScheduledWorkItem& operator = ( const CScheduledWorkItem& );
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CCredentialCache : public CTMediaFoundationObject< IMFNetCredentialCache >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CCredentialCache );
  
  			CCredentialCache();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CCredentialCache()
  			{
  			}
  		};
  
  
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CEventQueue : public CTMediaFoundationAPIObject< IMFMediaEventQueue >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CEventQueue );
  
  			CEventQueue();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CEventQueue()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CByteStream : public CTMediaFoundationAPIObject< IMFByteStream >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CByteStream );
  
  			//Create a byte stream on a file
  			CByteStream( const wchar_t* pwszFileURL, MF_FILE_ACCESSMODE AccessMode, MF_FILE_OPENMODE OpenMode, MF_FILE_FLAGS fFlags );
  			//Create a byte stream on a temp file
  			CByteStream( MF_FILE_ACCESSMODE AccessMode, MF_FILE_OPENMODE OpenMode, MF_FILE_FLAGS fFlags );
  			//Create a byte stream on an IStream
  			CByteStream( IStream* pStream );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CByteStream()
  			{
  			}
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CMediaEvent : public CTMediaFoundationAPIObject< IMFMediaEvent >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CMediaEvent );
  
  			CMediaEvent( unsigned long met, const GUID& guidExtendedType, unsigned long hrStatus, const PROPVARIANT* pvValue );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CMediaEvent()
  			{
  			}
  		};
  		
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSourceResolver : public CTMediaFoundationAPIObject< IMFSourceResolver >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSourceResolver );
  
  			CSourceResolver();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CSourceResolver()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CStandardQualityManager : public CTMediaFoundationObject< IMFQualityManager >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CStandardQualityManager );
  
  			CStandardQualityManager();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CStandardQualityManager()
  			{
  			}
  
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CStreamDescriptor : public CTMediaFoundationAPIObject< IMFStreamDescriptor >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CStreamDescriptor );
  
  			CStreamDescriptor( unsigned long dwStreamIdentifier, unsigned long cMediaTypes, IMFMediaType** apMediaTypes );
  
  			//--------------------------------------------------------------------------------
  			virtual ~CStreamDescriptor()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSystemTimeSource : public CTMediaFoundationAPIObject< IMFPresentationTimeSource >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSystemTimeSource );
  
  			CSystemTimeSource();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CSystemTimeSource()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CTranscodeProfile : public CTMediaFoundationObject< IMFTranscodeProfile >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CTranscodeProfile );
  
  			CTranscodeProfile();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CTranscodeProfile()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		//The default topology resolver that the media session uses to get a full topolgy from a partial one
  		class __QOR_INTERFACE(__WINQL_MEDIA) CTopologyLoader : public CTMediaFoundationObject< IMFTopoLoader >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CTopologyLoader );
  
  			CTopologyLoader();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CTopologyLoader()
  			{
  			}
  		};
  
  
  		//--------------------------------------------------------------------------------
  		template< class Interface >
  		class __QOR_INTERFACE(__WINQL_MEDIA) CVideoRenderer : public CTMediaFoundationObject< Interface >
  		{
  		public:
  
  			//--------------------------------------------------------------------------------
  			CVideoRenderer()
  			{
  				m_ulStatus = m_MFLibrary.MFCreateVideoRenderer(
  					reinterpret_cast< const ::GUID& >( Interface::_IID ),
  					reinterpret_cast< void** >( &m_p ) );
  			}
  
  			//--------------------------------------------------------------------------------
  			virtual ~CVideoRenderer()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CPluginManager : public CTMediaFoundationAPIObject< IMFPluginControl >
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CPluginManager );
  
  			CPluginManager();
  
  			//--------------------------------------------------------------------------------
  			virtual ~CPluginManager()
  			{
  			}
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSupportedMimeTypes : public PROPVARIANT
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSupportedMimeTypes );
  
  			CSupportedMimeTypes();
  			virtual ~CSupportedMimeTypes();
  
  		protected:
  
  			nsWinQAPI::CMF& m_MFLibrary;
  			nsWinQAPI::COLE32& m_Ole32Helper;
  			unsigned long m_ulStatus;
  
  		private:
  
  			CSupportedMimeTypes( const CSupportedMimeTypes& );
  			CSupportedMimeTypes& operator = ( const CSupportedMimeTypes& );
  		};
  
  		//--------------------------------------------------------------------------------
  		//Retrieves the URL schemes that are registered for the source resolver.
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSupportedSchemes : public PROPVARIANT
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSupportedSchemes );
  
  			CSupportedSchemes();
  			virtual ~CSupportedSchemes();
  
  		protected:
  
  			nsWinQAPI::COLE32& m_Ole32Helper;
  			nsWinQAPI::CMF& m_MFLibrary;
  			unsigned long m_ulStatus;
  
  		private:
  
  			CSupportedSchemes( const CSupportedSchemes& );
  			CSupportedSchemes& operator = ( const CSupportedSchemes& );
  		};
  
  		//--------------------------------------------------------------------------------
  		class __QOR_INTERFACE(__WINQL_MEDIA) CSystemTime
  		{
  		public:
  
  			__QOR_DECLARE_OCLASS_ID( CSystemTime );
  
  			CSystemTime();
  			~CSystemTime();
  			operator Cmp_long_long();
  
  		protected:
  
  			nsWinQAPI::CMFAPI& MediaFoundationHelper;
  			unsigned long m_ulStatus;
  
  		private:
  
  			CSystemTime( const CSystemTime& );
  			CSystemTime& operator = ( const CSystemTime& );
  		};
  
  	}//nsMediaFoundation
  	
  }//nsWin32
  
  #endif//WINQL_MEDIAFOUNDATION_H_3
  