I can't send event from ProcessOutput() of MFT

I'm trying to send event from ProcessOutput() of MFT but downstream MFT of ProcessEvent() or Stream Sink of IMFStreamSink::PlaceMarker() couldn't receive it.

my MFT's ProcessOutput() pEvents member of the MFT_OUTPUT_DATA_BUFFER structure always comes with NULL is this ok

Since pEvents are NULL I'm creating IMFCollection by myself using MFCreateCollection() is this ok

At last I'm adding event to collection.

Thanks.

kasumi



Answer this question

I can't send event from ProcessOutput() of MFT

  • NeederOfVBHelp

    The EVR is not going to forward the event to the application.

    If you need this event to make it to the application, you could do something like implement your own sink as a wrapper around the EVR; this wrapper sink could handle the event.

    But, like we discussed on an earlier thread, MFTs do not have a direct channel through which to send events to the application.



  • Kea

    How to implement own sink as a wrapper around the EVR
    It not so easy is it

  • Nathalie12

    For now, the spec doesn't require Media Sinks to forward events received through PlaceMarker back to the application, so the EVR is doing what it's supposed to here.

    But thanks for the feedback; the idea to make it possible for the application to see events that originate at MFTs without participation of the sink is an interesting one.

    Becky



  • Tania-chan

    No, not totally trivial, but doable.

    The basic idea is to forward all MediaSink / StreamSink calls to the EVR. Your Stream Sink will also need to listen for events from the Stream Sink, implement IMFMediaEventGenerator (easy if you use the MF-provided "event queue": MFCreateEventQueue), and queue those events so that MF sees them.

    Yet another idea would be to insert a Tee node in the topology, and have one branch of the tee lead to a custom sink that you write. This sink could just drop all samples and watch for the event that you care about in PlaceMarker. I recommend marking that output of the Tee with the MF_TOPONODE_DISCARDABLE attribute, which will let MF know that it is not crucial to deliver all samples to this sink.

    Becky



  • Ferdinand Kuiper

    Why can't just fix EVR to forward the event to the application

    if EVR forward event it make application to be much simple.


  • Sirus555

    I found bug in my MFT and now I can see event passing down to sink.
    Using my fileSink, event will passed to application, but using EVR as the sink event will be blocked by EVR.

    I'm making mpeg2decoder and need to send custom event to application. application will use EVR as the sink. Will EVR going to pass custom event form MFT or Is there better way to send event to application from MFT


  • I can't send event from ProcessOutput() of MFT