Directshow - capture image from a push-source stream

June 27th, 2012 - 06:16 pm ET by krazcanuck | Report spam
Hello,
I have a custom directshow filter that allows me to modify the pixels of a push-source stream any way I want.

Now I want to capture an image from this stream (either before or after my transformation) but am getting weird results. The stream is clearly not in sync as the horizontal lines from the captured image creeps to the left as they progress down the image and they change colors randomly. (If I could post an image, it would help describing the problem).

I am inheriting the CTransInPlaceFilter class, overriding the Transform method and basically...

BYTE *pData = NULL;
pMediaSample->GetPointer(&pData);
long lDataLen = pMediaSample->GetActualDataLength();
WriteBMPToFile(pData, lDataLen);

What am I doing wrong? Clearly accessing the pData and modifying it works as expected for the video data, but can't be used this way for capturing an image from this stream.
email Follow the discussionReplies Make a reply

Similar topics