Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

Get a BITMAPINFO structure by using IMFVideoDisplayControl.GetCurrentImage

$
0
0

Hello,

What I'm trying to do is the following:

I have a video player and I would like to get a BITMAPINFO structure.

Media Foundation offers the possibility to get a BITMAPINFOHEADER by using IMFVideoDisplayControl.GetCurrentImage.

So far I got the Header and put it in the bmiHeader section of the BITMAPINFO.

What I still got to do is populate the bmiColors section of the BITMAPINFO structure.

How can I do this?

My function looks like this:

BITMAPINFO* ToTopoBuilderMF::GetCurrentImageBitMapInfo()
{
  BITMAPINFO*       pbmfh = NULL;
  BITMAPINFOHEADER  Bih;
  BYTE*             pbDIB;
  DWORD             pcbDib;
  LONGLONG          llTimeStamp;

  Bih.biSize = sizeof(BITMAPINFOHEADER);

  if (m_pVideoDisplay)
  {
    m_pVideoDisplay->GetCurrentImage(&Bih,&pbDIB,&pcbDib,&llTimeStamp);
    pbmfh->bmiHeader = Bih;
      
  }

  CoTaskMemFree(pbDIB);
  return pbmfh;
}

Best Regards,

Alin Ionascu


Viewing all articles
Browse latest Browse all 1079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>