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.

205 lines
4.0 KiB

  1. //
  2. // FORMATS.H
  3. //
  4. #ifndef __STREAM_FORMATS__
  5. #define __STREAM_FORMATS__
  6. #include <amvideo.h>
  7. class CTAudioFormat :
  8. public CComObjectRootEx<CComMultiThreadModel>,
  9. public IDispatchImpl<ITScriptableAudioFormat, &IID_ITScriptableAudioFormat, &LIBID_TAPI3Lib>,
  10. public CMSPObjectSafetyImpl
  11. {
  12. public:
  13. CTAudioFormat();
  14. ~CTAudioFormat();
  15. DECLARE_GET_CONTROLLING_UNKNOWN()
  16. virtual HRESULT FinalConstruct(void);
  17. public:
  18. BEGIN_COM_MAP(CTAudioFormat)
  19. COM_INTERFACE_ENTRY(ITScriptableAudioFormat)
  20. COM_INTERFACE_ENTRY(IDispatch)
  21. COM_INTERFACE_ENTRY(IObjectSafety)
  22. END_COM_MAP()
  23. public:
  24. STDMETHOD(get_Channels)(
  25. OUT long* pVal
  26. );
  27. STDMETHOD(put_Channels)(
  28. IN const long nNewVal
  29. );
  30. STDMETHOD(get_SamplesPerSec)(
  31. OUT long* pVal
  32. );
  33. STDMETHOD(put_SamplesPerSec)(
  34. IN const long nNewVal
  35. );
  36. STDMETHOD(get_AvgBytesPerSec)(
  37. OUT long* pVal
  38. );
  39. STDMETHOD(put_AvgBytesPerSec)(
  40. IN const long nNewVal
  41. );
  42. STDMETHOD(get_BlockAlign)(
  43. OUT long* pVal
  44. );
  45. STDMETHOD(put_BlockAlign)(
  46. IN const long nNewVal
  47. );
  48. STDMETHOD(get_BitsPerSample)(
  49. OUT long* pVal
  50. );
  51. STDMETHOD(put_BitsPerSample)(
  52. IN const long nNewVal
  53. );
  54. STDMETHOD(get_FormatTag)(
  55. OUT long* pVal
  56. );
  57. STDMETHOD(put_FormatTag)(
  58. IN const long nNewVal
  59. );
  60. private:
  61. WAVEFORMATEX m_wfx; // Waveformat structure
  62. CMSPCritSection m_Lock; // Critical section
  63. IUnknown* m_pFTM; // pointer to the free threaded marshaler
  64. public:
  65. HRESULT Initialize(
  66. IN const WAVEFORMATEX* pwfx
  67. )
  68. {
  69. //
  70. // Don't care right now for the buffer
  71. //
  72. m_wfx = *pwfx;
  73. m_wfx.cbSize = 0;
  74. return S_OK;
  75. }
  76. };
  77. /*
  78. class CTVideoFormat :
  79. public CComObjectRootEx<CComMultiThreadModel>,
  80. public IDispatchImpl<ITScriptableVideoFormat, &IID_ITScriptableVideoFormat, &LIBID_TAPI3Lib>,
  81. public CMSPObjectSafetyImpl
  82. {
  83. public:
  84. CTVideoFormat();
  85. ~CTVideoFormat();
  86. DECLARE_GET_CONTROLLING_UNKNOWN()
  87. virtual HRESULT FinalConstruct(void);
  88. public:
  89. BEGIN_COM_MAP(CTVideoFormat)
  90. COM_INTERFACE_ENTRY(ITScriptableVideoFormat)
  91. COM_INTERFACE_ENTRY(IDispatch)
  92. COM_INTERFACE_ENTRY(IObjectSafety)
  93. END_COM_MAP()
  94. public:
  95. STDMETHOD(get_BitRate)(
  96. OUT long* pVal
  97. );
  98. STDMETHOD(put_BitRate)(
  99. IN const long nNewVal
  100. );
  101. STDMETHOD(get_BitErrorRate)(
  102. OUT long* pVal
  103. );
  104. STDMETHOD(put_BitErrorRate)(
  105. IN const long nNewVal
  106. );
  107. STDMETHOD(get_AvgTimePerFrame)(
  108. OUT double* pVal
  109. );
  110. STDMETHOD(put_AvgTimePerFrame)(
  111. IN const double nNewVal
  112. );
  113. STDMETHOD(get_Width)(
  114. OUT long* pVal
  115. );
  116. STDMETHOD(put_Width)(
  117. IN const long nNewVal
  118. );
  119. STDMETHOD(get_Height)(
  120. OUT long* pVal
  121. );
  122. STDMETHOD(put_Height)(
  123. IN const long nNewVal
  124. );
  125. STDMETHOD(get_BitCount)(
  126. OUT long* pVal
  127. );
  128. STDMETHOD(put_BitCount)(
  129. IN const long nNewVal
  130. );
  131. STDMETHOD(get_Compression)(
  132. OUT long* pVal
  133. );
  134. STDMETHOD(put_Compression)(
  135. IN const long nNewVal
  136. );
  137. STDMETHOD(get_SizeImage)(
  138. OUT long* pVal
  139. );
  140. STDMETHOD(put_SizeImage)(
  141. IN const long nNewVal
  142. );
  143. private:
  144. VIDEOINFOHEADER m_vih; // Video structure
  145. CMSPCritSection m_Lock; // Critical section
  146. IUnknown* m_pFTM; // pointer to the free threaded marshaler
  147. public:
  148. HRESULT Initialize(
  149. IN const VIDEOINFOHEADER* pvih
  150. )
  151. {
  152. m_vih = *pvih;
  153. return S_OK;
  154. }
  155. };
  156. */
  157. #endif
  158. // eof