locked
Source Reader ReadSample(), IMFSourceReaderCallback::OnReadSample() memory leak? RRS feed

  • Question

  • First Execute

    hr = m_pReader->ReadSample(
            (DWORD)MF_SOURCE_READER_FIRST_VIDEO_STREAM,
            0,
            NULL,   // actual
            NULL,   // flags
            NULL,   // timestamp
            NULL    // sample
            );

    Then at the beggining of the following, the memeory used by this process adds about 3M:

    HRESULT CCapture::OnReadSample(
        HRESULT hrStatus,
        DWORD /*dwStreamIndex*/,
        DWORD /*dwStreamFlags*/,
        LONGLONG llTimeStamp,
        IMFSample *pSample      // Can be NULL
        )
    {
        .....

    }

       

    • Edited by AlanX6Wang Tuesday, July 29, 2014 5:37 AM
    Tuesday, July 29, 2014 2:31 AM

All replies

  • In the example of the CapturetoFile of Mediafoundation, there is no memory leak.

    In what circumstances, there will be memory use addition as described in this queston?

    Tuesday, July 29, 2014 2:49 AM