Rendering DirectShow to a DirectDraw Surface
Hi
I know it''s possible to render a movie to a
DirectDraw surface, but I do I do it???
thanks to all of you that answer my question.
Kamikaze
I want to do the same thing.
I suppose we''ll have to study the
example in the sdk. It runs an .avi
movie on a 3D surface :-)
C:\sdk8\VC_SRC_SDK\DXSDK\samples\Multimedia\
DirectShow\Players\Texture3D
I suppose we''ll have to study the
example in the sdk. It runs an .avi
movie on a 3D surface :-)
C:\sdk8\VC_SRC_SDK\DXSDK\samples\Multimedia\
DirectShow\Players\Texture3D
Yeah... There should be a section
for directshow only... If you can make it work
tell me by posting an answer, if I make it
I''ll let you know the same way. Good Luck!
for directshow only... If you can make it work
tell me by posting an answer, if I make it
I''ll let you know the same way. Good Luck!
Well, as a start, playing a movie clip with
directshow is this easy :-)
#include <dshow.h>
IGraphBuilder* g;
IMediaControl* m;
IMediaEvent* e;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph,NULL,CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,(void **)&g);
g->QueryInterface(IID_IMediaControl, (void **)&m);
g->QueryInterface(IID_IMediaEvent,(void **)&e);
g->RenderFile(L"c:\someclip.avi", NULL);
m->Run();
.. and link with strmiids.lib
directshow is this easy :-)
#include <dshow.h>
IGraphBuilder* g;
IMediaControl* m;
IMediaEvent* e;
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph,NULL,CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,(void **)&g);
g->QueryInterface(IID_IMediaControl, (void **)&m);
g->QueryInterface(IID_IMediaEvent,(void **)&e);
g->RenderFile(L"c:\someclip.avi", NULL);
m->Run();
.. and link with strmiids.lib
You guys want to render to DirectDraw surface right? Not to a texture? Check out IDDrawExclModeVideo maybe it can help.
What I did was to...
Step 1:
add SampleGrabber filter to the graph
Step 2:
set SampleGrabber media type
Step 3:
set SampleGrabber''s callback and code the pixel copy procedure that will copy data from the decomressed video buffer to the surface or texture or wherever you like.
Step 4:
call RenderFile() on filter manager so it connects the filter for you
Step 5:
hide video window (IVideoWindow I think)
Step 6:
run the graph
You might also want to connect NullRenderer to the SampleGrabber''s output pin. Oh, and I think that you will have to set the D3D Device usage flag to multithread.
-Milos
What I did was to...
Step 1:
add SampleGrabber filter to the graph
Step 2:
set SampleGrabber media type
Step 3:
set SampleGrabber''s callback and code the pixel copy procedure that will copy data from the decomressed video buffer to the surface or texture or wherever you like.
Step 4:
call RenderFile() on filter manager so it connects the filter for you
Step 5:
hide video window (IVideoWindow I think)
Step 6:
run the graph
You might also want to connect NullRenderer to the SampleGrabber''s output pin. Oh, and I think that you will have to set the D3D Device usage flag to multithread.
-Milos
I almost have it completed, I''m using DirectDraw
exclusive mode, but now when I''m trying to get the
IDDrawExclModeVideo interface it shows a windows error
(does not return an error) and my app is closed
by windows...
I''ve added the "Overlay Mixer" filter to the graph and
connected it as it should be, no errors until there, but
when I try to get the IDDrawExclModeVideo using
OverlayMixer->QueryInterface() the error just appears, does
anybody has an idea of what can it be ??
All the help is welcome!
Kamikaze
exclusive mode, but now when I''m trying to get the
IDDrawExclModeVideo interface it shows a windows error
(does not return an error) and my app is closed
by windows...
I''ve added the "Overlay Mixer" filter to the graph and
connected it as it should be, no errors until there, but
when I try to get the IDDrawExclModeVideo using
OverlayMixer->QueryInterface() the error just appears, does
anybody has an idea of what can it be ??
All the help is welcome!
Kamikaze
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement