Discussion:
SampleGrabber stopping video
(too old to reply)
TEST
2008-07-27 23:48:16 UTC
Permalink
Graph looks like this


->output1->encoder->avi mux->file writer
tuner->crossbar->video device->inifinite pin tee filter

->output2->decompressor->samplegrabber->null renderer

->output3->decompressor->video renderer


I can do this graph using the graphedit and works like a charm. But using
directshow once I run the graph, the video stops like its paused. I can
still see the video in the window its just stopped on a frame. Checking the
media control's state says im running. I have set the
SampleGrabber->SetOneShot(TRUE). I have'nt seen anything else in the docs
which might be causing this.

Any idea's on what I can check for.
TEST
2008-07-28 00:03:28 UTC
Permalink
Sorry, correction
SampleGrabber->SetOneShot(FALSE).

Also note that even though the state is running I can stop, then restart and
it will grab one more frame and stop again.
Post by TEST
Graph looks like this
->output1->encoder->avi mux->file writer
tuner->crossbar->video device->inifinite pin tee filter
->output2->decompressor->samplegrabber->null renderer
->output3->decompressor->video renderer
I can do this graph using the graphedit and works like a charm. But using
directshow once I run the graph, the video stops like its paused. I can
still see the video in the window its just stopped on a frame. Checking
the media control's state says im running. I have set the
SampleGrabber->SetOneShot(TRUE). I have'nt seen anything else in the docs
which might be causing this.
Any idea's on what I can check for.
Alessandro Angeli
2008-07-28 17:21:31 UTC
Permalink
From: "TEST"
Post by TEST
Sorry, correction
SampleGrabber->SetOneShot(FALSE).
Also note that even though the state is running I can
stop, then restart and it will grab one more frame and
stop again.
The behavior you describe is the one-shot behavior. Do you
receive an EC_COMPLET from IMediaEvent? Are you sure you are
setting it to FALSE? Why do you set it at all if you do not
need it?
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
TEST
2008-07-28 19:07:56 UTC
Permalink
OK, since I was going to render the video anyway I did away with the null
renderer and hooked direct to the video renderer. This allowed the video to
continue as expected. No idea why when I hooked it to the null renderer it
was causing that. I did retry after getting success and still had the same
result. I may try going back again this evening and checking the
EC_COMPLETE and see what I get. Below is the code I was using. I tried
this in a couple of spots ie.. before I connected the pins, after I
connected the pins, right after creating the filter etc....

IBaseFilter *p_BaseFilter;
hr = gp_GraphBuilder->FindFilterByName(L"Sample Grabber",
&p_BaseFilter);
ISampleGrabber *p_SampleGrabber = NULL;
hr = p_BaseFilter->QueryInterface(IID_ISampleGrabber,
reinterpret_cast<void**>(&p_SampleGrabber));
if(hr==S_OK && p_SampleGrabber)
{
hr = p_SampleGrabber->SetOneShot(FALSE);
hr = p_SampleGrabber->SetBufferSamples(TRUE);
//SG_I p_SGI;
//hr = p_SampleGrabber->SetCallback(&p_SGI, 0);
SAFE_RELEASE(p_SampleGrabber);
}
SAFE_RELEASE(p_BaseFilter);

Thanks Alessandro!
Post by Alessandro Angeli
From: "TEST"
Post by TEST
Sorry, correction
SampleGrabber->SetOneShot(FALSE).
Also note that even though the state is running I can
stop, then restart and it will grab one more frame and
stop again.
The behavior you describe is the one-shot behavior. Do you receive an
EC_COMPLET from IMediaEvent? Are you sure you are setting it to FALSE? Why
do you set it at all if you do not need it?
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
The March Hare [MVP]
2008-07-28 19:30:12 UTC
Permalink
Post by TEST
OK, since I was going to render the video anyway I did away with the null
renderer and hooked direct to the video renderer...
Why did you crosspost this to:

microsoft.public.win32.programmer.directx.managed (You are not using
managed code)

microsoft.public.directx.video (An end user newsgroup)

Why did you not set a follow up?

Follow up set to:

microsoft.public.win32.programmer.directx.video
--
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
Loading...