1/* 2 * Copyright 2016 Michael Müller 3 * 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. 8 * 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. 13 * 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 17 */ 18 19import "mfobjects.idl"; 20import "mftransform.idl"; 21 22typedef unsigned __int64 TOPOID; 23typedef LONGLONG MFTIME; 24 25typedef enum MF_TOPOLOGY_TYPE 26{ 27 MF_TOPOLOGY_OUTPUT_NODE, 28 MF_TOPOLOGY_SOURCESTREAM_NODE, 29 MF_TOPOLOGY_TRANSFORM_NODE, 30 MF_TOPOLOGY_TEE_NODE, 31 MF_TOPOLOGY_MAX = 0xffffffff 32} MF_TOPOLOGY_TYPE; 33 34typedef enum _MFCLOCK_STATE 35{ 36 MFCLOCK_STATE_INVALID, 37 MFCLOCK_STATE_RUNNING, 38 MFCLOCK_STATE_STOPPED, 39 MFCLOCK_STATE_PAUSED 40} MFCLOCK_STATE; 41 42typedef enum MF_OBJECT_TYPE 43{ 44 MF_OBJECT_MEDIASOURCE, 45 MF_OBJECT_BYTESTREAM, 46 MF_OBJECT_INVALID 47} MF_OBJECT_TYPE; 48 49typedef struct _MFCLOCK_PROPERTIES 50{ 51 unsigned __int64 qwCorrelationRate; 52 GUID guidClockId; 53 DWORD dwClockFlags; 54 unsigned __int64 qwClockFrequency; 55 DWORD dwClockTolerance; 56 DWORD dwClockJitter; 57} MFCLOCK_PROPERTIES; 58 59[ 60 object, 61 uuid(2eb1e945-18b8-4139-9b1a-d5d584818530), 62] 63interface IMFClock : IUnknown 64{ 65 HRESULT GetClockCharacteristics([out] DWORD *characteristics); 66 HRESULT GetCorrelatedTime([in] DWORD reserved, [out] LONGLONG *clock_time, [out] MFTIME *system_time); 67 HRESULT GetContinuityKey([out] DWORD *key); 68 HRESULT GetState([in] DWORD reserved, [out] MFCLOCK_STATE *state); 69 HRESULT GetProperties([out] MFCLOCK_PROPERTIES *props); 70} 71 72[ 73 object, 74 uuid(83cf873a-f6da-4bc8-823f-bacfd55dc430), 75] 76interface IMFTopologyNode : IMFAttributes 77{ 78 HRESULT SetObject([in] IUnknown *object); 79 HRESULT GetObject([out] IUnknown **object); 80 HRESULT GetNodeType([out] MF_TOPOLOGY_TYPE *type); 81 HRESULT GetTopoNodeID([out] TOPOID *id); 82 HRESULT SetTopoNodeID([in] TOPOID id); 83 HRESULT GetInputCount([out] DWORD *count); 84 HRESULT GetOutputCount([out] DWORD *count); 85 [local] HRESULT ConnectOutput([in] DWORD output_index, [in] IMFTopologyNode *node, [in] DWORD input_index); 86 [local] HRESULT DisconnectOutput([in] DWORD index); 87 HRESULT GetInput([in] DWORD input_index, [out] IMFTopologyNode **node, [out] DWORD *output_index); 88 HRESULT GetOutput([in] DWORD output_index, [out] IMFTopologyNode **node, [out] DWORD *input_index); 89 [local] HRESULT SetOutputPrefType([in] DWORD index, [in] IMFMediaType *type); 90 [local] HRESULT GetOutputPrefType([in] DWORD output_index, [out] IMFMediaType **type); 91 [call_as(GetOutputPrefType)] HRESULT RemoteGetOutputPrefType([in] DWORD index, [out] DWORD *length, 92 [out, size_is(, *length)] BYTE **data); 93 [local] HRESULT SetInputPrefType([in] DWORD index, [in] IMFMediaType *type); 94 [local] HRESULT GetInputPrefType([in] DWORD index, [out] IMFMediaType **type); 95 [call_as(GetInputPrefType)] HRESULT RemoteGetInputPrefType([in] DWORD index, [out] DWORD *length, 96 [out, size_is(, *length)] BYTE **data); 97 HRESULT CloneFrom([in] IMFTopologyNode *node); 98} 99 100[ 101 object, 102 uuid(83cf873a-f6da-4bc8-823f-bacfd55dc433), 103] 104interface IMFTopology : IMFAttributes 105{ 106 HRESULT GetTopologyID([out] TOPOID *id); 107 [local] HRESULT AddNode([in] IMFTopologyNode *node); 108 [local] HRESULT RemoveNode([in] IMFTopologyNode *node); 109 HRESULT GetNodeCount([out] WORD *nodes); 110 HRESULT GetNode([in] WORD index, [out] IMFTopologyNode **node); 111 [local] HRESULT Clear(); 112 HRESULT CloneFrom([in] IMFTopology *topology); 113 HRESULT GetNodeByID([in] TOPOID id, [out] IMFTopologyNode **node); 114 HRESULT GetSourceNodeCollection([out] IMFCollection **collection); 115 HRESULT GetOutputNodeCollection([out] IMFCollection **collection); 116} 117 118[ 119 object, 120 uuid(90377834-21d0-4dee-8214-ba2e3e6c1127), 121] 122interface IMFMediaSession : IMFMediaEventGenerator 123{ 124 HRESULT SetTopology([in] DWORD flags, [in] IMFTopology *topology); 125 HRESULT ClearTopologies(); 126 HRESULT Start([in, unique] const GUID *format, [in, unique] const PROPVARIANT *start); 127 HRESULT Pause(); 128 HRESULT Stop(); 129 HRESULT Close(); 130 HRESULT Shutdown(); 131 HRESULT GetClock([out] IMFClock **clock); 132 HRESULT GetSessionCapabilities([out] DWORD *caps); 133 HRESULT GetFullTopology([in] DWORD flags, [in] TOPOID id, [out] IMFTopology **topology); 134} 135 136[ 137 object, 138 uuid(fbe5a32d-a497-4b61-bb85-97b1a848a6e3) 139] 140interface IMFSourceResolver : IUnknown 141{ 142 [local] HRESULT CreateObjectFromURL([in] const WCHAR *url, [in] DWORD flags, [in] IPropertyStore *props, 143 [out] MF_OBJECT_TYPE *obj_type, [out] IUnknown **object); 144 [local] HRESULT CreateObjectFromByteStream([in] IMFByteStream *stream, [in] const WCHAR *url, [in] DWORD flags, 145 [in] IPropertyStore *props, [out] MF_OBJECT_TYPE *obj_type, [out] IUnknown **object); 146 [local] HRESULT BeginCreateObjectFromURL([in] const WCHAR *url, [in] DWORD flags, [in] IPropertyStore *props, 147 [out] IUnknown **cancel_cookie, [in] IMFAsyncCallback *callback, [in] IUnknown *unk_state); 148 [call_as(BeginCreateObjectFromURL)] HRESULT RemoteBeginCreateObjectFromURL([in, string] const WCHAR *url, 149 [in] DWORD flags, [in] IPropertyStore *props, [in] IMFRemoteAsyncCallback *callback); 150 [local] HRESULT EndCreateObjectFromURL([in] IMFAsyncResult *result, [out] MF_OBJECT_TYPE *obj_type, 151 [out] IUnknown **object); 152 [call_as(EndCreateObjectFromURL)] HRESULT RemoteEndCreateObjectFromURL([in] IUnknown *result, 153 [out] MF_OBJECT_TYPE *obj_type, [out] IUnknown **object); 154 [local] HRESULT BeginCreateObjectFromByteStream([in] IMFByteStream *stream, [in] const WCHAR *url, 155 [in] DWORD flags, [in] IPropertyStore *props, [out] IUnknown **cancel_cookie, 156 [in] IMFAsyncCallback *callback, [in] IUnknown *unk_state); 157 [call_as(BeginCreateObjectFromByteStream)] HRESULT RemoteBeginCreateObjectFromByteStream([in] IMFByteStream *stream, 158 [in, unique] const WCHAR *url, [in] DWORD flags, [in, unique] IPropertyStore *props, 159 [in] IMFRemoteAsyncCallback *callback); 160 [local] HRESULT EndCreateObjectFromByteStream([in] IMFAsyncResult *result, [out] MF_OBJECT_TYPE *obj_type, 161 [out] IUnknown **object); 162 [call_as(EndCreateObjectFromByteStream)] HRESULT RemoteEndCreateObjectFromByteStream([in] IUnknown *result, 163 [out] MF_OBJECT_TYPE *obj_type, [out] IUnknown **object); 164 [local] HRESULT CanceObjectCreation([in] IUnknown *cancel_cookie); 165} 166 167cpp_quote("HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **session);") 168cpp_quote("HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver);") 169cpp_quote("HRESULT WINAPI MFCreateTopology(IMFTopology **topology);") 170