locked
How to get/set the Bottomup value of a sample? RRS feed

  • Question

  • As you know in the DMO we are using BITMAPINFOHEADER to describe some video information.

    In the BITMAPINFORHEADER, if the bmiHeader.biHeight > 0, the data is organized as bottom-up; otherwise, the data is organized as up-bottom.

     

    But in MFT, how can we assign the value?

    Monday, January 8, 2007 10:23 AM

Answers

  • You don't need to specify top-down/bottom-up in the media type.

    When you get the buffer, QI for IMF2DBuffer. If the buffer supports IMF2DBuffer, the IMF2DBuffer::Lock2D method tells you the stride of the buffer, which is >0 for top-down or <0 for bottom-up. (It will almost certainly be top-down in this case, because it will be a D3D surface.)

    If the buffer does not support IMF2DBuffer, then it uses "GDI rules", ie, bottom-up for RGB and top-down for YUV. You can use the MFGetStrideForBitmapInfoHeader to check, for most formats.

    http://g.msn.com/9SE/1?http://msdn2.microsoft.com/en-us/library/aa473821.aspx&&DI=6066&IG=0f0654c4164d497e88d3076d3464d776&POS=1&CM=WPU&CE=1&CS=AWP&SR=1

    ----------------------------------------------------------------------------
    Mike Wasson, SDK Documentation
    This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2006 Microsoft Corporation. All rights reserved.

     

     

    Tuesday, January 9, 2007 8:12 PM