// 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; /// /// This interface provides methods that enable an application to build a filter graph. /// /// [ComImport, Guid( "56A868A9-0AD4-11CE-B03A-0020AF0BA770" ), InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] internal interface IGraphBuilder { // --- IFilterGraph Methods /// /// Adds a filter to the graph and gives it a name. /// /// /// Filter to add to the graph. /// Name of the filter. /// /// Return's HRESULT error code. /// [PreserveSig] int AddFilter( [In] IBaseFilter filter, [In, MarshalAs( UnmanagedType.LPWStr )] string name ); /// /// Removes a filter from the graph. /// /// /// Filter to be removed from the graph. /// /// Return's HRESULT error code. /// [PreserveSig] int RemoveFilter( [In] IBaseFilter filter ); /// /// Provides an enumerator for all filters in the graph. /// /// /// Filter enumerator. /// /// Return's HRESULT error code. /// [PreserveSig] int EnumFilters( [Out] out IEnumFilters enumerator ); /// /// Finds a filter that was added with a specified name. /// /// /// Name of filter to search for. /// Interface of found filter. /// /// Return's HRESULT error code. /// [PreserveSig] int FindFilterByName( [In, MarshalAs( UnmanagedType.LPWStr )] string name, [Out] out IBaseFilter filter ); /// /// Connects two pins directly (without intervening filters). /// /// /// Output pin. /// Input pin. /// Media type to use for the connection. /// /// Return's HRESULT error code. /// [PreserveSig] int ConnectDirect( [In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); /// /// Breaks the existing pin connection and reconnects it to the same pin. /// /// /// Pin to disconnect and reconnect. /// /// Return's HRESULT error code. /// [PreserveSig] int Reconnect( [In] IPin pin ); /// /// Disconnects a specified pin. /// /// /// Pin to disconnect. /// /// Return's HRESULT error code. /// [PreserveSig] int Disconnect( [In] IPin pin ); /// /// Sets the reference clock to the default clock. /// /// /// Return's HRESULT error code. /// [PreserveSig] int SetDefaultSyncSource( ); // --- IGraphBuilder methods /// /// Connects two pins. If they will not connect directly, this method connects them with intervening transforms. /// /// /// Output pin. /// Input pin. /// /// Return's HRESULT error code. /// [PreserveSig] int Connect( [In] IPin pinOut, [In] IPin pinIn ); /// /// Adds a chain of filters to a specified output pin to render it. /// /// /// Output pin. /// /// Return's HRESULT error code. /// [PreserveSig] int Render( [In] IPin pinOut ); /// /// Builds a filter graph that renders the specified file. /// /// /// Specifies a string that contains file name or device moniker. /// Reserved. /// /// Return's HRESULT error code. /// [PreserveSig] int RenderFile( [In, MarshalAs( UnmanagedType.LPWStr )] string file, [In, MarshalAs( UnmanagedType.LPWStr )] string playList); /// /// Adds a source filter to the filter graph for a specific file. /// /// /// Specifies the name of the file to load. /// Specifies a name for the source filter. /// Variable that receives the interface of the source filter. /// /// Return's HRESULT error code. /// [PreserveSig] int AddSourceFilter( [In, MarshalAs( UnmanagedType.LPWStr )] string fileName, [In, MarshalAs( UnmanagedType.LPWStr )] string filterName, [Out] out IBaseFilter filter ); /// /// Sets the file for logging actions taken when attempting to perform an operation. /// /// /// Handle to the log file. /// /// Return's HRESULT error code. /// [PreserveSig] int SetLogFile( IntPtr hFile ); /// /// Requests that the graph builder return as soon as possible from its current task. /// /// /// Return's HRESULT error code. /// [PreserveSig] int Abort( ); /// /// Queries whether the current operation should continue. /// /// /// Return's HRESULT error code. /// [PreserveSig] int ShouldOperationContinue( ); } }