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.

161 lines
4.7 KiB

  1. /*++
  2. Copyright (c) 1995-1996 Microsoft Corporation
  3. Module Name:
  4. medistrm.h
  5. Abstract:
  6. Contains constants and class declarations for the abstract MediaStream object. A MediaStream
  7. represents a single unidirectional stream, such as a received Video channel.
  8. --*/
  9. #ifndef _IMSTREAM_H_
  10. #define _IMSTREAM_H_
  11. #include <pshpack8.h> /* Assume 8 byte packing throughout */
  12. class IStreamEventNotify
  13. {
  14. public:
  15. virtual HRESULT __stdcall EventNotification(UINT uDirection, UINT uMediaType, UINT uEventCode, UINT uSubCode)=0;
  16. };
  17. DECLARE_INTERFACE_(IMediaChannel, IUnknown)
  18. {
  19. // *** IUnknown methods ***
  20. STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID FAR* ppvObj) PURE;
  21. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  22. STDMETHOD_(ULONG,Release) (THIS) PURE;
  23. STDMETHOD(GetProperty)(THIS_ DWORD dwProp, PVOID pBuf, LPUINT pcbBuf) PURE;
  24. STDMETHOD(SetProperty)(THIS_ DWORD dwProp, PVOID pBuf, UINT cbBuf) PURE;
  25. STDMETHOD(Configure)(THIS_ BYTE *pFormat, UINT cbFormat,
  26. BYTE *pChannelParams, UINT cbParams,
  27. IUnknown *pUnknown) PURE;
  28. STDMETHOD(SetNetworkInterface)(THIS_ IUnknown *pUnknown) PURE;
  29. STDMETHOD(Start)(THIS ) PURE;
  30. STDMETHOD(Stop)(THIS) PURE;
  31. STDMETHOD_(DWORD, GetState)(THIS) PURE;
  32. STDMETHOD(SetMaxBitrate) (THIS_ UINT uMaxBitrate) PURE;
  33. };
  34. class IAudioChannel : public IMediaChannel
  35. {
  36. public:
  37. virtual HRESULT __stdcall GetSignalLevel(UINT *pLevel)=0;
  38. };
  39. class IVideoChannel : public IMediaChannel
  40. {
  41. public:
  42. virtual HRESULT __stdcall SetTemporalSpatialTradeOff(DWORD dwVal)=0;
  43. virtual HRESULT __stdcall GetTemporalSpatialTradeOff(DWORD *pdwVal)=0;
  44. virtual HRESULT __stdcall SendKeyFrame(void) = 0;
  45. virtual HRESULT __stdcall ShowDeviceDialog(DWORD dwFlags)=0;
  46. virtual HRESULT __stdcall GetDeviceDialog(DWORD *pdwFlags)=0;
  47. };
  48. // return values for GetState
  49. #define MSSTATE_UNCONFIGURED 0
  50. #define MSSTATE_CONFIGURED 1
  51. #define MSSTATE_STARTED 2
  52. // flag values for CreateMediaChannel()
  53. typedef enum
  54. {
  55. MCF_SEND = 1,
  56. MCF_RECV = 2,
  57. MCF_AUDIO = 4,
  58. MCF_VIDEO = 8,
  59. MCF_DEFAULT_DEVICE = 16
  60. } MC_FLAGS;
  61. #undef INTERFACE
  62. #define INTERFACE IMediaChannelBuilder
  63. DECLARE_INTERFACE_( IMediaChannelBuilder, IUnknown)
  64. {
  65. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  66. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  67. STDMETHOD_(ULONG,Release) (THIS) PURE;
  68. STDMETHOD(Initialize) (THIS_ HWND hWnd, HINSTANCE hInst) PURE;
  69. STDMETHOD(CreateMediaChannel) (THIS_ UINT flags, IMediaChannel **ppI) PURE;
  70. STDMETHOD(SetStreamEventObj) (THIS_ IStreamEventNotify *pNotify) PURE;
  71. };
  72. class IMixer : public IUnknown
  73. {
  74. public:
  75. virtual BOOL __stdcall SetVolume(DWORD dwVolume)=0;
  76. virtual BOOL __stdcall CanSetVolume()=0;
  77. virtual BOOL __stdcall SetMainVolume(DWORD dwVolume)=0;
  78. virtual BOOL __stdcall SetSubVolume(DWORD dwVolume)=0;
  79. virtual BOOL __stdcall SetAGC(BOOL fOn)=0;
  80. virtual BOOL __stdcall GetMainVolume(LPDWORD pdwVolume)=0;
  81. virtual BOOL __stdcall GetSubVolume(LPDWORD pdwVolume)=0;
  82. virtual BOOL __stdcall GetAGC(BOOL *pfOn)=0;
  83. virtual BOOL __stdcall EnableMicrophone()=0;
  84. virtual BOOL __stdcall UnMuteVolume()=0;
  85. };
  86. class IAudioDevice : public IUnknown
  87. {
  88. public:
  89. virtual HRESULT __stdcall GetRecordID(UINT *puWaveDevID)=0;
  90. virtual HRESULT __stdcall SetRecordID(UINT uWaveDevID)=0;
  91. virtual HRESULT __stdcall GetPlaybackID(UINT *puWaveDevID)=0;
  92. virtual HRESULT __stdcall SetPlaybackID(UINT uWaveDevID)=0;
  93. virtual HRESULT __stdcall GetDuplex(BOOL *pbFullDuplex)=0;
  94. virtual HRESULT __stdcall SetDuplex(BOOL bFullDuplex)=0;
  95. virtual HRESULT __stdcall GetSilenceLevel(UINT *puLevel)=0;
  96. virtual HRESULT __stdcall SetSilenceLevel(UINT uLevel)=0;
  97. virtual HRESULT __stdcall GetAutoMix(BOOL *pbAutoMix)=0;
  98. virtual HRESULT __stdcall SetAutoMix(BOOL bAutoMix)=0;
  99. virtual HRESULT __stdcall GetDirectSound(BOOL *pbDS)=0;
  100. virtual HRESULT __stdcall SetDirectSound(BOOL bDS)=0;
  101. virtual HRESULT __stdcall GetMixer(HWND hwnd, BOOL bPlayback, IMixer **ppMixer)=0;
  102. };
  103. enum STREAM_EVENTS
  104. {
  105. STREAM_EVENT_DEVICE_FAILURE=1001,
  106. STREAM_EVENT_DEVICE_OPEN,
  107. STREAM_EVENT_DEVICE_CLOSE
  108. };
  109. // hiword of GetSignalLevel contains may these status bits
  110. #define SIGNAL_STATUS_TRANSMIT 0x01 // data is being received/sent
  111. #define SIGNAL_STATUS_JAMMED 0x02 // wave dev failed to open
  112. typedef HRESULT (WINAPI *CREATE_SP)(IMediaChannelBuilder **);
  113. #define DTMF_STAR 10
  114. #define DTMF_POUND 11
  115. #define DTMF_A 12
  116. #define DTMF_B 13
  117. #define DTMF_C 14
  118. #define DTMF_D 15
  119. class IDTMFSend : public IUnknown
  120. {
  121. public:
  122. virtual HRESULT __stdcall AddDigit(int nDigit) = 0;
  123. virtual HRESULT __stdcall ResetDTMF() = 0;
  124. };
  125. #include <poppack.h> /* End byte packing */
  126. #endif // _MEDISTRM_H_