locked
IMFSourceReader::ReadSample returning E_POINTER RRS feed

  • Question

  • I am writing a Source-Reader based Video Capture Application, which operates Asynchronously

    However, I am getting an "E_POINTER" error when calling ReadSample for my IMFSourceReader.

    I am calling my reader as follows:

     

          hr = m_pReader->ReadSample(
            2,
            0,
            NULL,
            NULL,
            NULL,
            NULL
            );
    

    Index 2 is designated for Video in my code.

    I am suspecting that my Source Reader is being seen as operating Synchronously, because according to MSDN documentation "The pdwStreamFlags and ppSample parameters cannot be NULL. Otherwise, the method returns E_POINTER". I am getting exactly that.

     

    Prior to calling ReadSample, I am setting the operations to be Asynchronous as follows:

     

        hr = MFCreateAttributes(&pAttributes, 2);
    
    
        hr = pAttributes->SetUINT32(MF_READWRITE_DISABLE_CONVERTERS, FALSE);
    
    
        hr = pAttributes->SetUnknown(MF_SOURCE_READER_ASYNC_CALLBACK, (IMFSourceReaderCallback *)(this));
    
    
        hr = MFCreateSourceReaderFromMediaSource(
          pSource,
          pAttributes,
          &m_pReader
          );
    
    


    I apperciate your help on this issue ASAP, at least with confirming if my prime suspect is true, i.e. ReadSample call is treated as Synchronous.

     

    Thanks.

     

    Thursday, August 11, 2011 9:23 PM

All replies

  • This all looks fine.  The only thing I can think of -- does QueryInterface on your IMFSourceReaderCallback implementation handle IID_IMFSourceReaderCallback properly?  The only way I can see the source reader falling back to synchronous mode in this situation is if it cannot QI for the right interface from the attribute store.
    Tuesday, September 13, 2011 11:34 PM