Directshow - capture image from a push-source stream

28 views
Skip to first unread message

krazcanuck

unread,
Jun 27, 2012, 6:14:35 PM6/27/12
to
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.
Reply all
Reply to author
Forward
0 new messages