-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDynGraph.cs
225 lines (190 loc) · 5.69 KB
/
DynGraph.cs
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
#region license
/*
DirectShowLib - Provide access to DirectShow interfaces via .NET
Copyright (C) 2007
http://sourceforge.net/projects/directshownet/
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
*/
#endregion
using System;
using System.Runtime.InteropServices;
namespace DirectShowLib
{
#region Declarations
/// <summary>
/// From _AM_PIN_FLOW_CONTROL_BLOCK_FLAGS
/// </summary>
[Flags]
public enum AMPinFlowControl
{
None = 0x00000000,
Block = 0x00000001
}
/// <summary>
/// From AM_GRAPH_CONFIG_RECONNECT_FLAGS
/// </summary>
[Flags]
public enum AMGraphConfigReconnect
{
None = 0x00000000,
DirectConnect = 0x00000001,
CacheRemovedFilters = 0x00000002,
UseOnlyCachedFilters = 0x00000004
}
/// <summary>
/// From _AM_FILTER_FLAGS
/// </summary>
[Flags]
public enum AMFilterFlags
{
None = 0x00000000,
Removable = 0x00000001
}
/// <summary>
/// From _REM_FILTER_FLAGS
/// </summary>
[Flags]
public enum RemFilterFlags
{
None = 0x00000000,
LeaveConnected = 0x00000001
}
#endregion
#region Interfaces
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("c56e9858-dbf3-4f6b-8119-384af2060deb"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPinFlowControl
{
[PreserveSig]
int Block(
[In] AMPinFlowControl dwBlockFlags,
[In] IntPtr hEvent // HEVENT
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("DCFBDCF6-0DC2-45f5-9AB2-7C330EA09C29"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IFilterChain
{
[PreserveSig]
int StartChain(
[In] IBaseFilter pStartFilter,
[In] IBaseFilter pEndFilter
);
[PreserveSig]
int PauseChain(
[In] IBaseFilter pStartFilter,
[In] IBaseFilter pEndFilter
);
[PreserveSig]
int StopChain(
[In] IBaseFilter pStartFilter,
[In] IBaseFilter pEndFilter
);
[PreserveSig]
int RemoveChain(
[In] IBaseFilter pStartFilter,
[In] IBaseFilter pEndFilter
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("ade0fd60-d19d-11d2-abf6-00a0c905f375"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IGraphConfigCallback
{
[PreserveSig]
int Reconfigure(
IntPtr pvContext, // PVOID
int dwFlags
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("03A1EB8E-32BF-4245-8502-114D08A9CB88"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IGraphConfig
{
[PreserveSig]
int Reconnect(
[In] IPin pOutputPin,
[In] IPin pInputPin,
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmtFirstConnection,
[In] IBaseFilter pUsingFilter, // can be NULL
[In] IntPtr hAbortEvent, // HANDLE
[In] AMGraphConfigReconnect dwFlags
);
[PreserveSig]
int Reconfigure(
[In] IGraphConfigCallback pCallback,
[In] IntPtr pvContext, // PVOID
[In] int dwFlags,
[In] IntPtr hAbortEvent // HANDLE
);
[PreserveSig]
int AddFilterToCache(
[In] IBaseFilter pFilter
);
[PreserveSig]
int EnumCacheFilter(
[Out] out IEnumFilters pEnum
);
[PreserveSig]
int RemoveFilterFromCache(
[In] IBaseFilter pFilter
);
[PreserveSig]
int GetStartTime(
[Out] out long prtStart
);
[PreserveSig]
int PushThroughData(
[In] IPin pOutputPin,
[In] IPinConnection pConnection,
[In] IntPtr hEventAbort // HANDLE
);
[PreserveSig]
int SetFilterFlags(
[In] IBaseFilter pFilter,
[In] AMFilterFlags dwFlags
);
[PreserveSig]
int GetFilterFlags(
[In] IBaseFilter pFilter,
[Out] out AMFilterFlags pdwFlags
);
[PreserveSig]
int RemoveFilterEx(
[In] IBaseFilter pFilter,
RemFilterFlags Flags
);
}
[ComImport, System.Security.SuppressUnmanagedCodeSecurity,
Guid("4a9a62d3-27d4-403d-91e9-89f540e55534"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPinConnection
{
[PreserveSig]
int DynamicQueryAccept(
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType pmt
);
[PreserveSig]
int NotifyEndOfStream(
[In] IntPtr hNotifyEvent // HEVENT
);
[PreserveSig]
int IsEndPin();
[PreserveSig]
int DynamicDisconnect();
}
#endregion
}