Sign in to follow this  

Getting a bitmap from DirectShow

This topic is 3594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a program that plays a video with the direct show VMR9 windowless control. I'm trying to get each frame as it plays so that I can sample the pixels for movement. The windowless control has a method for getting the current image:
HRESULT GetCurrentImage(
  BYTE**  lpDib
);
I want to use this method, but I'm not sure exactly how to use the data that the method provides. MSDN gives a start for how to do this:
BYTE *lpDib = NULL;
hr = pWindowlessControl->GetCurrentImage(&lpDib);
if (SUCCEEDED(hr))
{
    BITMAPINFOHEADER *pBMIH = (BITMAPINFOHEADER*)lpDib;
    /* .... */
    CoTaskMemFree(lpDib);
}
and thats nice but... it doesn't explain how to get the actual pixel data from the bitmap. I've tried looking at other documentation but there don't seem to be any good examples for this. How can I get the pixel data from this bitmap?

Share this post


Link to post
Share on other sites

This topic is 3594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this