1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
/*
* COM Classes for evr
*
* Copyright 2017 Fabian Maurer
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
import "unknwn.idl";
import "propidl.idl";
import "mfidl.idl";
import "mftransform.idl";
import "mediaobj.idl";
import "strmif.idl";
cpp_quote("#ifndef _MFVideoNormalizedRect_")
cpp_quote("#define _MFVideoNormalizedRect_")
typedef struct MFVideoNormalizedRect
{
float left;
float top;
float right;
float bottom;
} MFVideoNormalizedRect;
cpp_quote("#endif")
typedef enum _MFVP_MESSAGE_TYPE {
MFVP_MESSAGE_FLUSH,
MFVP_MESSAGE_INVALIDATEMEDIATYPE,
MFVP_MESSAGE_PROCESSINPUTNOTIFY,
MFVP_MESSAGE_BEGINSTREAMING,
MFVP_MESSAGE_ENDSTREAMING,
MFVP_MESSAGE_ENDOFSTREAM,
MFVP_MESSAGE_STEP,
MFVP_MESSAGE_CANCELSTEP,
} MFVP_MESSAGE_TYPE;
[
object,
uuid(29aff080-182a-4a5d-af3b-448f3a6346cb),
local
]
interface IMFVideoPresenter : IMFClockStateSink
{
HRESULT ProcessMessage(
[in] MFVP_MESSAGE_TYPE eMessage,
[in] ULONG_PTR ulParam
);
HRESULT GetCurrentMediaType(
[out] IMFVideoMediaType **ppMediaType
);
}
[
object,
uuid(83e91e85-82c1-4ea7-801d-85dc50b75086),
local
]
interface IEVRFilterConfig : IUnknown
{
HRESULT SetNumberOfStreams(
[in] DWORD dwMaxStreams
);
HRESULT GetNumberOfStreams(
[out] DWORD *pdwMaxStreams
);
}
[
object,
uuid(1f6a9f17-e70b-4e24-8ae4-0b2c3ba7a4ae),
local
]
interface IMFVideoPositionMapper : IUnknown
{
HRESULT MapOutputCoordinateToInputStream(
[in] float xOut,
[in] float yOut,
[in] DWORD dwOutputStreamIndex,
[in] DWORD dwInputStreamIndex,
[out] float *pxIn,
[out] float *pyIn
);
}
[
object,
uuid(dfdfd197-a9ca-43d8-b341-6af3503792cd),
local
]
interface IMFVideoRenderer : IUnknown
{
HRESULT InitializeRenderer(
[in] IMFTransform *pVideoMixer,
[in] IMFVideoPresenter *pVideoPresenter
);
}
typedef enum _MF_SERVICE_LOOKUP_TYPE
{
MF_SERVICE_LOOKUP_UPSTREAM,
MF_SERVICE_LOOKUP_UPSTREAM_DIRECT,
MF_SERVICE_LOOKUP_DOWNSTREAM,
MF_SERVICE_LOOKUP_DOWNSTREAM_DIRECT,
MF_SERVICE_LOOKUP_ALL,
MF_SERVICE_LOOKUP_GLOBAL,
} MF_SERVICE_LOOKUP_TYPE;
[
object,
uuid(fa993889-4383-415a-a930-dd472a8cf6f7),
local
]
interface IMFTopologyServiceLookup : IUnknown
{
HRESULT LookupService(
[in] MF_SERVICE_LOOKUP_TYPE lookup_type,
[in] DWORD index,
[in] REFGUID service,
[in] REFIID riid,
[out, iid_is(riid)] void **objects,
[in, out] DWORD *num_objects
);
}
[
object,
uuid(fa99388a-4383-415a-a930-dd472a8cf6f7),
local
]
interface IMFTopologyServiceLookupClient : IUnknown
{
HRESULT InitServicePointers(
[in] IMFTopologyServiceLookup *service_lookup
);
HRESULT ReleaseServicePointers();
}
[
object,
uuid(a38d9567-5a9c-4f3c-b293-8eb415b279ba),
local
]
interface IMFVideoDeviceID : IUnknown
{
HRESULT GetDeviceID(
[out] IID *device_id
);
}
[
object,
uuid(a5c6c53f-c202-4aa5-9695-175ba8c508a5)
]
interface IMFVideoMixerControl : IUnknown
{
HRESULT SetStreamZOrder(
[in] DWORD stream_id,
[in] DWORD zorder
);
HRESULT GetStreamZOrder(
[in] DWORD stream_id,
[out] DWORD *zorder
);
HRESULT SetStreamOutputRect(
[in] DWORD stream_id,
[in] const MFVideoNormalizedRect *rect
);
HRESULT GetStreamOutputRect(
[in] DWORD stream_id,
[out] MFVideoNormalizedRect *rect
);
}
typedef enum _MFVideoMixPrefs
{
MFVideoMixPrefs_ForceHalfInterlace = 0x00000001,
MFVideoMixPrefs_AllowDropToHalfInterlace = 0x00000002,
MFVideoMixPrefs_AllowDropToBob = 0x00000004,
MFVideoMixPrefs_ForceBob = 0x00000008,
MFVideoMixPrefs_EnableRotation = 0x00000010,
MFVideoMixPrefs_Mask = 0x0000001f,
} MFVideoMixPrefs;
[
object,
uuid(8459616d-966e-4930-b658-54fa7e5a16d3)
]
interface IMFVideoMixerControl2 : IMFVideoMixerControl
{
HRESULT SetMixingPrefs(
[in] DWORD flags
);
HRESULT GetMixingPrefs(
[out] DWORD *flags
);
}
[
object,
uuid(56c294d0-753e-4260-8d61-a3d8820b1d54),
local
]
interface IMFDesiredSample : IUnknown
{
HRESULT GetDesiredSampleTimeAndDuration(
[out] LONGLONG *sample_time,
[out] LONGLONG *sample_duration
);
void SetDesiredSampleTimeAndDuration(
[in] LONGLONG sample_time,
[in] LONGLONG sample_duration
);
void Clear();
}
typedef enum MFVideoAspectRatioMode
{
MFVideoARMode_None = 0x00000000,
MFVideoARMode_PreservePicture = 0x00000001,
MFVideoARMode_PreservePixel = 0x00000002,
MFVideoARMode_NonLinearStretch = 0x00000004,
MFVideoARMode_Mask = 0x00000007,
} MFVideoAspectRatioMode;
[
object,
uuid(a490b1e4-ab84-4d31-a1b2-181e03b1077a),
]
interface IMFVideoDisplayControl : IUnknown
{
HRESULT GetNativeVideoSize(
[in, out, unique] SIZE *video_size,
[in, out, unique] SIZE *aspect_ratio
);
HRESULT GetIdealVideoSize(
[in, out, unique] SIZE *min_size,
[in, out, unique] SIZE *max_size
);
HRESULT SetVideoPosition(
[in, unique] const MFVideoNormalizedRect *source,
[in, unique] const RECT *dest
);
HRESULT GetVideoPosition(
[out] MFVideoNormalizedRect *source,
[out] RECT *dest
);
HRESULT SetAspectRatioMode(
[in] DWORD mode
);
HRESULT GetAspectRatioMode(
[out] DWORD *mode
);
HRESULT SetVideoWindow(
[in] HWND window
);
HRESULT GetVideoWindow(
[out] HWND *window
);
HRESULT RepaintVideo();
HRESULT GetCurrentImage(
[in, out] LPBITMAPINFOHEADER header,
[out, size_is(, *dib_size)] BYTE **dib,
[out] DWORD *dib_size,
[in, out, unique] LONGLONG *timestamp
);
HRESULT SetBorderColor(
[in] COLORREF color
);
HRESULT GetBorderColor(
[out] COLORREF *color
);
HRESULT SetRenderingPrefs(
[in] DWORD flags
);
HRESULT GetRenderingPrefs(
[out] DWORD *flags
);
HRESULT SetFullscreen(
[in] BOOL fullscreen
);
HRESULT GetFullscreen(
[out] BOOL *fullscreen
);
}
cpp_quote("DEFINE_GUID(MR_VIDEO_RENDER_SERVICE, 0x1092a86c, 0xab1a, 0x459a, 0xa3, 0x36, 0x83, 0x1f, 0xbc, 0x4d, 0x11, 0xff);")
cpp_quote("DEFINE_GUID(MR_VIDEO_MIXER_SERVICE, 0x073cd2fc, 0x6cf4, 0x40b7, 0x88, 0x59, 0xe8, 0x95, 0x52, 0xc8, 0x41, 0xf8);")
cpp_quote("DEFINE_GUID(MR_VIDEO_ACCELERATION_SERVICE, 0xefef5175, 0x5c7d, 0x4ce2, 0xbb, 0xbd, 0x34, 0xff, 0x8b, 0xca, 0x65, 0x54);")
cpp_quote("DEFINE_GUID(MR_BUFFER_SERVICE, 0xa562248c, 0x9ac6, 0x4ffc, 0x9f, 0xba, 0x3a, 0xf8, 0xf8, 0xad, 0x1a, 0x4d);")
cpp_quote("DEFINE_GUID(VIDEO_ZOOM_RECT, 0x7aaa1638, 0x1b7f, 0x4c93, 0xbd, 0x89, 0x5b, 0x9c, 0x9f, 0xb6, 0xfc, 0xf0);")
cpp_quote("HRESULT WINAPI MFCreateVideoMixer(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);")
cpp_quote("HRESULT WINAPI MFCreateVideoMixerAndPresenter(IUnknown *mixer_outer, IUnknown *presenter_outer, ")
cpp_quote(" REFIID riid_mixer, void **mixer, REFIID riid_presenter, void **presenter);")
cpp_quote("HRESULT WINAPI MFCreateVideoPresenter(IUnknown *owner, REFIID riid_device, REFIID riid, void **obj);")
cpp_quote("HRESULT WINAPI MFCreateVideoRenderer(REFIID riid, void **renderer);")
cpp_quote("HRESULT WINAPI MFCreateVideoSampleAllocator(REFIID riid, void **allocator);")
cpp_quote("HRESULT WINAPI MFCreateVideoSampleFromSurface(IUnknown *surface, IMFSample **sample);")