mfcaptureengine.idl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. cpp_quote("#include <winapifamily.h>")
  7. import "mfobjects.idl";
  8. import "mfidl.idl";
  9. cpp_quote("#if WINVER >= _WIN32_WINNT_WIN7")
  10. cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
  11. cpp_quote("#ifndef _MFVideoNormalizedRect_")
  12. cpp_quote("#define _MFVideoNormalizedRect_")
  13. typedef struct MFVideoNormalizedRect {
  14. float left;
  15. float top;
  16. float right;
  17. float bottom;
  18. } MFVideoNormalizedRect;
  19. cpp_quote("#endif")
  20. typedef enum MF_CAPTURE_ENGINE_DEVICE_TYPE {
  21. MF_CAPTURE_ENGINE_DEVICE_TYPE_AUDIO = 0x00000000,
  22. MF_CAPTURE_ENGINE_DEVICE_TYPE_VIDEO = 0x00000001,
  23. } MF_CAPTURE_ENGINE_DEVICE_TYPE;
  24. typedef enum MF_CAPTURE_ENGINE_SINK_TYPE {
  25. MF_CAPTURE_ENGINE_SINK_TYPE_RECORD = 0x00000000,
  26. MF_CAPTURE_ENGINE_SINK_TYPE_PREVIEW = 0x00000001,
  27. MF_CAPTURE_ENGINE_SINK_TYPE_PHOTO = 0x00000002,
  28. } MF_CAPTURE_ENGINE_SINK_TYPE;
  29. enum {
  30. MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_VIDEO_PREVIEW = 0xfffffffa,
  31. MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_VIDEO_RECORD = 0xfffffff9,
  32. MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_PHOTO = 0xfffffff8,
  33. MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_AUDIO = 0xfffffff7,
  34. MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_METADATA = 0xfffffff6,
  35. MF_CAPTURE_ENGINE_MEDIASOURCE = 0xffffffff,
  36. };
  37. typedef enum MF_CAPTURE_ENGINE_STREAM_CATEGORY {
  38. MF_CAPTURE_ENGINE_STREAM_CATEGORY_VIDEO_PREVIEW = 0x00000000,
  39. MF_CAPTURE_ENGINE_STREAM_CATEGORY_VIDEO_CAPTURE = 0x00000001,
  40. MF_CAPTURE_ENGINE_STREAM_CATEGORY_PHOTO_INDEPENDENT = 0x00000002,
  41. MF_CAPTURE_ENGINE_STREAM_CATEGORY_PHOTO_DEPENDENT = 0x00000003,
  42. MF_CAPTURE_ENGINE_STREAM_CATEGORY_AUDIO = 0x00000004,
  43. MF_CAPTURE_ENGINE_STREAM_CATEGORY_UNSUPPORTED = 0x00000005,
  44. MF_CAPTURE_ENGINE_STREAM_CATEGORY_METADATA = 0x00000006,
  45. } MF_CAPTURE_ENGINE_STREAM_CATEGORY;
  46. typedef enum MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE {
  47. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_OTHER = 0,
  48. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_COMMUNICATIONS = 1,
  49. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_MEDIA = 2,
  50. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_GAMECHAT = 3,
  51. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_SPEECH = 4,
  52. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_FARFIELDSPEECH = 5,
  53. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_UNIFORMSPEECH = 6,
  54. MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE_VOICETYPING = 7,
  55. } MF_CAPTURE_ENGINE_MEDIA_CATEGORY_TYPE;
  56. typedef enum MF_CAPTURE_ENGINE_AUDIO_PROCESSING_MODE {
  57. MF_CAPTURE_ENGINE_AUDIO_PROCESSING_DEFAULT = 0,
  58. MF_CAPTURE_ENGINE_AUDIO_PROCESSING_RAW = 1,
  59. } MF_CAPTURE_ENGINE_AUDIO_PROCESSING_MODE;
  60. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_INITIALIZED, 0x219992bc, 0xcf92, 0x4531, 0xa1, 0xae, 0x96, 0xe1, 0xe8, 0x86, 0xc8, 0xf1);")
  61. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_PREVIEW_STARTED, 0xa416df21, 0xf9d3, 0x4a74, 0x99, 0x1b, 0xb8, 0x17, 0x29, 0x89, 0x52, 0xc4);")
  62. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_PREVIEW_STOPPED, 0x13d5143c, 0x1edd, 0x4e50,0xa2, 0xef, 0x35, 0x0a, 0x47, 0x67, 0x80, 0x60);")
  63. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_RECORD_STARTED, 0xac2b027b, 0xddf9, 0x48a0,0x89, 0xbe, 0x38, 0xab, 0x35, 0xef, 0x45, 0xc0);")
  64. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_RECORD_STOPPED, 0x55e5200a, 0xf98f, 0x4c0d, 0xa9, 0xec, 0x9e, 0xb2, 0x5e, 0xd3, 0xd7, 0x73);")
  65. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_PHOTO_TAKEN, 0x3c50c445, 0x7304, 0x48eb,0x86, 0x5d, 0xbb, 0xa1, 0x9b, 0xa3, 0xaf, 0x5c);")
  66. cpp_quote("EXTERN_GUID(MF_CAPTURE_SOURCE_CURRENT_DEVICE_MEDIA_TYPE_SET, 0xe7e75e4c, 0x039c, 0x4410, 0x81, 0x5b, 0x87, 0x41, 0x30, 0x7b, 0x63, 0xaa);")
  67. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_ERROR, 0x46b89fc6, 0x33cc, 0x4399,0x9d, 0xad, 0x78, 0x4d, 0xe7, 0x7d, 0x58, 0x7c);")
  68. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_EFFECT_ADDED, 0xaa8dc7b5, 0xa048, 0x4e13, 0x8e, 0xbe, 0xf2, 0x3c, 0x46, 0xc8, 0x30, 0xc1);")
  69. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_EFFECT_REMOVED, 0xc6e8db07, 0xfb09, 0x4a48, 0x89, 0xc6, 0xbf, 0x92, 0xa0, 0x42, 0x22, 0xc9);")
  70. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_ALL_EFFECTS_REMOVED, 0xfded7521, 0x8ed8, 0x431a, 0xa9, 0x6b, 0xf3, 0xe2, 0x56, 0x5e, 0x98, 0x1c);")
  71. cpp_quote("EXTERN_GUID(MF_CAPTURE_SINK_PREPARED, 0x7bfce257, 0x12b1, 0x4409, 0x8c, 0x34, 0xd4, 0x45, 0xda, 0xab, 0x75, 0x78);")
  72. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_OUTPUT_MEDIA_TYPE_SET, 0xcaaad994, 0x83ec, 0x45e9,0xa3, 0x0a, 0x1f, 0x20, 0xaa, 0xdb, 0x98, 0x31);")
  73. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_CAMERA_STREAM_BLOCKED, 0xa4209417, 0x8d39, 0x46f3, 0xb7, 0x59, 0x59, 0x12, 0x52, 0x8f, 0x42, 0x07);")
  74. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_CAMERA_STREAM_UNBLOCKED, 0x9be9eef0, 0xcdaf, 0x4717, 0x85, 0x64, 0x83, 0x4a, 0xae, 0x66, 0x41, 0x5c);")
  75. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_D3D_MANAGER, 0x76e25e7b, 0xd595, 0x4283, 0x96, 0x2c, 0xc5, 0x94, 0xaf, 0xd7, 0x8d, 0xdf);")
  76. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_RECORD_SINK_VIDEO_MAX_UNPROCESSED_SAMPLES, 0xb467f705, 0x7913, 0x4894, 0x9d, 0x42, 0xa2, 0x15, 0xfe, 0xa2, 0x3d, 0xa9);")
  77. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_RECORD_SINK_AUDIO_MAX_UNPROCESSED_SAMPLES, 0x1cddb141, 0xa7f4, 0x4d58, 0x98, 0x96, 0x4d, 0x15, 0xa5, 0x3c, 0x4e, 0xfe);")
  78. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_RECORD_SINK_VIDEO_MAX_PROCESSED_SAMPLES, 0xe7b4a49e, 0x382c, 0x4aef, 0xa9, 0x46, 0xae, 0xd5, 0x49, 0xb, 0x71, 0x11);")
  79. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_RECORD_SINK_AUDIO_MAX_PROCESSED_SAMPLES, 0x9896e12a, 0xf707, 0x4500, 0xb6, 0xbd, 0xdb, 0x8e, 0xb8, 0x10, 0xb5, 0xf);")
  80. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_USE_AUDIO_DEVICE_ONLY, 0x1c8077da, 0x8466, 0x4dc4, 0x8b, 0x8e, 0x27, 0x6b, 0x3f, 0x85, 0x92, 0x3b);")
  81. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_USE_VIDEO_DEVICE_ONLY, 0x7e025171, 0xcf32, 0x4f2e, 0x8f, 0x19, 0x41, 0x5, 0x77, 0xb7, 0x3a, 0x66);")
  82. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_DISABLE_HARDWARE_TRANSFORMS, 0xb7c42a6b, 0x3207, 0x4495, 0xb4, 0xe7, 0x81, 0xf9, 0xc3, 0x5d, 0x59, 0x91);")
  83. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_DISABLE_DXVA, 0xf9818862, 0x179d, 0x433f, 0xa3, 0x2f, 0x74, 0xcb, 0xcf, 0x74, 0x46, 0x6d);")
  84. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_MEDIASOURCE_CONFIG, 0xbc6989d2, 0x0fc1, 0x46e1, 0xa7, 0x4f, 0xef, 0xd3, 0x6b, 0xc7, 0x88, 0xde);")
  85. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_DECODER_MFT_FIELDOFUSE_UNLOCK_Attribute, 0x2b8ad2e8, 0x7acb, 0x4321, 0xa6, 0x06, 0x32, 0x5c, 0x42, 0x49, 0xf4, 0xfc);")
  86. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_ENCODER_MFT_FIELDOFUSE_UNLOCK_Attribute, 0x54c63a00, 0x78d5, 0x422f, 0xaa, 0x3e, 0x5e, 0x99, 0xac, 0x64, 0x92, 0x69);")
  87. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_ENABLE_CAMERA_STREAMSTATE_NOTIFICATION, 0x4c808e9d, 0xaaed, 0x4713, 0x90, 0xfb, 0xcb, 0x24, 0x06, 0x4a, 0xb8, 0xda);")
  88. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_MEDIA_CATEGORY, 0x8e3f5bd5, 0xdbbf, 0x42f0, 0x85, 0x42, 0xd0, 0x7a, 0x39, 0x71, 0x76, 0x2a);")
  89. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_AUDIO_PROCESSING, 0x10f1be5e, 0x7e11, 0x410b, 0x97, 0x3d, 0xf4, 0xb6, 0x10, 0x90, 0x0, 0xfe);")
  90. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_EVENT_GENERATOR_GUID, 0xabfa8ad5, 0xfc6d, 0x4911, 0x87, 0xe0, 0x96, 0x19, 0x45, 0xf8, 0xf7, 0xce);")
  91. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_EVENT_STREAM_INDEX, 0x82697f44, 0xb1cf, 0x42eb, 0x97, 0x53, 0xf8, 0x6d, 0x64, 0x9c, 0x88, 0x65);")
  92. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_SELECTEDCAMERAPROFILE, 0x03160b7e, 0x1c6f, 0x4db2, 0xad, 0x56, 0xa7, 0xc4, 0x30, 0xf8, 0x23, 0x92);")
  93. cpp_quote("EXTERN_GUID(MF_CAPTURE_ENGINE_SELECTEDCAMERAPROFILE_INDEX, 0x3ce88613, 0x2214, 0x46c3, 0xb4, 0x17, 0x82, 0xf8, 0xa3, 0x13, 0xc9, 0xc3);")
  94. [object, uuid(aeda51c0-9025-4983-9012-de597b88b089), local]
  95. interface IMFCaptureEngineOnEventCallback : IUnknown
  96. {
  97. HRESULT OnEvent([in] IMFMediaEvent *pEvent);
  98. }
  99. [object, uuid(52150b82-ab39-4467-980f-e48bf0822ecd), local]
  100. interface IMFCaptureEngineOnSampleCallback : IUnknown
  101. {
  102. HRESULT OnSample([in] IMFSample *pSample);
  103. }
  104. [object, uuid(72d6135b-35e9-412c-b926-fd5265f2a885), local]
  105. interface IMFCaptureSink : IUnknown
  106. {
  107. HRESULT GetOutputMediaType([in] DWORD dwSinkStreamIndex, [out] IMFMediaType **ppMediaType);
  108. HRESULT GetService([in] DWORD dwSinkStreamIndex, [in] REFGUID rguidService, [in] REFIID riid, [out] IUnknown **ppUnknown);
  109. HRESULT AddStream([in] DWORD dwSourceStreamIndex, [in] IMFMediaType *pMediaType, [in] IMFAttributes *pAttributes, [out] DWORD *pdwSinkStreamIndex);
  110. HRESULT Prepare();
  111. HRESULT RemoveAllStreams();
  112. }
  113. [object, uuid(3323b55a-f92a-4fe2-8edc-e9bfc0634d77), local]
  114. interface IMFCaptureRecordSink : IMFCaptureSink
  115. {
  116. HRESULT SetOutputByteStream([in] IMFByteStream *pByteStream, [in] REFGUID guidContainerType);
  117. HRESULT SetOutputFileName([in] LPCWSTR fileName);
  118. HRESULT SetSampleCallback([in] DWORD dwStreamSinkIndex, [in] IMFCaptureEngineOnSampleCallback *pCallback);
  119. HRESULT SetCustomSink([in] IMFMediaSink *pMediaSink);
  120. HRESULT GetRotation([in] DWORD dwStreamIndex, [out] DWORD *pdwRotationValue);
  121. HRESULT SetRotation([in] DWORD dwStreamIndex, [in] DWORD dwRotationValue);
  122. }
  123. [object, uuid(77346cfd-5b49-4d73-ace0-5b52a859f2e0), local]
  124. interface IMFCapturePreviewSink : IMFCaptureSink
  125. {
  126. HRESULT SetRenderHandle([in] HANDLE handle);
  127. HRESULT SetRenderSurface([in] IUnknown *pSurface);
  128. HRESULT UpdateVideo([in] const MFVideoNormalizedRect *pSrc, [in] const RECT *pDst, [in] const COLORREF *pBorderClr);
  129. HRESULT SetSampleCallback([in] DWORD dwStreamSinkIndex, [in] IMFCaptureEngineOnSampleCallback *pCallback);
  130. HRESULT GetMirrorState([out] WINBOOL *pfMirrorState);
  131. HRESULT SetMirrorState([in] WINBOOL fMirrorState);
  132. HRESULT GetRotation([in] DWORD dwStreamIndex, [out] DWORD *pdwRotationValue);
  133. HRESULT SetRotation([in] DWORD dwStreamIndex, [in] DWORD dwRotationValue);
  134. HRESULT SetCustomSink([in] IMFMediaSink *pMediaSink);
  135. }
  136. [object, uuid(d2d43cc8-48bb-4aa7-95db-10c06977e777), local]
  137. interface IMFCapturePhotoSink : IMFCaptureSink
  138. {
  139. HRESULT SetOutputFileName([in] LPCWSTR fileName);
  140. HRESULT SetSampleCallback([in] IMFCaptureEngineOnSampleCallback *pCallback);
  141. HRESULT SetOutputByteStream([in] IMFByteStream *pByteStream);
  142. }
  143. [object, uuid(439a42a8-0d2c-4505-be83-f79b2a05d5c4), local]
  144. interface IMFCaptureSource : IUnknown
  145. {
  146. HRESULT GetCaptureDeviceSource([in] MF_CAPTURE_ENGINE_DEVICE_TYPE mfCaptureEngineDeviceType, [out] IMFMediaSource **ppMediaSource);
  147. HRESULT GetCaptureDeviceActivate([in] MF_CAPTURE_ENGINE_DEVICE_TYPE mfCaptureEngineDeviceType, [out] IMFActivate **ppActivate);
  148. HRESULT GetService([in] REFIID rguidService, [in] REFIID riid, [out] IUnknown **ppUnknown);
  149. HRESULT AddEffect([in] DWORD dwSourceStreamIndex, [in] IUnknown *pUnknown);
  150. HRESULT RemoveEffect([in] DWORD dwSourceStreamIndex, [in]IUnknown *pUnknown);
  151. HRESULT RemoveAllEffects([in] DWORD dwSourceStreamIndex);
  152. HRESULT GetAvailableDeviceMediaType([in] DWORD dwSourceStreamIndex, [in] DWORD dwMediaTypeIndex, [out] IMFMediaType **ppMediaType);
  153. HRESULT SetCurrentDeviceMediaType([in] DWORD dwSourceStreamIndex, [in] IMFMediaType *pMediaType);
  154. HRESULT GetCurrentDeviceMediaType([in] DWORD dwSourceStreamIndex, [out] IMFMediaType **ppMediaType);
  155. HRESULT GetDeviceStreamCount([out] DWORD *pdwStreamCount);
  156. HRESULT GetDeviceStreamCategory([in] DWORD dwSourceStreamIndex, [out] MF_CAPTURE_ENGINE_STREAM_CATEGORY *pStreamCategory);
  157. HRESULT GetMirrorState([in] DWORD dwStreamIndex, [out] WINBOOL *pfMirrorState);
  158. HRESULT SetMirrorState([in] DWORD dwStreamIndex, [in] WINBOOL fMirrorState);
  159. HRESULT GetStreamIndexFromFriendlyName([in] UINT32 uifriendlyName, [out] DWORD *pdwActualStreamIndex);
  160. }
  161. cpp_quote("EXTERN_GUID(CLSID_MFCaptureEngine, 0xefce38d3, 0x8914, 0x4674,0xa7, 0xdf, 0xae, 0x1b, 0x3d, 0x65, 0x4b, 0x8a);")
  162. [object, uuid(a6bba433-176b-48b2-b375-53aa03473207), local]
  163. interface IMFCaptureEngine : IUnknown
  164. {
  165. HRESULT Initialize([in] IMFCaptureEngineOnEventCallback *pEventCallback, [in] IMFAttributes *pAttributes, [in] IUnknown *pAudioSource, [in] IUnknown *pVideoSource);
  166. HRESULT StartPreview();
  167. HRESULT StopPreview();
  168. HRESULT StartRecord();
  169. HRESULT StopRecord([in] WINBOOL bFinalize, [in] WINBOOL bFlushUnprocessedSamples);
  170. HRESULT TakePhoto();
  171. HRESULT GetSink([in] MF_CAPTURE_ENGINE_SINK_TYPE mfCaptureEngineSinkType, [out] IMFCaptureSink **ppSink);
  172. HRESULT GetSource([out] IMFCaptureSource **ppSource);
  173. }
  174. cpp_quote("EXTERN_GUID(CLSID_MFCaptureEngineClassFactory, 0xefce38d3, 0x8914, 0x4674,0xa7, 0xdf, 0xae, 0x1b, 0x3d, 0x65, 0x4b, 0x8a);")
  175. [object, uuid(8f02d140-56fc-4302-a705-3a97c78be779), local]
  176. interface IMFCaptureEngineClassFactory : IUnknown
  177. {
  178. HRESULT CreateInstance([in] REFCLSID clsid, [in] REFIID riid, [out, iid_is(riid)] LPVOID *ppvObject );
  179. }
  180. cpp_quote("EXTERN_GUID(MFSampleExtension_DeviceReferenceSystemTime, 0x6523775a, 0xba2d, 0x405f,0xb2, 0xc5, 0x01, 0xff, 0x88, 0xe2, 0xe8, 0xf6);")
  181. [object, uuid(e37ceed7-340f-4514-9f4d-9c2ae026100b), local]
  182. interface IMFCaptureEngineOnSampleCallback2 : IMFCaptureEngineOnSampleCallback
  183. {
  184. HRESULT OnSynchronizedEvent([in] IMFMediaEvent *pEvent);
  185. }
  186. [object, uuid(f9e4219e-6197-4b5e-b888-bee310ab2c59), local]
  187. interface IMFCaptureSink2 : IMFCaptureSink
  188. {
  189. HRESULT SetOutputMediaType([in] DWORD dwStreamIndex, [in] IMFMediaType *pMediaType, [in] IMFAttributes *pEncodingAttributes);
  190. }
  191. cpp_quote("#endif /* WINAPI_PARTITION_DESKTOP */")
  192. cpp_quote("#endif /* WINVER >= _WIN32_WINNT_WIN7 */")