Solved

ActiveMovie: setting my DirectDraw?

Posted on 1997-08-13
2
963 Views
Last Modified: 2013-12-03
Hi!

I have DirectDraw application working in full-screen 640x480x16, and
all that I need - to force ActiveMovie play any movies on my primary
surface and not to open any other windows. But this is not so trivial
task as I thought before. Let me illustrate my problems by describing
what I do:

1) Init DirectDraw, creating flipping primary surface with one
back-buffer. All initialized OK
2) Create IGraphBuilder and call RenderFile with 320x240x24 AVI. OK,
here the graph have been successfully built
3) Acquire IDirectDrawVideo interface from VideoRenderer via
CoCreateInstance and call the following methods: SetDirectDraw(pMyDD),
SetSwitches(AMDDS_PS), UseWhenFullScreen(-1). All OK
4) Documentation said that GraphBuilder would automatically switch to
fullscreen mode and use DirectDraw when requested. Well, do it. I
query IVideoWindow interface from the graph and call its
put_FullScreenMode(-1)
5) Do some checking. Aquire IDirectDrawVideo again and call some
methods. And...here all is bad: GetDirectDraw reports NULL,
GetSurfaceType - 0 and GetSurfaceDesc - 80004005 (E_FAIL). Visually,
ActiveMovie have created another full-screen window (of screen
resolution) and play video in it.

What I am doing wrong? I did not find any intelligible suggestions in
AM help. At the point, I've tried to move my step 3 before
initializing of AM of even before graph building - nothing helps. May
be anybody will do?

Thanks in advance.

Best regards, Al
0
Comment
Question by:borov
2 Comments
 
LVL 3

Expert Comment

by:vinniew
ID: 1403909
So, you are trying to basically put the frame information from ActiveMovie into the DirectDraw buffer?

post/send me your code and I'll do what I can.  I've got a couple ideas:

1. get one frame at a time from ActiveMovie and send it into DD.
2. get frames from AM and use them as the surface.  Tell DD to re-render the surface.

vinniew@usa.net
0
 

Accepted Solution

by:
fRouxSerret earned 100 total points
ID: 1403910
It's very funny because I just had the axactly same problem a couple of week ago (except that I'm in true color). Here's how I solved the problem :
I "simply" :-( added a custom interface to the "sampvid" renderer filter (it's a sample from the amovie sdk) with one unique function that allows me to give him a pointer to the video memory surface I'm using. (See Gargle sample to find out how to do this)
Then, I removed all code from the sampvid sample to manage the rendering windos.
Then, I rewrote the CVideoRenderer::DoRenderSample(IMediaSample *mediaSample) function. In this function you can get the picture DIB:  mediaSample->GetDIBData(); It is easy to blit it to the direct draw surface the application gave you before playing the stream with your new interface function.
Finnally, the application does this:
It opens direct draw, creates a surface, create the graph tree, replaces the Video renderer with the "sampvid" renderer in the graph, retrieve the interface pointer to our custom interface (QueryInterface), use this interface to give a pointer to the surface to the filter, and then plays the graph.
It's a 3 days work maximum if you are familliar with C++ and with command-line compiling (NMAKE utility for the filter). You don't have to change something in the registry if you don't change the GUID of the sampvid filter.
BUT IT WORKS PERFECTLY, I have a 640 x 480 x 24 bit fluid full screen animation, with no frame lost !!!!
MOREOVER, as the filter makes NO MORE WINDOW MANIPULATION, your directdraw fullscreen and exclusive mode is not lost, and you can continue drawing with directdraw after the animation as finished.
THE BEST POINT, is that you CONTROL EVERYTHING IN THE VIDEO RENDERING (POSITION, SIZE), you can even scroll it, make effects, add stuff over it... You simply have to change the DoRenderSample function !!!
There is maybe a simplest solution, but this one works, I tested it.
You can join me for more info at francis@digitalstudio.com
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now