src/Foundation/Media/Gimela.Media.Video.DirectShow/VideoCaptureDeviceVideoSource.cs
/// <summary>
/// Display property window for the video capture device providing its configuration
/// capabilities.
/// </summary>
/// 
/// <param name="parentWindow">Handle of parent window.</param>
/// 
/// <remarks><para><note>If you pass parent window's handle to this method, then the
/// displayed property page will become modal window and none of the controls from the
/// parent window will be accessible. In order to make it modeless it is required
/// to pass <see cref="IntPtr.Zero"/> as parent window's handle.
/// </note></para>
/// </remarks>
/// 
/// <exception cref="NotSupportedException">The video source does not support configuration property page.</exception>
/// 
Display property window for the video capture device providing its configuration
capabilities.
Display property window for the video capture device providing its configuration capabilities .
public void DisplayPropertyPage(IntPtr parentWindow)
    {
      if ((deviceMoniker == null) || (deviceMoniker == string.Empty))
        throw new ArgumentException("Video source is not specified");
      lock (sync)
      {
        if (IsRunning)
        {
          parentWindowForPropertyPage = parentWindow;
          needToDisplayPropertyPage = true;
          return;
        }
        object tempSourceObject = null;
        try
        {
          tempSourceObject = FilterInfo.CreateFilter(deviceMoniker);
        }
        catch
        {
          throw new ApplicationException("Failed creating device object for moniker.");
        }
        if (!(tempSourceObject is ISpecifyPropertyPages))
        {
          throw new NotSupportedException("The video source does not support configuration property page.");
        }
        ISpecifyPropertyPages pPropPages = (ISpecifyPropertyPages)tempSourceObject;
        CAUUID caGUID;
        pPropPages.GetPages(out caGUID);
        FilterInfo filterInfo = new FilterInfo(deviceMoniker);
        Win32.OleCreatePropertyFrame(parentWindow, 0, 0, filterInfo.Name, 1, ref tempSourceObject, caGUID.cElems, caGUID.pElems, 0, 0, IntPtr.Zero);
        Marshal.FreeCoTaskMem(caGUID.pElems);
        Marshal.ReleaseComObject(tempSourceObject);
      }
    }
public void DisplayPropertyPage ( IntPtr parentWindow ) { if ( ( deviceMoniker == null ) || ( deviceMoniker == string . Empty ) ) throw new ArgumentException ( " " ) ; lock ( sync ) { if ( IsRunning ) { parentWindowForPropertyPage = parentWindow ; needToDisplayPropertyPage = true ; return ; } object tempSourceObject = null ; try { tempSourceObject = FilterInfo . CreateFilter ( deviceMoniker ) ; } catch { throw new ApplicationException ( " " ) ; } if ( ! ( tempSourceObject is ISpecifyPropertyPages ) ) { throw new NotSupportedException ( " " ) ; } ISpecifyPropertyPages pPropPages = ( ISpecifyPropertyPages ) tempSourceObject ; CAUUID caGUID ; pPropPages . GetPages ( out caGUID ) ; FilterInfo filterInfo = new FilterInfo ( deviceMoniker ) ; Win32 . OleCreatePropertyFrame ( parentWindow , 0 , 0 , filterInfo . Name , 1 , ref tempSourceObject , caGUID . cElems , caGUID . pElems , 0 , 0 , IntPtr . Zero ) ; Marshal . FreeCoTaskMem ( caGUID . pElems ) ; Marshal . ReleaseComObject ( tempSourceObject ) ; } }
Display property window for the video capture device providing its configuration
capabilities.
Display property window for the video capture device providing its configuration capabilities .
// check source // pass the request to backgroud thread if video source is running // create source device's object // retrieve ISpecifyPropertyPages interface of the device // get property pages from the property bag // get filter info // create and display the OlePropertyFrame form // release COM objects
The video source does not support configuration property page.
The video source does not support configuration property page .
parentWindow
IntPtr
Handle of parent window.
Handle of parent window .
remarks
If you pass parent window's handle to this method, then the
displayed property page will become modal window and none of the controls from the
parent window will be accessible. In order to make it modeless it is required
to pass  as parent window's handle.
If you pass parent window ' s handle to this method then the displayed property page will become modal window and none of the controls from the parent window will be accessible . In order to make it modeless it is required to pass as parent window ' s handle .