Hello
I used GraphEditPlus to create some C# code to render video and TV signals.
I don't get it working the way I would like.
With "Video Renderer" {6BC1CFFA-8FC1-4261-AC22-CFB4CC38DB50}, it runs only on the main screen, but when I move the window to the secondary screen, the image is blank.
With "Video Renderer" {70E102B0-5556-11CE-97C0-00AA0055595A}, it runs on both screens and I can move the window flawless between the screens. But when I try to run this graph in my C# app the video is flipped upside down (mirrored).

I also tried "VideoMixingRenderer9" in both modes (windowed/windowless). As soon as I move the window between the screens, the image freezes.
How is the GraphEditPlus "Video Renderer" window created? This seems not to flip the image (unless you play around with properties too much)
Here the code I used to build the graph and connect the window. It flips the image and I don't have a clue why.
public void BuildGraph( string videoFileName, Control previewWindow )
{
FilterGraph graph = new FilterGraph( );
graphBuilder = ( IGraphBuilder ) graph;
// Get the Capture Graph Builder
captureGraphBuilder = ( ICaptureGraphBuilder2 ) new CaptureGraphBuilder2( );
// Link the CaptureGraphBuilder to the filter graph
int hr = captureGraphBuilder.SetFiltergraph( graphBuilder );
if ( hr < 0 ) Marshal.ThrowExceptionForHR( hr );
IBaseFilter vr = ( IBaseFilter ) Activator.CreateInstance( typeof( VideoRenderer ) );
hr = graphBuilder.AddFilter( vr, "Video Renderer" );
if ( hr < 0 ) Marshal.ThrowExceptionForHR( hr );
this.graphBuilder.RenderFile( videoFileName, "" );
rotCookie = new DsROTEntry( graphBuilder );
// Get the IVideoWindow interface
this.videoWindow = ( IVideoWindow ) this.graphBuilder;
this.previewWindow = previewWindow;
// Set the video window to be a child of the main window
hr = videoWindow.put_Owner( previewWindow.Handle );
if ( hr < 0 ) Marshal.ThrowExceptionForHR( hr );
// Set video window style
hr = videoWindow.put_WindowStyle( WindowStyle.Child | WindowStyle.ClipChildren | WindowStyle.ClipSiblings );
if ( hr < 0 ) Marshal.ThrowExceptionForHR( hr );
// Position video window in client rect of owner window
previewWindow.Resize += new EventHandler( onPreviewWindowResize );
onPreviewWindowResize( previewWindow, null );
// Make the video window visible, now that it is properly positioned
hr = videoWindow.put_Visible( OABool.True );
if ( hr < 0 ) Marshal.ThrowExceptionForHR( hr );
}
protected void onPreviewWindowResize( object sender, EventArgs e )
{
if ( videoWindow != null )
{
// Position video window in client rect of owner window
Rectangle rc = previewWindow.ClientRectangle;
videoWindow.SetWindowPosition( 0, 0, rc.Right, rc.Bottom );
}
}
Thanks for any help on this. I googled hours and couln't find an answer.