// 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; /// /// The interface provides methods for controlling the flow of data through the filter graph. /// It includes methods for running, pausing, and stopping the graph. /// /// [ComImport, Guid( "56A868B1-0AD4-11CE-B03A-0020AF0BA770" ), InterfaceType( ComInterfaceType.InterfaceIsDual )] internal interface IMediaControl { /// /// Runs all the filters in the filter graph. /// /// /// Return's HRESULT error code. /// [PreserveSig] int Run( ); /// /// Pauses all filters in the filter graph. /// /// /// Return's HRESULT error code. /// [PreserveSig] int Pause( ); /// /// Stops all the filters in the filter graph. /// /// /// Return's HRESULT error code. /// [PreserveSig] int Stop( ); /// /// Retrieves the state of the filter graph. /// /// /// Duration of the time-out, in milliseconds, or INFINITE to specify an infinite time-out. /// ̀ariable that receives a member of the FILTER_STATE enumeration. /// /// Return's HRESULT error code. /// [PreserveSig] int GetState( int timeout, out int filterState ); /// /// Builds a filter graph that renders the specified file. /// /// /// Name of the file to render /// /// Return's HRESULT error code. /// [PreserveSig] int RenderFile( string fileName ); /// /// Adds a source filter to the filter graph, for a specified file. /// /// /// Name of the file containing the source video. /// Receives interface of filter information object. /// /// Return's HRESULT error code. /// [PreserveSig] int AddSourceFilter( [In] string fileName, [Out, MarshalAs( UnmanagedType.IDispatch )] out object filterInfo ); /// /// Retrieves a collection of the filters in the filter graph. /// /// /// Receives the IAMCollection interface. /// /// Return's HRESULT error code. /// [PreserveSig] int get_FilterCollection( [Out, MarshalAs( UnmanagedType.IDispatch )] out object collection ); /// /// Retrieves a collection of all the filters listed in the registry. /// /// /// Receives the IDispatch interface of IAMCollection object. /// /// Return's HRESULT error code. /// [PreserveSig] int get_RegFilterCollection( [Out, MarshalAs( UnmanagedType.IDispatch )] out object collection ); /// /// Pauses the filter graph, allowing filters to queue data, and then stops the filter graph. /// /// /// Return's HRESULT error code. /// [PreserveSig] int StopWhenReady( ); } }