forked from andrewkirillov/AForge.NET
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathIGraphBuilder.cs
198 lines (180 loc) · 6.65 KB
/
IGraphBuilder.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
// AForge Direct Show Library
// AForge.NET framework
//
// Copyright © Andrew Kirillov, 2007
// andrew.kirillov@gmail.com
//
namespace AForge.Video.DirectShow.Internals
{
using System;
using System.Runtime.InteropServices;
/// <summary>
/// This interface provides methods that enable an application to build a filter graph.
/// </summary>
///
[ComImport,
Guid( "56A868A9-0AD4-11CE-B03A-0020AF0BA770" ),
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
internal interface IGraphBuilder
{
// --- IFilterGraph Methods
/// <summary>
/// Adds a filter to the graph and gives it a name.
/// </summary>
///
/// <param name="filter">Filter to add to the graph.</param>
/// <param name="name">Name of the filter.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int AddFilter( [In] IBaseFilter filter, [In, MarshalAs( UnmanagedType.LPWStr )] string name );
/// <summary>
/// Removes a filter from the graph.
/// </summary>
///
/// <param name="filter">Filter to be removed from the graph.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int RemoveFilter( [In] IBaseFilter filter );
/// <summary>
/// Provides an enumerator for all filters in the graph.
/// </summary>
///
/// <param name="enumerator">Filter enumerator.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int EnumFilters( [Out] out IEnumFilters enumerator );
/// <summary>
/// Finds a filter that was added with a specified name.
/// </summary>
///
/// <param name="name">Name of filter to search for.</param>
/// <param name="filter">Interface of found filter.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int FindFilterByName( [In, MarshalAs( UnmanagedType.LPWStr )] string name, [Out] out IBaseFilter filter );
/// <summary>
/// Connects two pins directly (without intervening filters).
/// </summary>
///
/// <param name="pinOut">Output pin.</param>
/// <param name="pinIn">Input pin.</param>
/// <param name="mediaType">Media type to use for the connection.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int ConnectDirect( [In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType );
/// <summary>
/// Breaks the existing pin connection and reconnects it to the same pin.
/// </summary>
///
/// <param name="pin">Pin to disconnect and reconnect.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int Reconnect( [In] IPin pin );
/// <summary>
/// Disconnects a specified pin.
/// </summary>
///
/// <param name="pin">Pin to disconnect.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int Disconnect( [In] IPin pin );
/// <summary>
/// Sets the reference clock to the default clock.
/// </summary>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int SetDefaultSyncSource( );
// --- IGraphBuilder methods
/// <summary>
/// Connects two pins. If they will not connect directly, this method connects them with intervening transforms.
/// </summary>
///
/// <param name="pinOut">Output pin.</param>
/// <param name="pinIn">Input pin.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int Connect( [In] IPin pinOut, [In] IPin pinIn );
/// <summary>
/// Adds a chain of filters to a specified output pin to render it.
/// </summary>
///
/// <param name="pinOut">Output pin.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int Render( [In] IPin pinOut );
/// <summary>
/// Builds a filter graph that renders the specified file.
/// </summary>
///
/// <param name="file">Specifies a string that contains file name or device moniker.</param>
/// <param name="playList">Reserved.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int RenderFile(
[In, MarshalAs( UnmanagedType.LPWStr )] string file,
[In, MarshalAs( UnmanagedType.LPWStr )] string playList);
/// <summary>
/// Adds a source filter to the filter graph for a specific file.
/// </summary>
///
/// <param name="fileName">Specifies the name of the file to load.</param>
/// <param name="filterName">Specifies a name for the source filter.</param>
/// <param name="filter">Variable that receives the interface of the source filter.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int AddSourceFilter(
[In, MarshalAs( UnmanagedType.LPWStr )] string fileName,
[In, MarshalAs( UnmanagedType.LPWStr )] string filterName,
[Out] out IBaseFilter filter );
/// <summary>
/// Sets the file for logging actions taken when attempting to perform an operation.
/// </summary>
///
/// <param name="hFile">Handle to the log file.</param>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int SetLogFile( IntPtr hFile );
/// <summary>
/// Requests that the graph builder return as soon as possible from its current task.
/// </summary>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int Abort( );
/// <summary>
/// Queries whether the current operation should continue.
/// </summary>
///
/// <returns>Return's <b>HRESULT</b> error code.</returns>
///
[PreserveSig]
int ShouldOperationContinue( );
}
}