views:

243

answers:

1

Hi

I am pretty new to DirectShow and really just feeling my way round at the moment. I am wanting to host the directshow renderer window of a directshow graph within a WPF app and am currently using the HwndHost class to try to achieve this. What I need though for HwndHost is a handle to the window which is rendering the video. I have found an example which shows getting the handle by enumerating the pins of an IVideoWindow interface and querying for IOverlay so the GetWindowHandle method can be used to get the handle.

Problem is IOverlay doesnt seem to be available in DirectShow.Net. Reading the DirectShow.Net About page, IOverlay is listed in the table with the heading "These interfaces are in the source code, but are deprecated, undocumented, intended for Ole Automation or otherwise untestable which means they are not, and will not be tested".

So what is it that I have to do to get access to this definition? Is it excluded from the build that is distributed as a library and so should I build the library from source myself?

OR Is there a better way of doing what I am trying to do? Anyhelp would be appreciated as like I said I am new to all this stuff.

Thanks in advance.

EDIT: Not many DirectShow devs out there? Or is this a stupid question, definitely open to any advice peeps may have...

+1  A: 

The normal way to do this is to reparent the video window using IVideoWindow::put_Owner to make it a child of your own window. You will also want to set the AutoShow (false), Visible, Width and Height properties, and change the WindowStyle property to make it a child window.

The IOverlay interface was implemented in the first version of DirectShow (1996) to support some hardware decoders that are long since defunct. I don't think the current video renderers will support it.

The window handle was made difficult to obtain because poor application programming caused frequent deadlocks in Video for Windows and the developers felt that a clear separation was needed between the DirectShow threads and the windows they owned, and any application threads.

G

Geraint Davies
Thank you very much, just the man I needed :) this happens to be part of a project which is using your GMFBridge toolkit (its been very helpful)
Simon Fox