locked
IMFmedia buffers

    Question

  • 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 :

    http://msdn.microsoft.com/en-nz/library/windows/desktop/bb530106(v=vs.85).aspx

    and

    http://msdn.microsoft.com/en-nz/library/windows/desktop/bb530106(v=vs.85).aspx

     

    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?

    thanks

    Thursday, June 20, 2013 10:56 AM