Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > DirectX > DirectShow objects don't render live filter graph


Reply
 
Thread Tools Display Modes
  #1  
Old 11-06-2003, 09:03 AM
Ray_A Ray_A is offline
Newcomer
 
Join Date: Nov 2003
Posts: 4
Default DirectShow objects don't render live filter graph


I've constructed a simple filter graph using the DirectX Graph editor. The editor renders live video stream from my Logitech camera okay.

But when I try to use it in my VB form, using the renderfile method as directed at the MSDN site (see below), I get an Automation Error.

My VB project is basically a copy of the MSDN DirectShow example for rendering AVI files with VB6. This works fine.

Do I need a more complex filter graph with compression filters, etc.? My graph only has two filters - capture and render - but it works fine in the DirectX editor.

Text from MSDN:

Instantiating the Filter Graph
You can use the filter graph manager to render existing files of the following types.

.avi (Audio-Video Interleaved)
.mov (Apple® QuickTime®)
.mpg (Motion Picture Experts Group)

In addition, you can use the filter graph manager to render an existing filter graph by specifying the file that contains that graph as a parameter to the RenderFile method.

Because the filters in a filter graph are dependent on the type of file being rendered, the sample application does not instantiate a filter graph until the user selects a file. The code that handles this selection is embedded in the procedure that opens the file, mnu_FileOpen. This code displays the Show Open common dialog box and stores the selected file name in a g_strFileName variable. After this, the code verifies that the correct file type was chosen. Quartz.dll issues an error message if it is passed a file extension other than .mpg, .avi, or .mov.

After the g_strFileName variable is set, the application instantiates the filter graph manager and creates the filter graph object. The filter graph manager is instantiated when the Visual Basic keyword New is used to create the AUTOMATION object. The filter graph object is created when the IMediaControl::RenderFile method is called, as shown in the following example.

'Instantiate a filter graph for the requested
'file format.

Set g_objMediaControl = New FileGraphManager
g_objMediaControl.RenderFile (g_strFileName)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Filters from Filter Graph jcsston DirectX 0 02-13-2003 01:06 AM
Picture Object's Render Method lv_blazer Interface and Graphics 1 08-05-2002 12:57 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->