Click here to Skip to main content
15,913,055 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralNo idea Pin
normanS2-Aug-04 19:26
normanS2-Aug-04 19:26 
GeneralRe: No idea Pin
milos++2-Aug-04 23:43
milos++2-Aug-04 23:43 
GeneralPrint Preview appears microscopic Pin
JHAKAS30-Jul-04 2:28
JHAKAS30-Jul-04 2:28 
GeneralDialog Box Controls Pin
ciitpk30-Jul-04 2:25
ciitpk30-Jul-04 2:25 
GeneralRe: Dialog Box Controls Pin
Michael P Butler30-Jul-04 2:29
Michael P Butler30-Jul-04 2:29 
GeneralRe: DirectShow and Graphics Overlay Pin
Antti Keskinen30-Jul-04 2:10
Antti Keskinen30-Jul-04 2:10 
GeneralRe: DirectShow and Graphics Overlay Pin
p_smith30-Jul-04 3:33
p_smith30-Jul-04 3:33 
GeneralRe: DirectShow and Graphics Overlay Pin
Antti Keskinen30-Jul-04 10:52
Antti Keskinen30-Jul-04 10:52 
The final option on this scenario is to use the Overlay Mixer Filter and a Video Renderer. These two filters must again be added and connected manually.

The steps required to use them:
1. Create a filter graph object, and query for IGraphBuilder and IFilterGraph interfaces on the object
2. Add a source file filter using IGraphBuilder::AddSourceFilter and save the IBaseFilter pointer
3. Create the Overlay Mixer Filter object (CLSID_OverlayMixer) and query for it's IBaseFilter interface. Add this filter into the filter chain using IFilterGraph::AddFilter
4. Create the Video Renderer object (CLSID_VideoRenderer), repeating the steps in #3.

Now it's time to connect the filter chain pins. Firstly, on the source filter's IBaseFilter interface, call IBaseFilter::EnumPins to get an enumeration of the available pins. See the DirectX C++ Documentation with topic "Enumerating Pins" to get sample code on how to enumerate available pins. Get the first pin and save the IPin interface pointer.

Next, get the Overlay Mixer Filter object's IBaseFilter interface, and query for the pin at ID 0. Get this pin's IPin interface. Now, you use the Filter Graph object's IFilterGraph::Connect to connect these two pins. If any extra pins are required to connect these two, they are added and connected automatically. If the connection fails, query for the next pin in the source filter, and again attempt to connect. When a suitable configuration is found, the method will succeed. Remember to release all unnecessary IPin pointers, and the enumeration pointers when done.

Repeat the steps to connect the Overlay Mixer Filter's output (MEDIATYPE_Overlay) into the Video Renderer Filter's input. The reason why you cannot directly connect from the source filter into the Video Renderer is the fact that the Overlay Mixer Filter would be skipped. Hence the dual-step process.

When done, you need to configure the Video Renderer Filter to display the video in a correct window. For this purpose, query for IVideoWindow interface on the Filter Graph object. Now the filter graph is ready to run, so query for IMediaControl interface and issue IMediaControl::Run. The video is displayed in the window you specified.

If you want to test whether using a certain filter chain will work, you can use the GraphEdit tool that ships with DirectX SDK. This tool allows you to build even complex filter graphs that support video, audio or both. It even allows you to create a video capture graph if necessary.

Unfortunately I don't have any prepared source code. If you need any, let me know and I'll see to it if I can fathom up some simple example for you.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: DirectShow and Graphics Overlay Pin
Antti Keskinen30-Jul-04 11:45
Antti Keskinen30-Jul-04 11:45 
GeneralDirectShow and Graphics Overlay Pin
p_smith30-Jul-04 1:27
p_smith30-Jul-04 1:27 
GeneralWindows Calculator on 2003 Pin
harropj29-Jul-04 23:57
harropj29-Jul-04 23:57 
GeneralRe: Windows Calculator on 2003 Pin
Antti Keskinen30-Jul-04 2:22
Antti Keskinen30-Jul-04 2:22 
Generalwhen the system shuts down...... Pin
Anonymous29-Jul-04 22:53
Anonymous29-Jul-04 22:53 
GeneralRe: when the system shuts down...... Pin
Michael P Butler29-Jul-04 23:11
Michael P Butler29-Jul-04 23:11 
GeneralRe: when the system shuts down...... Pin
Anonymous29-Jul-04 23:41
Anonymous29-Jul-04 23:41 
GeneralRe: when the system shuts down...... Pin
Michael P Butler30-Jul-04 0:01
Michael P Butler30-Jul-04 0:01 
GeneralRe: when the system shuts down...... Pin
Antony M Kancidrowski30-Jul-04 0:23
Antony M Kancidrowski30-Jul-04 0:23 
GeneralRe: when the system shuts down......[modified] Pin
Antony M Kancidrowski30-Jul-04 0:04
Antony M Kancidrowski30-Jul-04 0:04 
GeneralRe: when the system shuts down......[modified] Pin
Michael P Butler30-Jul-04 0:35
Michael P Butler30-Jul-04 0:35 
GeneralRe: when the system shuts down......[modified] Pin
Antony M Kancidrowski30-Jul-04 1:08
Antony M Kancidrowski30-Jul-04 1:08 
GeneralRe: when the system shuts down......[modified] Pin
Michael P Butler30-Jul-04 1:11
Michael P Butler30-Jul-04 1:11 
GeneralRe: when the system shuts down......[modified] Pin
Anonymous30-Jul-04 1:21
Anonymous30-Jul-04 1:21 
GeneralRe: when the system shuts down......[modified] Pin
Anonymous30-Jul-04 0:42
Anonymous30-Jul-04 0:42 
GeneralRe: when the system shuts down......[modified] Pin
Antony M Kancidrowski30-Jul-04 0:53
Antony M Kancidrowski30-Jul-04 0:53 
Generalpassing parameters to a running program Pin
ting66829-Jul-04 22:35
ting66829-Jul-04 22:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.