• Advertisement
Sign in to follow this  

Getting a bitmap from DirectShow

This topic is 3664 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
Advertisement
I don't know about DirectShow, but with normal bitmap images, the bit data follows the header. Have you tried that?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement