locked
[Device MFT] How can i get Capture Stats Metadata Attributes? RRS feed

  • Question

  • I want to get Capture Stats Metadata Attributes inside Device MFT, like MF_CAPTURE_METADATA_EXPOSURE_TIME or MF_CAPTURE_METADATA_ISO_GAINS, to do some post processing before streaming out.

    I read document from MSDN and found that MFSampleExtension_CaptureMetaData contain all capture metadata, however I don't know how to get MFSampleExtension_CaptureMetaData bag from sample.

    When receiving new sample from ProcessInput, I call GetUnknown to get MFSampleExtension_CaptureMetaData metadata attribute bag:

    STDMETHODIMP  CMultipinMft::ProcessInput(
        _In_ DWORD      dwInputStreamID,
        _In_ IMFSample* pSample,
        _In_ DWORD      dwFlags
        )
    {
       ComPtr<IMFAttributes>        pCapMetadata = nullptr;
       HRESULT hr = pSample->GetUnknown(MFSampleExtension_CaptureMetadata, IID_PPV_ARGS(pCapMetadata.GetAddressOf()));
      
       // do other things
    
    }

    I always receive MF_E_ATTRIBUTENOTFOUND error. 

    Could anyone explain how to get Capture metadata from Sample inside Device MFT?

    Thanks



    • Edited by thpd01 Tuesday, November 24, 2020 11:26 AM
    Tuesday, November 24, 2020 11:24 AM