I wrote a DVD player application and built the graph manually (didn't use DVDGraphBuilder and its auto graph building feature, just a normal GraphBuilder with manually connected filters). I added the graph created at runtime to the ROT (Runtime Object Table) and then did "Connect to Remote Graph" in graph edit, thereby loading the graph from my code into graph edit. If I play this graph in graph edit, it works perfectly. But in my program the first screen shows up for about 1 second and then it goes white and then the dvd plays with no video, only audio (with the ActiveMovie window continually filled a white screen). I can't figure out why the graph will not keep on rendering the video when running the code, since the exact same graph (same because I loaded it from my code at runtime) works when run in GraphEdit. Here is a link to the source: http://cpp.sourceforge.net/ show=27735
Also, here is a link that has an image of the graph that is loaded into graph
edit at runtime and two images of the results I get when I run my code.
http://acidrainlite.googlepages.com/almostworking
Anyone have any idea what could be happening Any help would be greatly appreciated; I don't really know what to do to try to find out what is wrong.
Thanks.
--Jon G.--

Graph Works in GraphEdit but not in Code
jewelfire
holysmokes99
PeterFreeb
The only difference between graphedit and your app (assuming you're not setting incorrect formats from your code...) is that the graphedit app handles its own IVideoWindow interface, and it does it very well... Hope looking at the code will teach me more.
Bluehunter
A console app is definitely not the best solution to run a video display. You need a message pump to handle refresh messages (Graphedit has one). I suggest you move your code to a windowed app.
You might look at the following thread. It is suggested that letting DirectShow create the video renderer might solve your problem. (You can do this by not adding any video renderer to the graph, and by asking DS to render the last pin before the renderer).
http://groups-beta.google.com/group/microsoft.public.win32.programmer.directx.video/browse_frm/thread/49f6e79674f10082/c7cf17c111355631 lnk=gst&q=console+message+pump&rnum=4#c7cf17c111355631
Quote
"Do you create the [renderer] instance yourself If you render the video file
without directly creating the video renderer yourself, I believe the
renderer is created on a thread owned by DirectShow, which has a message
pump. If you create the renderer yourself, your thread owns it and you
need your own message pump. "
Unquote
Jassim Rahma
Thanks again for your help.
ykgreene
Well, there is only one graph file. The one that I get from attaching to my application and saving (once that is) is the good one. It runs well in graph edit, without needing to reload and resave. Here is the link to that file:
http://acidrainlite.googlepages.com/GraphLoadedFromProgram.GRF
Thanks again.
Aitken91
Though I can't drag the window around, nor can I maximize it; it is acting like it is completely tied up in playing the video and can't recieve any other events.
Thanks for all of your help.
GMS0012
Jon,
what may happen is that when you reload the graph, you get different connection parameters (mediatypes, or buffers) from those you get when building the graph in the application (it might be dependent on the order in which you establish the connections).
You should compare for the two graphs all connection mediatypes. Could you also post links to the two .grf files (the one saved from attaching to your application, and the good one, after reloading .grf from file and resaving) ( I mean, the .grf files themselves, not the image of the graphs).
Cheers,
Joe Black
pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
media_control->Run();
pEvent->WaitForCompletion(INFINITE, &evCode);
This prevents the application from exiting before the end of the clip...
Zolt
Well, I made it work...kind of. I actually got it to work by getting a runtime error. I wrote:
int i;
while(i!=100)
{
cin>>i;
}
Since I didn't initialize i and then compared it to 100 in the next line, I get a runtime error:
http://acidrainlite.googlepages.com/run_time_error
However, the video actually runs perfectly behind this error message as long as I do not click Abort.
I used the cin>>i to keep the application from completing (if I removed it the program would say "press any key to continue" and have no time to play the video), but I think the cin is the problem. I think that it is keeping the video from being able to refresh/it is holding up the ActiveMovie Window somehow (note the "not responding" in the title of the ActiveMovie Window three images down http://acidrainlite.googlepages.com/almostworking (representative of when the program is run without getting the runtime error)). Am I right in saying that the cin could be the problem Is there a different way I am supposed to keep the program from ending How are other people doing it
The Section of the code in question is:
media_control->Run();int i;
while(i!=100)
{
cin>>i;
}
where I run the graph and then call cin (need to enter 100 to exit) to keep the program from completeing.
Thanks.
Leonard Lee
Thanks.
Bill Poole
Perhaps you should handle DVD events
"The DVD Navigator sends notifications to an application-specified window when certain events take place, ..... The application specifies the window that will handle the event notifications by using the IMediaEventEx pointer to call SetNotifyWindow, ...."
http://msdn2.microsoft.com/en-gb/library/ms783760.aspx