2 * Copyright (C) 2017 Alistair Leslie-Hughes
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 import
"mfobjects.idl";
20 import
"mftransform.idl";
22 typedef [v1_enum] enum MF_SOURCE_READER_CONTROL_FLAG
24 MF_SOURCE_READER_CONTROLF_DRAIN
= 0x00000001,
25 } MF_SOURCE_READER_CONTROL_FLAG
;
26 cpp_quote
("DEFINE_ENUM_FLAG_OPERATORS(MF_SOURCE_READER_CONTROL_FLAG)")
30 MF_SOURCE_READER_INVALID_STREAM_INDEX
= 0xffffffff,
31 MF_SOURCE_READER_ALL_STREAMS
= 0xfffffffe,
32 MF_SOURCE_READER_ANY_STREAM
= 0xfffffffe,
33 MF_SOURCE_READER_FIRST_AUDIO_STREAM
= 0xfffffffd,
34 MF_SOURCE_READER_FIRST_VIDEO_STREAM
= 0xfffffffc,
35 MF_SOURCE_READER_MEDIASOURCE
= 0xffffffff,
36 MF_SOURCE_READER_CURRENT_TYPE_INDEX
= 0xffffffff
39 typedef [v1_enum] enum MF_SOURCE_READER_FLAG
41 MF_SOURCE_READERF_ERROR
= 0x00000001,
42 MF_SOURCE_READERF_ENDOFSTREAM
= 0x00000002,
43 MF_SOURCE_READERF_NEWSTREAM
= 0x00000004,
44 MF_SOURCE_READERF_NATIVEMEDIATYPECHANGED
= 0x00000010,
45 MF_SOURCE_READERF_CURRENTMEDIATYPECHANGED
= 0x00000020,
46 MF_SOURCE_READERF_STREAMTICK
= 0x00000100,
47 MF_SOURCE_READERF_ALLEFFECTSREMOVED
= 0x00000200,
48 } MF_SOURCE_READER_FLAG
;
49 cpp_quote
("DEFINE_ENUM_FLAG_OPERATORS(MF_SOURCE_READER_FLAG)")
53 MF_SINK_WRITER_INVALID_STREAM_INDEX
= 0xffffffff,
54 MF_SINK_WRITER_ALL_STREAMS
= 0xfffffffe,
55 MF_SINK_WRITER_MEDIASINK
= 0xffffffff,
58 typedef struct _MF_SINK_WRITER_STATISTICS
61 LONGLONG llLastTimestampReceived
;
62 LONGLONG llLastTimestampEncoded
;
63 LONGLONG llLastTimestampProcessed
;
64 LONGLONG llLastStreamTickReceived
;
65 LONGLONG llLastSinkSampleRequest
;
66 QWORD qwNumSamplesReceived
;
67 QWORD qwNumSamplesEncoded
;
68 QWORD qwNumSamplesProcessed
;
69 QWORD qwNumStreamTicksReceived
;
70 DWORD dwByteCountQueued
;
71 QWORD qwByteCountProcessed
;
72 DWORD dwNumOutstandingSinkSampleRequests
;
73 DWORD dwAverageSampleRateReceived
;
74 DWORD dwAverageSampleRateEncoded
;
75 DWORD dwAverageSampleRateProcessed
;
76 } MF_SINK_WRITER_STATISTICS
;
78 cpp_quote
("EXTERN_GUID(CLSID_MFReadWriteClassFactory, 0x48e2ed0f, 0x98c2, 0x4a37, 0xbe, 0xd5, 0x16, 0x63, 0x12, 0xdd, 0xd8, 0x3f);")
79 cpp_quote
("EXTERN_GUID(CLSID_MFSourceReader, 0x1777133c, 0x0881, 0x411b, 0xa5, 0x77, 0xad, 0x54, 0x5f, 0x07, 0x14, 0xc4);")
80 cpp_quote
("EXTERN_GUID(CLSID_MFSinkWriter, 0xa3bbfb17, 0x8273, 0x4e52, 0x9e, 0x0e, 0x97, 0x39, 0xdc, 0x88, 0x79, 0x90);")
82 cpp_quote
("EXTERN_GUID(MF_MEDIASINK_AUTOFINALIZE_SUPPORTED, 0x48c131be, 0x135a, 0x41cb, 0x82, 0x90, 0x03, 0x65, 0x25, 0x09, 0xc9, 0x99);")
83 cpp_quote
("EXTERN_GUID(MF_MEDIASINK_ENABLE_AUTOFINALIZE, 0x34014265, 0xcb7e, 0x4cde, 0xac, 0x7c, 0xef, 0xfd, 0x3b, 0x3c, 0x25, 0x30);")
85 cpp_quote
("EXTERN_GUID(MF_SINK_WRITER_ASYNC_CALLBACK, 0x48cb183e, 0x7b0b, 0x46f4, 0x82, 0x2e, 0x5e, 0x1d, 0x2d, 0xda, 0x43, 0x54);")
86 cpp_quote
("EXTERN_GUID(MF_SINK_WRITER_DISABLE_THROTTLING, 0x08b845d8, 0x2b74, 0x4afe, 0x9d, 0x53, 0xbe, 0x16, 0xd2, 0xd5, 0xae, 0x4f);")
87 cpp_quote
("EXTERN_GUID(MF_SINK_WRITER_D3D_MANAGER, 0xec822da2, 0xe1e9, 0x4b29, 0xa0, 0xd8, 0x56, 0x3c, 0x71, 0x9f, 0x52, 0x69);")
88 cpp_quote
("EXTERN_GUID(MF_SINK_WRITER_ENCODER_CONFIG, 0xad91cd04, 0xa7cc, 0x4ac7, 0x99, 0xb6, 0xa5, 0x7b, 0x9a, 0x4a, 0x7c, 0x70);")
90 cpp_quote
("EXTERN_GUID(MF_READWRITE_DISABLE_CONVERTERS, 0x98d5b065, 0x1374, 0x4847, 0x8d, 0x5d, 0x31, 0x52, 0x0f, 0xee, 0x71, 0x56);")
91 cpp_quote
("EXTERN_GUID(MF_READWRITE_ENABLE_AUTOFINALIZE, 0xdd7ca129, 0x8cd1, 0x4dc5, 0x9d, 0xde, 0xce, 0x16, 0x86, 0x75, 0xde, 0x61);")
92 cpp_quote
("EXTERN_GUID(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, 0xa634a91c, 0x822b, 0x41b9, 0xa4, 0x94, 0x4d, 0xe4, 0x64, 0x36, 0x12, 0xb0);")
93 cpp_quote
("EXTERN_GUID(MF_READWRITE_MMCSS_CLASS, 0x39384300, 0xd0eb, 0x40b1, 0x87, 0xa0, 0x33, 0x18, 0x87, 0x1b, 0x5a, 0x53);")
94 cpp_quote
("EXTERN_GUID(MF_READWRITE_MMCSS_PRIORITY, 0x43ad19ce, 0xf33f, 0x4ba9, 0xa5, 0x80, 0xe4, 0xcd, 0x12, 0xf2, 0xd1, 0x44);")
95 cpp_quote
("EXTERN_GUID(MF_READWRITE_MMCSS_CLASS_AUDIO, 0x430847da, 0x0890, 0x4b0e, 0x93, 0x8c, 0x05, 0x43, 0x32, 0xc5, 0x47, 0xe1);")
96 cpp_quote
("EXTERN_GUID(MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0x273db885, 0x2de2, 0x4db2, 0xa6, 0xa7, 0xfd, 0xb6, 0x6f, 0xb4, 0x0b, 0x61);")
97 cpp_quote
("EXTERN_GUID(MF_READWRITE_D3D_OPTIONAL, 0x216479d9, 0x3071, 0x42ca, 0xbb, 0x6c, 0x4c, 0x22, 0x10, 0x2e, 0x1d, 0x18);")
99 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_ASYNC_CALLBACK, 0x1e3dbeac, 0xbb43, 0x4c35, 0xb5, 0x07, 0xcd, 0x64, 0x44, 0x64, 0xc9, 0x65);")
100 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_D3D_MANAGER, 0xec822da2, 0xe1e9, 0x4b29, 0xa0, 0xd8, 0x56, 0x3c, 0x71, 0x9f, 0x52, 0x69);")
101 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_D3D11_BIND_FLAGS, 0x33f3197b, 0xf73a, 0x4e14, 0x8d, 0x85, 0x0e, 0x4c, 0x43, 0x68, 0x78, 0x8d);")
102 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_DISABLE_CAMERA_PLUGINS, 0x9d3365dd, 0x058f, 0x4cfb, 0x9f, 0x97, 0xb3, 0x14, 0xcc, 0x99, 0xc8, 0xad);")
103 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_DISABLE_DXVA, 0xaa456cfd, 0x3943, 0x4a1e, 0xa7, 0x7d, 0x18, 0x38, 0xc0, 0xea, 0x2e, 0x35);")
104 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, 0x56b67165, 0x219e, 0x456d, 0xa2, 0x2e, 0x2d, 0x30, 0x04, 0xc7, 0xfe, 0x56);")
105 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_ENABLE_ADVANCED_VIDEO_PROCESSING, 0x0f81da2c, 0xb537, 0x4672, 0xa8, 0xb2, 0xa6, 0x81, 0xb1, 0x73, 0x07, 0xa3);")
106 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_ENABLE_TRANSCODE_ONLY_TRANSFORMS, 0xdfd4f008, 0xb5fd, 0x4e78, 0xae, 0x44, 0x62, 0xa1, 0xe6, 0x7b, 0xbe, 0x27);")
107 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, 0xfb394f3d, 0xccf1, 0x42ee, 0xbb, 0xb3, 0xf9, 0xb8, 0x45, 0xd5, 0x68, 0x1d);")
108 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS, 0x6d23f5c8, 0xc5d7, 0x4a9b, 0x99, 0x71, 0x5d, 0x11, 0xf8, 0xbc, 0xa8, 0x80);")
109 cpp_quote
("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CONFIG, 0x9085abeb, 0x0354, 0x48f9, 0xab, 0xb5, 0x20, 0x0d, 0xf8, 0x38, 0xc6, 0x8e);")
113 uuid(deec8d99
-fa1d
-4d82
-84c2
-2c8969944867
),
116 interface IMFSourceReaderCallback
: IUnknown
118 HRESULT OnReadSample
(
120 [in] DWORD stream_index
,
121 [in] DWORD stream_flags
,
122 [in] LONGLONG timestamp
,
123 [in] IMFSample
*sample
);
125 HRESULT OnFlush
([in] DWORD stream_index
);
128 [in] DWORD stream_index
,
129 [in] IMFMediaEvent
*event
);
134 uuid(cf839fe6
-8c2a
-4dd2
-b6ea
-c22d6961af05
),
137 interface IMFSourceReaderCallback2
: IMFSourceReaderCallback
139 HRESULT OnTransformChange
();
141 HRESULT OnStreamError
(
142 [in] DWORD stream_index
,
143 [in] HRESULT status
);
146 interface IMFMediaSource
;
150 uuid(70ae66f2
-c809
-4e4f
-8915-bdcb406b7993
),
153 interface IMFSourceReader
: IUnknown
155 HRESULT GetStreamSelection
([in] DWORD index
, [out] BOOL
*selected
);
156 HRESULT SetStreamSelection
([in] DWORD index
, [in] BOOL selected
);
157 HRESULT GetNativeMediaType
([in] DWORD index
, [in] DWORD typeindex
, [out] IMFMediaType
**type
);
158 HRESULT GetCurrentMediaType
([in] DWORD index
, [out] IMFMediaType
**type
);
159 HRESULT SetCurrentMediaType
([in] DWORD index
, [in, out] DWORD
*reserved
, [in] IMFMediaType
*type
);
160 HRESULT SetCurrentPosition
([in] REFGUID format
, [in] REFPROPVARIANT position
);
161 HRESULT ReadSample
([in] DWORD index
, [in] DWORD flags
, [out] DWORD
*actualindex
, [out] DWORD
*sampleflags
,
162 [out] LONGLONG
*timestamp
, [out] IMFSample
**sample
);
163 HRESULT Flush
([in] DWORD index
);
164 HRESULT GetServiceForStream
([in] DWORD index
, [in] REFGUID service
, [in] REFIID riid
, [out] void **object);
165 HRESULT GetPresentationAttribute
([in] DWORD index
, [in] REFGUID guid
, [out] PROPVARIANT
*attr
);
170 uuid(7b981cf0
-560e-4116-9875-b099895f23d7
),
173 interface IMFSourceReaderEx
: IMFSourceReader
175 HRESULT SetNativeMediaType
(
176 [in] DWORD stream_index
,
177 [in] IMFMediaType
*media_type
,
178 [out] DWORD
*stream_flags
);
180 HRESULT AddTransformForStream
(
181 [in] DWORD stream_index
,
182 [in] IUnknown
*transform
);
184 HRESULT RemoveAllTransformsForStream
(
185 [in] DWORD stream_index
);
187 HRESULT GetTransformForStream
(
188 [in] DWORD stream_index
,
189 [in] DWORD transform_index
,
190 [out] GUID
*category
,
191 [out] IMFTransform
**transform
);
196 uuid(3137f1cd
-fe5e
-4805
-a5d8
-fb477448cb3d
),
199 interface IMFSinkWriter
: IUnknown
201 HRESULT AddStream
([in] IMFMediaType
*type
, [out] DWORD
*index
);
202 HRESULT SetInputMediaType
([in] DWORD index
, [in] IMFMediaType
*type
, [in] IMFAttributes
*parameters
);
203 HRESULT BeginWriting
(void);
204 HRESULT WriteSample
([in] DWORD index
, [in] IMFSample
*sample
);
205 HRESULT SendStreamTick
([in] DWORD index
, [in] LONGLONG timestamp
);
206 HRESULT PlaceMarker
([in] DWORD index
, [in] void *context
);
207 HRESULT NotifyEndOfSegment
([in] DWORD index
);
208 HRESULT Flush
([in] DWORD index
);
209 HRESULT Finalize
(void);
210 HRESULT GetServiceForStream
([in] DWORD index
, [in] REFGUID service
, [in] REFIID riid
, [out] void **object);
211 HRESULT GetStatistics
([in] DWORD index
, [out] MF_SINK_WRITER_STATISTICS
*stats
);
216 uuid(588d72ab
-5Bc1
-496a
-8714-b70617141b25
),
219 interface IMFSinkWriterEx
: IMFSinkWriter
221 HRESULT GetTransformForStream
([in] DWORD index
, [in] DWORD tindex
, [out] GUID
*category
,
222 [out] IMFTransform
**transform
);
227 uuid(17c3779e
-3cde
-4ede
-8c60
-3899f5f53ad6
),
230 interface IMFSinkWriterEncoderConfig
: IUnknown
232 HRESULT SetTargetMediaType
(
233 [in] DWORD stream_index
,
234 [in] IMFMediaType
*media_type
,
235 [in] IMFAttributes
*encoding_parameters
);
237 HRESULT PlaceEncodingParameters
(
238 [in] DWORD stream_index
,
239 [in] IMFAttributes
*encoding_parameters
);
244 uuid(666f76de
-33d2
-41b9
-a458
-29ed0a972c58
),
247 interface IMFSinkWriterCallback
: IUnknown
250 [in] HRESULT status
);
253 [in] DWORD stream_index
,
259 uuid(2456bd58
-c067
-4513-84fe
-8d0c88ffdc61
),
262 interface IMFSinkWriterCallback2
: IMFSinkWriterCallback
264 HRESULT OnTransformChange
();
266 HRESULT OnStreamError
(
267 [in] DWORD stream_index
,
268 [in] HRESULT status
);
273 uuid(e7fe2e12
-661c
-40da
-92f9
-4f002ab67627
),
276 interface IMFReadWriteClassFactory
: IUnknown
278 HRESULT CreateInstanceFromURL
([in] REFCLSID clsid
, [in] LPCWSTR url
, [in] IMFAttributes
*attributes
,
279 [in] REFIID riid
, [out, iid_is(riid
)] void **object );
281 HRESULT CreateInstanceFromObject
([in] REFCLSID clsid
, [in] IUnknown
*unk
, [in] IMFAttributes
*attributes
,
282 [in] REFIID riid
, [out, iid_is(riid
)] void **object );
285 cpp_quote
( "HRESULT WINAPI MFCreateSinkWriterFromMediaSink(IMFMediaSink *sink, IMFAttributes *attributes," )
286 cpp_quote
( " IMFSinkWriter **writer);" )
287 cpp_quote
( "HRESULT WINAPI MFCreateSinkWriterFromURL(const WCHAR *url, IMFByteStream *bytestream," )
288 cpp_quote
( " IMFAttributes *attributes, IMFSinkWriter **writer);" )
289 cpp_quote
( "HRESULT WINAPI MFCreateSourceReaderFromByteStream(IMFByteStream *stream, IMFAttributes *attributes," )
290 cpp_quote
( " IMFSourceReader **reader);" )
291 cpp_quote
( "HRESULT WINAPI MFCreateSourceReaderFromMediaSource(IMFMediaSource *source, IMFAttributes *attributes," )
292 cpp_quote
( " IMFSourceReader **reader);" )
293 cpp_quote
( "HRESULT WINAPI MFCreateSourceReaderFromURL(const WCHAR *url, IMFAttributes *attributes, IMFSourceReader **reader);" )