locked
Media Foundation: How to readsample from a camera specific stream RRS feed

  • Question

  • Hello,

    I have a Microsoft Surface Pro 4.
    I want to take a photo at the highest possible resolution (3264 * 2448)

    The rear camera exposes 3 streams:
    - Stream 0 contains medias of type MFMediaType_Video up to 1920 * 1080 resolution
    - Stream 1 contains medias of type MFMediaType_Video up to 1920 * 1080 resolution
    - Stream 2 contains medias of type MFMediaType_Video and MFMediaType_Image, both up to 3264 * 2448

    I tried via IMFSourceReader::ReadSample to read the stream 2 using video type, but I cannot manage to do it. When I try to force stream 2 on readsample, the method fails with streamFlags valued at 1. When I do not force it, stream 0 seems to be automatically selected.

    I tried then via IMFCaptureEngine::takePhoto, and I managed to obtain a photo at 3264 * 2448.

    The libraries that I use always implement the IMFSourceReader::ReadSample way. So I am interested in using ReadSample to take my UHD photo.

    Is that even possible via IMFSourceReader::ReadSample? Can you tell me how?

    Regards


    Tuesday, June 6, 2017 6:11 PM