Click to See Complete Forum and Search --> : Dshow


fwehlin
May 4th, 1999, 07:12 PM
I have created a dialogbased application, where I in the maindialog have
create some buttons, such as Play, stop, pause, options and openfile. When
clicking the optionsfile another modal dialog is shown with some radio
buttons where I can set the options of my program. The program is going to
be a demonstrationprogram on how u can play video (mpeg) files on computer
using different techniques:

1 By using the MediaPlayer
2 By using DirectShow
3 By using DirectDraw
4 MCI controlled.

I´m done with MediaPlayer, it wasn´t hard. But now I want to be able to play
it using Direct Show. What do I need to do? What kind of interfaces do I
need to include? I´ve looked at the MFCPlay example in DirectX Media SDK,
but that is doc/view based and I don´t understand How I can implement that
in my Dialogbased application.

Any help in this matter would be greatly appreciated. Maybe som short
examples in code.

/Frederik

marc.schroeer
May 9th, 1999, 03:29 PM
All you need is to CoCreate an instance of IGraphBuilder and use the RenderFile method to create a filtergraph to play your file. Then you obtain the IMediaControl interface by calling QueryInterface on the IGraphBuilder interface and use the Run method to start playback.

Bye,
Marc

fwehlin
May 12th, 1999, 04:38 AM
Thanx for your reply,
I have tried that but still wont get it compile right. I include streams.h and mmsystem.h

I have follewed the steps in the DirectX Media SDK. (Play Movie from
C++ -example)
I have tried to convert it to to my MFC dialogbased app, where I´ve made a
dialog that will show the movie. I declare and initialize the interfaces in
the OnInitDialog-function. Then I´ve added the variables needed like HRESULT
hr;

What I get is lots of compilationerrors like: left of '->QueryInterface'
must point to class/struct/union


Frederik.

P.s I could send you my files and maybe you can have a look and se if you can see any obvious misstakes in my code?