Solved

ActiveMovie: setting my DirectDraw?

Posted on 1997-08-13
2
958 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

743 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

10 Experts available now in Live!

Get 1:1 Help Now