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.

154 lines
4.2 KiB

  1. /*
  2. - INSCODEC.H
  3. -
  4. * Microsoft NetMeeting
  5. * Network Audio Controller (NAC) DLL
  6. * Internal header file for installable codecs
  7. *
  8. * Revision History:
  9. *
  10. * When Who What
  11. * -------- ------------------ ---------------------------------------
  12. * 1.29.97 Yoram Yaacovi Created
  13. *
  14. */
  15. #include <pshpack8.h> /* Assume 8 byte packing throughout */
  16. /*
  17. * Macros
  18. */
  19. #define COMPARE_GUIDS(a,b) RtlEqualMemory((a), (b), sizeof(GUID))
  20. #define ACQMUTEX(hMutex) \
  21. while (WaitForSingleObject(hMutex, 10000) == WAIT_TIMEOUT) \
  22. { \
  23. ERRORMSG(("Thread 0x%x waits on mutex\n", GetCurrentThreadId())); \
  24. } \
  25. #define RELMUTEX(hMutex) ReleaseMutex(hMutex)
  26. #define IMPL(class, member, pointer) \
  27. (&((class *)0)->member == pointer, ((class *) (((LONG_PTR) pointer) - offsetof (class, member))))
  28. /*
  29. * Data Structures
  30. */
  31. /****************************************************************************
  32. * @doc INTERNAL DATASTRUC AUDIO
  33. *
  34. * @class CInstallAudioCodecs | Installable Audio codecs
  35. *
  36. * @base public | IInstallAudioCodecs
  37. *
  38. ***************************************************************************/
  39. class CInstallAudioCodecs : public IInstallAudioCodecs
  40. {
  41. public:
  42. // IUnknown methods
  43. STDMETHODIMP QueryInterface (REFIID riid, void **ppv);
  44. STDMETHODIMP_(ULONG) AddRef (void);
  45. STDMETHODIMP_(ULONG) Release (void);
  46. // IInstallAudioCodecs methods
  47. STDMETHODIMP AddACMFormat (LPWAVEFORMATEX lpwfx, PBASIC_AUDCAP_INFO pAudCapInfo);
  48. STDMETHODIMP RemoveACMFormat (LPWAVEFORMATEX lpwfx);
  49. STDMETHODIMP ReorderFormats (PAUDCAP_INFO_LIST pAudCapInfoList);
  50. STDMETHODIMP EnumFormats(PAUDCAP_INFO_LIST *ppAudCapInfoList);
  51. STDMETHODIMP FreeBuffer(LPVOID lpBuffer);
  52. private:
  53. // Private functions
  54. // Debug display functions
  55. // Variables
  56. };
  57. /****************************************************************************
  58. * @doc INTERNAL DATASTRUC VIDEO
  59. *
  60. * @class CInstallVideoCodecs | Installable Video codecs
  61. *
  62. * @base public | IInstallVideoCodecs
  63. *
  64. ***************************************************************************/
  65. class CInstallVideoCodecs : public IInstallVideoCodecs
  66. {
  67. public:
  68. // IUnknown methods
  69. STDMETHODIMP QueryInterface (REFIID riid, void **ppv);
  70. STDMETHODIMP_(ULONG) AddRef (void);
  71. STDMETHODIMP_(ULONG) Release (void);
  72. // IInstallVideoCodecs methods
  73. STDMETHODIMP AddVCMFormat (PVIDCAP_INFO pVidCapInfo);
  74. STDMETHODIMP RemoveVCMFormat (PVIDCAP_INFO pVidCapInfo);
  75. STDMETHODIMP ReorderFormats (PVIDCAP_INFO_LIST pVidCapInfoList);
  76. STDMETHODIMP EnumFormats(PVIDCAP_INFO_LIST *ppVidCapInfoList);
  77. STDMETHODIMP FreeBuffer(LPVOID lpBuffer);
  78. private:
  79. // Private functions
  80. STDMETHODIMP AddRemoveVCMFormat(PVIDCAP_INFO pVidCapInfo,
  81. BOOL bAdd);
  82. // Debug display functions
  83. // Variables
  84. };
  85. /****************************************************************************
  86. * @doc INTERNAL DATASTRUC
  87. *
  88. * @class CInstallCodecs | Installable codecs
  89. *
  90. * @base public | IUnknown
  91. *
  92. ***************************************************************************/
  93. class CInstallCodecs : public IInstallCodecs
  94. {
  95. friend class CInstallAudioCodecs;
  96. friend class CInstallVideoCodecs;
  97. public:
  98. // IUnknown methods
  99. STDMETHODIMP QueryInterface (REFIID riid, void **ppv);
  100. STDMETHODIMP_(ULONG) AddRef (void);
  101. STDMETHODIMP_(ULONG) Release (void);
  102. CInstallCodecs (void);
  103. ~CInstallCodecs (void);
  104. HRESULT Initialize(REFIID riid);
  105. private:
  106. // Functions
  107. STDMETHODIMP FreeBuffer(LPVOID lpBuffer);
  108. STDMETHODIMP TranslateHr(HRESULT hr);
  109. // Audio and video interfaces
  110. CInstallAudioCodecs ifAudio;
  111. CInstallVideoCodecs ifVideo;
  112. // Variables
  113. // @cmember Reference Count
  114. int m_cRef;
  115. // Two public members to allow access from the nested classes
  116. // @cmember Pointer to an audio capability interface
  117. LPAPPCAPPIF m_pAudAppCaps;
  118. // @cmember Pointer to an video capability interface
  119. LPAPPVIDCAPPIF m_pVidAppCaps;
  120. };
  121. /*
  122. * Globals
  123. */
  124. EXTERN_C HANDLE g_hMutex;
  125. EXTERN_C class CInstallCodecs *g_pIC;
  126. /*
  127. * Function prototypes
  128. */
  129. #include <poppack.h> /* End byte packing */
  130.