IMFmedia buffers


  • Hi guys I'm trying to write a function which produces a IMF video Sample, which contains a frame of video with the specified color (lets keep it to white) I've managed to follow the instructions on :





    I've managed to be able to create my own IMFsample with a memory buffer by using MFCreateMemoryBuffer. However it seems wrong to use a memory buffer, as later on in my code I do this:


    Microsoft::WRL::ComPtr<IMFSample> sample = result.mSample;

    Microsoft::WRL::ComPtr<IMFMediaBuffer> pBuffer;

    HRESULT hr = sample->GetBufferByIndex(0, &pBuffer);

    if(FAILED(hr)) { return; } 

    Microsoft::WRL::ComPtr<IMFDXGIBuffer> spDXGIBuffer;

    hr = pBuffer.Get()->QueryInterface(__uuidof(IMFDXGIBuffer),(LPVOID *)(&spDXGIBuffer)); <--- this line fails with HResult of no such interface supported

    if(FAILED(hr)) { return; } 

    So I found 2 functions : MFCreateDXSurfaceBuffer() and MFCreateDXGISurfaceBuffer() and I can't seem to get them to work... can some1 teach me how to create one of these buffers instead of a memoryBuffer?


    Thursday, June 20, 2013 10:56 AM