Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.1 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dpvcpi.h
  6. * Content: Base class for providing compression DLL implementation
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 10/27/99 rodtoll Created
  12. ***************************************************************************/
  13. #ifndef __DPVCPI_H
  14. #define __DPVCPI_H
  15. #undef DPF_SUBCOMP
  16. #define DPF_SUBCOMP DN_SUBCOMP_VOICE
  17. struct DPVCPIOBJECT;
  18. class CDPVCPI
  19. {
  20. protected:
  21. struct CompressionNode
  22. {
  23. DVFULLCOMPRESSIONINFO *pdvfci;
  24. CompressionNode *pcnNext;
  25. };
  26. public:
  27. CDPVCPI();
  28. virtual ~CDPVCPI();
  29. public: // These functions must be implemented for the compression provider
  30. static HRESULT I_CreateCompressor( DPVCPIOBJECT *This, LPWAVEFORMATEX lpwfxSrcFormat, GUID guidTargetCT, PDPVCOMPRESSOR *ppCompressor, DWORD dwFlags );
  31. static HRESULT I_CreateDeCompressor( DPVCPIOBJECT *This, GUID guidTargetCT, LPWAVEFORMATEX lpwfxSrcFormat, PDPVCOMPRESSOR *ppCompressor, DWORD dwFlags );
  32. public: // A pre-built version
  33. static HRESULT DeInitCompressionList();
  34. static HRESULT QueryInterface( DPVCPIOBJECT *This, REFIID riid, PVOID *ppvObj );
  35. static HRESULT AddRef( DPVCPIOBJECT *This );
  36. static HRESULT Release( DPVCPIOBJECT *This );
  37. BOOL InitClass();
  38. static HRESULT EnumCompressionTypes( DPVCPIOBJECT *This, PVOID pBuffer, PDWORD pdwSize, PDWORD pdwNumElements, DWORD dwFlags );
  39. static HRESULT IsCompressionSupported( DPVCPIOBJECT *This, GUID guidCT );
  40. static HRESULT GetCompressionInfo( DPVCPIOBJECT *This, GUID guidCT, PVOID pbuffer, PDWORD pdwSize );
  41. public: // These functions must be implemented
  42. virtual HRESULT CreateCompressor( DPVCPIOBJECT *This, LPWAVEFORMATEX lpwfxSrcFormat, GUID guidTargetCT, PDPVCOMPRESSOR *ppCompressor, DWORD dwFlags ) = 0;
  43. virtual HRESULT CreateDeCompressor( DPVCPIOBJECT *This, GUID guidTargetCT, LPWAVEFORMATEX lpwfxSrcFormat, PDPVCOMPRESSOR *ppCompressor, DWORD dwFlags ) = 0;
  44. protected: // Useful utility functions
  45. friend struct DPVCPIOBJECT;
  46. // Add an element to the internal compression types list
  47. static HRESULT CN_Add( DVFULLCOMPRESSIONINFO *pdvfci );
  48. // Retrieve pointer to the compression type specified by the GUID
  49. static HRESULT CN_Get( GUID guidCT, DVFULLCOMPRESSIONINFO **pdvfci );
  50. // Free up the list, deallocating memory.
  51. static HRESULT CN_FreeList();
  52. static void CN_FreeItem( CompressionNode *pcNode );
  53. // Checks to see the size (in bytes) of the specified compression info structure
  54. static HRESULT CI_GetSize( DVFULLCOMPRESSIONINFO *pdvfci, LPDWORD lpdwSize );
  55. protected:
  56. static CompressionNode *s_pcnList; // List of compression types
  57. static BOOL s_fIsLoaded; // Have compression types been loaded.
  58. static DWORD s_dwNumCompressionTypes; // # of valid compression types
  59. DNCRITICAL_SECTION m_csLock; // Lock for the object.
  60. LONG m_lRefCount; // Reference count for the object
  61. BOOL m_fCritSecInited;
  62. };
  63. struct DPVCPIOBJECT
  64. {
  65. LPVOID lpvVtble;
  66. CDPVCPI *pObject;
  67. };
  68. typedef DPVCPIOBJECT *LPDPVCPIOBJECT, *PDPVCPIOBJECT;
  69. #endif