IGraphBuilder::Render() fails to return
  Home FAQ Contact Sign in
microsoft.public.win32.programmer.directx.audio only
 
Advanced search
POPULAR GROUPS

more...

microsoft ... directx.audio Profile…
 Up
IGraphBuilder::Render() fails to return         


Author: samkol649
Date: Sep 12, 2008 14:34

Hi all,

I have posted similar question in directshow group, but since my
problem is related more to audio, I decided to post it here instead. I
do apologize if this makes some of you feel inconvenient.

With the help from many good guys in directshow group, I know how to
write a custom source filter that I can use internally (without
register DLL).

I am developing an application for Windows Mobile 5 Pocket PC using
DirectShow.
I have a question:
I create a custom source filter based on IBaseFilter and
IBaseOutputPin. I can initialize the Graph Builder Manager and add the
filter. However, when I call IGraphBuilder::Render() on my output pin,
the application never returns from the function. Using debugger, I
realize that the application keeps on calling
IBaseOutputPin::GetMediaType(). Below is my graph diagram:

////// Audio Source Stream --> Source Filter --> Audio
Renderer //////
Show full article (2.18Kb)
4 Comments
Re: IGraphBuilder::Render() fails to return         


Author: tunah1
Date: Sep 15, 2008 07:53

> So, can anyone here help me?

You should only return when the supplied index is actually a valid
index.

if(iPosition<0) return E_INVALIDARG;
if(iPosition>0) return VFW_S_NO_MORE_ITEMS;

// Return your mediatype as usual.

It keeps calling your GetMediaType until VFW_S_NO_MORE_ITEMS is
returned.
no comments
Re: IGraphBuilder::Render() fails to return         


Author: samkol649
Date: Sep 15, 2008 08:14

On Sep 15, 10:53 am, tun...@gmail.com wrote:
>
> You should only return when the supplied index is actually a valid
> index.
>
>     if(iPosition<0)    return E_INVALIDARG;
>     if(iPosition>0)    return VFW_S_NO_MORE_ITEMS;
>
>     // Return your mediatype as usual.
>
> It keeps calling your GetMediaType until VFW_S_NO_MORE_ITEMS is
> returned.

Thank you very much Tun,
Show full article (0.97Kb)
no comments
Re: IGraphBuilder::Render() fails to return         


Author: Alessandro Angeli
Date: Sep 15, 2008 08:48

From: "samkol649"
> GetDeliveryBuffer() and Deliver(). Is this wrong? If not,
> do you why I get hr = S_FALSE?

Have you read the doc page on IMediaControl::Run()?

http://msdn.microsoft.com/en-us/library/ms785876(VS.85).aspx

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
no comments
Re: IGraphBuilder::Render() fails to return         


Date: Sep 15, 2008 17:04

> I think you have solved 50%% of my problem. Now, the other 50%% is that,
> after I call IGraphBuilder::Render(), then I call
> IMediaControl::Run(). But this Run() returns hr = S_FALSE.
> My audio source filter is derived from CBaseFilter with
> CBaseOutputPin. I will call GetDeliveryBuffer() and Deliver() to push
> the audio data to the AudioRenderer.
> So, I call IMediaControl::Run() before calling GetDeliveryBuffer() and
> Deliver(). Is this wrong? If not, do you why I get hr = S_FALSE?

Also answered in ../video.

Please do not multi-post.

See: http://tmhare.mvps.org/help.htm#mp

--
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
no comments