Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BufferCB and SampleCB not getting called

188 views
Skip to first unread message

Johnson

unread,
Dec 15, 2009, 5:30:45 AM12/15/09
to
Hi,
BufferCB and SampleCB not getting called . Any reason for this?This is how
I implemented.
class MySampleGrabberCB : public ISampleGrabberCB
{
STDMETHODIMP BufferCB( double dblSampleTime, BYTE * pBuffer, long
lBufferSize )
{
}
}

This is how I set Callback.
pGrabber->SetCallback( &CB ,2);


Alessandro Angeli

unread,
Dec 15, 2009, 12:40:43 PM12/15/09
to
From: "Johnson"

Where are the IUnknown methods? Where is SampleCB()? What is
CB? How does that code even compile? What's your graph's
topology? Is your graph running?

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm


mtsay

unread,
Dec 15, 2009, 5:34:59 PM12/15/09
to
> pGrabber->SetCallback( &CB ,2);

If I'm not mistaken, the valid values for the 2nd parameter are 0 and
1.

Tim Roberts

unread,
Dec 16, 2009, 12:24:43 AM12/16/09
to

"Johnson" <Joh...@gmail.com> wrote:
>Hi,
>BufferCB and SampleCB not getting called . Any reason for this? This is how
>I implemented.
>class MySampleGrabberCB : public ISampleGrabberCB
>{
> STDMETHODIMP BufferCB( double dblSampleTime, BYTE * pBuffer, long
>lBufferSize )
> {
> }
>}
>
>This is how I set Callback.
>pGrabber->SetCallback( &CB ,2);

And what do you think the "2" means there?
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

Johnson

unread,
Dec 16, 2009, 1:15:55 AM12/16/09
to
Hi , Thanks for you response.. Whatever code given was part the application.
It was building fine.

I found the problem..In the sample header <qedit.h> included like this .
#define CINTERFACE
#include <qedit.h>

This is forcing to access IsampleGrabber object like this.
pGrabber->vtbl->SetCallback(&CB,2) . Now I commented "#define CINTERFACE".It
is fine.For each frame SampleCB or BufferCB is getting called based on
parameter.
I should have given this code directly. I thought problem is not in vtbl.

Thanks.


"Johnson" <Joh...@gmail.com> wrote in message
news:ORfHxGXf...@TK2MSFTNGP02.phx.gbl...

Johnson

unread,
Dec 16, 2009, 1:19:00 AM12/16/09
to
Yes.. you are right.. As 0 and 1 values crashed that line of code. I tried
with 2. It did not crash.

"mtsay" <silent...@gmail.com> wrote in message
news:b44b6bf6-c455-4a62...@p32g2000vbi.googlegroups.com...

0 new messages