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
21 import
"mfobjects.idl";
25 MF_SOURCE_READER_INVALID_STREAM_INDEX
= 0xffffffff,
26 MF_SOURCE_READER_ALL_STREAMS
= 0xfffffffe,
27 MF_SOURCE_READER_ANY_STREAM
= 0xfffffffe,
28 MF_SOURCE_READER_FIRST_AUDIO_STREAM
= 0xfffffffd,
29 MF_SOURCE_READER_FIRST_VIDEO_STREAM
= 0xfffffffc,
30 MF_SOURCE_READER_MEDIASOURCE
= 0xffffffff,
31 MF_SOURCE_READER_CURRENT_TYPE_INDEX
= 0xffffffff
34 typedef struct _MF_SINK_WRITER_STATISTICS
37 LONGLONG llLastTimestampReceived
;
38 LONGLONG llLastTimestampEncoded
;
39 LONGLONG llLastTimestampProcessed
;
40 LONGLONG llLastStreamTickReceived
;
41 LONGLONG llLastSinkSampleRequest
;
42 QWORD qwNumSamplesReceived
;
43 QWORD qwNumSamplesEncoded
;
44 QWORD qwNumSamplesProcessed
;
45 QWORD qwNumStreamTicksReceived
;
46 DWORD dwByteCountQueued
;
47 QWORD qwByteCountProcessed
;
48 DWORD dwNumOutstandingSinkSampleRequests
;
49 DWORD dwAverageSampleRateReceived
;
50 DWORD dwAverageSampleRateEncoded
;
51 DWORD dwAverageSampleRateProcessed
;
52 } MF_SINK_WRITER_STATISTICS
;
54 interface IMFMediaSource
;
58 uuid(70ae66f2
-c809
-4e4f
-8915-bdcb406b7993
),
61 interface IMFSourceReader
: IUnknown
63 HRESULT GetStreamSelection
([in] DWORD index
, [out] BOOL
*selected
);
64 HRESULT SetStreamSelection
([in] DWORD index
, [in] BOOL selected
);
65 HRESULT GetNativeMediaType
([in] DWORD index
, [in] DWORD typeindex
, [out] IMFMediaType
**type
);
66 HRESULT GetCurrentMediaType
([in] DWORD index
, [out] IMFMediaType
**type
);
67 HRESULT SetCurrentMediaType
([in] DWORD index
, [in, out] DWORD
*reserved
, [in] IMFMediaType
*type
);
68 HRESULT SetCurrentPosition
([in] REFGUID format
, [in] REFPROPVARIANT position
);
69 HRESULT ReadSample
([in] DWORD index
, [in] DWORD flags
, [out] DWORD
*actualindex
, [out] DWORD
*sampleflags
,
70 [out] LONGLONG
*timestamp
, [out] IMFSample
**sample
);
71 HRESULT Flush
([in] DWORD index
);
72 HRESULT GetServiceForStream
([in] DWORD index
, [in] REFGUID service
, [in] REFIID riid
, [out] void **object);
73 HRESULT GetPresentationAttribute
([in] DWORD index
, [in] REFGUID guid
, [out] PROPVARIANT
*attr
);
78 uuid(3137f1cd
-fe5e
-4805
-a5d8
-fb477448cb3d
),
81 interface IMFSinkWriter
: IUnknown
83 HRESULT AddStream
([in] IMFMediaType
*type
, [out] DWORD
*index
);
84 HRESULT SetInputMediaType
([in] DWORD index
, [in] IMFMediaType
*type
, [in] IMFAttributes
*parameters
);
85 HRESULT BeginWriting
(void);
86 HRESULT WriteSample
([in] DWORD index
, [in] IMFSample
*sample
);
87 HRESULT SendStreamTick
([in] DWORD index
, [in] LONGLONG timestamp
);
88 HRESULT PlaceMarker
([in] DWORD index
, [in] void *context
);
89 HRESULT NotifyEndOfSegment
([in] DWORD index
);
90 HRESULT Flush
([in] DWORD index
);
91 HRESULT Finalize
(void);
92 HRESULT GetServiceForStream
([in] DWORD index
, [in] REFGUID service
, [in] REFIID riid
, [out] void **object);
93 HRESULT GetStatistics
([in] DWORD index
, [out] MF_SINK_WRITER_STATISTICS
*stats
);
96 cpp_quote
( "HRESULT WINAPI MFCreateSourceReaderFromMediaSource(IMFMediaSource *source, IMFAttributes *attributes," )
97 cpp_quote
( " IMFSourceReader **reader);" )