The next code should give inputInfo and outputInfo configuration to get a IMFTransform back, and this IMFTransform be used to encode ID3D11Texture2D(with format DXGI_FORMAT_B8G8R8A8_UNORM) to H264
I understand the format DXGI_FORMAT_B8G8R8A8_UNORM can be taken as a MFVideoFormat_NV12 on a IMFTranform that is D3D_AWARE . But i'm having problems to get a IMFTranform that is D3D_AWARE
MFT_REGISTER_TYPE_INFO inputInfo = { MFMediaType_Video, MFVideoFormat_NV12 };
MFT_REGISTER_TYPE_INFO outputInfo = { MFMediaType_Video, MFVideoFormat_H264 };
MFT_OUTPUT_STREAM_INFO mosiBuffer;
UINT32 unFlags = MFT_ENUM_FLAG_SYNCMFT | MFT_ENUM_FLAG_LOCALMFT | MFT_ENUM_FLAG_SORTANDFILTER;
CatchError( MFTEnumEx(
MFT_CATEGORY_VIDEO_ENCODER,
unFlags,
&inputInfo, // Input type
&outputInfo, // Output type
&ppActivate,
&count
),(LPSTR)"Line 385");
CatchError(ppActivate[0]->ActivateObject(
__uuidof(IMFTransform),
(void**)& pTransform
),(LPSTR)"Line 392");
CatchError(pTransform->ProcessMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, NULL),(LPSTR)"Line 396");
IMFAttributes* imfAttributes;
CatchError(pTransform->GetAttributes(&imfAttributes), (LPSTR)"Error getAttributes from pTransform");
CatchError(imfAttributes->GetUINT32(MF_SA_D3D_AWARE,0), (LPSTR)"Error pTranform not D3D_AWARE");;
On the last lines, when i do :
CatchError(pTransform->GetAttributes(&imfAttributes), (LPSTR)"Error getAttributes from pTransform");
CatchError(imfAttributes->GetUINT32(MF_SA_D3D_AWARE,0), (LPSTR)"Error pTranform not D3D_AWARE");
i get the error "Error pTranform not D3D_AWARE", I don't know how to get a pTranform that is D3D_AWARE
I tried some programs on my computer with this Windows Duplication API, that then encodes it to H264 and they work
thanks in advance