Hi,
is there a reason why the uncompressed RGB32 formats in WMF and DSHOW are BGRA in memory while outside there are lot of commonly used RGBA formats like in DXGI ? And is there any possibilty to alter a Media Type GUID so that we are able to use DXGI_FORMATs which have RGBA order with the WMF Sink Writer ?
I managed to swap channels with some memcpy, _rotr and bitshift operations. However...my real time capture of a BackBuffer is droping now 20 Frames instead of my usual 5.
I can write a custom GUID like this:
GUID VIDEO_INPUT_FORMAT = MFVideoFormat_Base;
VIDEO_INPUT_FORMAT.Data1 = D3DFMT_A8R8G8B8; // this works while D3DFMT_A8B8G8R8 is not
As you can can see from this link http://msdn.microsoft.com/en-us/library/windows/desktop/cc308051(v=vs.85).aspx, it says that some D3DFORMATs are mappable to a DXGI_FORMAT, is it also possible backward from DXGI to D3D ? Only a few of the D3DFORMATs are working, D3DFMT_A8B8G8R8 fails for example. The Problem is that i have RGBA channel order ( in DXGI the format name and the memory are in same order, it is reversed in D3D9 ), but i can only set MFVideoFormat_RGB32 or D3DFMT_A8R8G8B8 / D3DFMT_X8R8G8B8 as my input.
Are only these D3DFORMATS meantioned here http://msdn.microsoft.com/de-de/library/windows/desktop/aa370819(v=vs.85).aspx are working ?
Main question is, why DSHOW and WMF have BGRA channel order in memory ( on their uncompressed RGB32 format ) as u can see here http://msdn.microsoft.com/en-us/library/ms787838(VS.85).aspx , but some commonly used DXGI_FORMATS have RGBA. Was it expected that in future people would only use MFCreateDxgiSurfaceBuffer and add the buffer to a sample which can be encoded ( even though its only supported from Windows 8 and not below ) ?
So if M$ has some format conversion functions in their source codes why is there no side link to it ? I cant use MFCreateDxgiSurfaceBuffer in my app because a) minimum supported client for this function is Windows 8 and b) its still failing, even on Windows 8 ! ...
Is it possible to shift the bytes in the 4 Byte FOURCC from a GUID ?
Any way to encode the format without shifting the bits from each Pixel ?
regards
co0Kie