Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ActiveMovie: setting my DirectDraw?

Posted on 1997-08-13
2
Medium Priority
?
988 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

688 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