jeez ... so much dis info. if you are viewing a directshow chart, it depends on what you are viewing. Capture filters have 1, 2 or 3 pins. If it has 1 pin, it is most likely a “grabbing” pin (without preliminary pin). To do this, if you want to capture and preview at the same time, you must install the “Smart Tee” filter and connect the VMR to the preview output and connect “what captures frames” from the capture pin. since you don’t want to spoof using DirectShow crummy pin start / stop stuff (instead, just control the entire start / stop state of the chart). You do not need to use SampleGrabber, it is a simple filter and you could write it in a few hours (I should know that I wrote this). it's just a CTransInPlace filter, which you can set for a forced media type so that it can accept, and you can set a callback interface on it to call you back when it receives a sample. It’s actually easier to write a NullRenderer that will call you back when it receives the sample, you can write this quite easily.
If the capture filter has 2 pins, it is most likely a gripping pin and a fixed pin. in this case, you still need a smart tee connected to the output to connect the source, and it needs to preview the smart preview pin and capture the samples from the smart tee.
(If you don’t know what SmartTee is, it is a filter that plays distributor tricks and sends only the sample down to the preview contact if the capture contact is not too clogged. This task is to provide a path for the VMR to render from which the distributors will not load between the capture filter and the filters after the capture filter)
If the capture filter has both capture and preview, I think you can figure out what you need to do.
Anyway, the summary: SampleGrabber is just CTransInPlaceFilter. You could write it as a Null Renderer, just remember to fill some trash in CheckInputType and call the callback back to DoRenderSample.
Ericf.
source share