locked
Capturing an image from photo stream, using SourceReader, gives video stream buffer for first still trigger RRS feed

  • Question

  • Hi,

    I have developed the desktop camera application using SourceReader technique in MediaFoundation.

    The features of application are following:
                1. Video Streaming
                2. Still Capture and 
                3. Video Capture.
    The SourceReader is in asynchronous mode, capable of video streaming and capturing an image. But I am facing a major issue while capturing an image from photo stream.

    Issue description:
    At very first still trigger from photo stream, I am receiving video streaming buffer sample, in OnReadSample Callback, with dwStreamIndex as 0(Zero).
     
    (Eg: Video Streaming resolution is 1280 x 720 and Still resolution is 1920 x 1080, Received buffer for first still trigger : 1280 x 720)
    This issue occurs in following scenarios : 
    1. First still trigger after Launch the application.
    2. After change in the video resolution and still trigger .

    For consecutive still triggers, I'm receiving the sample from photo stream as expected , in OnReadSample callback, with dwStreamIndex as  1(one).
    The above issue is recreated only with change in the video resolution and following still trigger. Whereas, not for change in the still resolution.

    Why am i receiving video streaming buffer instead of photo stream buffer for the first still trigger? Am I missing something to configure for photo stream ? If yes, help me resolve this issue.

    Thanks in advance.
    Tuesday, November 15, 2016 12:00 PM

All replies

  • How did you get the still trigger working? im currently attempting to do the same thing with a reader source however when i call read Sample asynchronously it never returns on the still image stream. ( my live stream is working fine and completely unaffected). if i switch from MFSourceReaderControlFlag.None to MFSourceReaderControlFlag.Drain i just receive null Samples so it seems like mine isnt making any data available to the source reader.
    Wednesday, June 24, 2020 2:54 PM