I have a graph end point of which is a SampleGrabber where I get uncompressed data of all frames using callback function.
In my top level interface code I want to have a function ReadNextFrame() which gets the data of the next frame in the graph (until it reaches the end of file).
A performance-wise bad implementation would be to pass a nextFrameIndex to grabberCB class specifying which frame I want at this moment. So my callback function would skip all other frames and would pick only the one I want. This is costly since the graph has to travel through the whole file for picking a single frame data.
I noticed there is a IVideoFrameStep interface which is ideally what I want. But it seems that this interface is not compatible with Sample Grabber and it's documentation says:
Decoders that implement frame-accurate seeking under Microsoft DirectShow must implement the AM_KSPROPSETID_FrameStep property set, which is used in conjunction with the IVideoFrameStep interface.
I tried to connect it to my graph but IVideoFrameStep::CanStep() function returned false for me meaning that I can't use it with Sample Grabber.
So my question is: Is there an easy and performance-wise good solution so I can have my graph to keep the current state and then make a single frame forward and get the data using Sample Grabber?