AForge.Video.DirectShow.VideoCaptureDevice.DisplayCrossbarPropertyPage C# (CSharp) Method

DisplayCrossbarPropertyPage() public method

Display property page of video crossbar (Analog Video Crossbar filter).

The Analog Video Crossbar filter is modeled after a general switching matrix, with n inputs and m outputs. For example, a video card might have two external connectors: a coaxial connector for TV, and an S-video input. These would be represented as input pins on the filter. The displayed property page allows to configure the crossbar by selecting input of a video card to use.

This method can be invoked only when video source is running (IsRunning is ). Otherwise it generates exception.

Use CheckIfCrossbarAvailable method to check if running video source provides crossbar configuration.

The video source must be running in order to display crossbar property page. Crossbar configuration is not supported by currently running video source.
public DisplayCrossbarPropertyPage ( IntPtr parentWindow ) : void
parentWindow System.IntPtr Handle of parent window.
return void
        public void DisplayCrossbarPropertyPage( IntPtr parentWindow )
        {
            lock ( sync )
            {
                // wait max 5 seconds till the flag gets initialized
                for ( int i = 0; ( i < 500 ) && ( !isCrossbarAvailable.HasValue ) && ( IsRunning ); i++ )
                {
                    Thread.Sleep( 10 );
                }

                if ( ( !IsRunning ) || ( !isCrossbarAvailable.HasValue ) )
                {
                    throw new ApplicationException( "The video source must be running in order to display crossbar property page." );
                }

                if ( !isCrossbarAvailable.Value )
                {
                    throw new NotSupportedException( "Crossbar configuration is not supported by currently running video source." );
                }

                // pass the request to background thread if video source is running
                parentWindowForPropertyPage = parentWindow;
                needToDisplayCrossBarPropertyPage = true;
            }
        }