Re: Replace default audio renderer in Dshow video Graph ? C++



On Sun, 15 May 2005 22:20:57 +0200, Gaël Rosset wrote:

> >Approach 3: add the chosen audio renderer to the graph
> >*before* RenderFile() so that intelligent connect will (at
> >least should) pick the already added one instead of using
> >the default device.
>
> This worked and was very simple to do... The other advantage of this
> approach is that it works regardless if the file is simple audio or a
> movie file...
>
> Many thanks to both Alessandro and Phil !

You're welcome. I'm glad that Alessandro jumped in. This explains why it
works (As A.A. expected, intelligent connect doesn't look at the merits of
filters already in the filter graph):

"To connect each output pin, the Render method does the following:

1. If the pin supports the IStreamBuilder interface, the Filter Graph
Manager delegates the entire process to the pin's IStreamBuilder::Render
method. By exposing this interface, the pin assumes responsibility for
building the remainder of the graph, down to the renderer. However, very
few pins support this interface.

2. The Filter Graph Manager tries to use filters that are cached in memory,
if any. Throughout the Intelligent Connect process, the Filter Graph
Manager may cache filters from earlier steps in the process. (Also, see
Dynamic Graph Building.)

3. If the filter graph contains any filters with unconnected input pins,
the Filter Graph Manager tries them next. You can force the Render method
to try a particular filter by adding that filter to the graph before
calling Render.

4. Finally, the Filter Graph Manager searches the registry, using the
IFilterMapper2::EnumMatchingFilters method. It tries to match the output
pin's preferred media types against media types listed in the registry.

Each filter is registered with a merit, a numerical value that indicates
how preferable the filter is, relative to other filters. The
EnumMatchingFilters method returns filters in order of merit, with a
minimum merit of MERIT_DO_NOT_USE + 1. It ignores filters with a merit of
MERIT_DO_NOT_USE or less. Filters are also grouped into categories, defined
by GUID. Categories themselves have merit, and the EnumMatchingFilters
method ignores any category with a merit of MERIT_DO_NOT_USE or less, even
if the filters in that category have higher merit values."





--
Please read this before replying:
1. Dshow & posting help: http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others: follow up if you are helped or you found a solution
.



Relevant Pages

  • Re: Movie Rendering in Direct3D
    ... still, read up on filters, and managing filter graphs. ... >> InitGeometry, and Render. ... >> gets a pointer to the base filter from the texture renderer filter, ... >> adds the source filter to the graph ...
    (microsoft.public.win32.programmer.directx.graphics)
  • pGraph->Render(ip) fails many times - when changing resolutions
    ... successfully see video at FULL resolution. ... I Stopthe graph and build a new graph and filter with the ... and then prints the "Couldn't render graph" error message. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: How to get the snapshot of the first video frame of MPEG-2 video?
    ... >I use the DirectShow to build a filter graph which can render the many ... run the graph, and pause it, get the Video Render Filter and call the ...
    (microsoft.public.win32.programmer.directx.video)
  • AddSourceFilterForMoniker() locks up sometimes.
    ... I've coded a simple filter graph to capture frames from a video camera ... I can grab frames from the Sample Grabber with no ...
    (microsoft.public.win32.programmer.directx.video)
  • AddSourceFilterForMoniker() locks up sometimes.
    ... I've coded a simple filter graph to capture frames from a video camera ... I can grab frames from the Sample Grabber with no ...
    (microsoft.public.multimedia.directx.dshow.programming)