locked
MediaType negotiation problem with custom EVR mixer RRS feed

  • Question

  • Hi there

    I'm writing a custom EVR mixer for the MF model but I'm stuck with media type negotiation. The call-order is like this:

    EVR asks IMFTransform::GetOutputAvailableType() on me. I say: MF_E_TRANSFORM_TYPE_NOT_SET because I need input types first.
    EVR calls IMFTransform::SetInputType() with NV12, YV12, YUY2 and UYVY in that order. I accept UYVY and return S_OK.
    EVR calls IMFTransform::GetOutputAvailableType() again. I return 1 format: Video/UYVY, FPS, Width and Height from input stream, progressive uncompressed.
    EVR calls IMFTransform::SetOutputType() with the type above but different width/height. Probably the window size. I still accept the format but dont set it as MFT_SET_TYPE_TEST_ONLY is set. I return S_OK.

    Now I'd expect the EVR/presenter to call SetOutputType() again (as with SetInputType()) without the MFT_SET_TYPE_TEST_ONLY bit set but it doesnt. No further calls into my mixer are made and the whole thing stops with MF_E_INVALIDMEDIATYPE.

    I have tried different subtypes (NV12, YUY2) with the same results.

    My question: What am I missing here? As far as I see the type negotiation is done but the presenter does not set the media type on my output stream as it should.

    I use the default MF presenter.


    Any help would be greatly appreciated.
    E. Neidt
    Wednesday, April 8, 2009 11:40 AM

Answers

  • Hi,

    After testing the media type on the mixer, the presenter actually checks the media type on itself before setting the final type on the mixer.  If the presenter rejects the format, the mixer will never get the SetOutputType call.

    There are a lot of reasons the presenter might reject a video format, but such a straighforward media type should be OK.  On a hunch, I am going to say that setting MF_MT_ALL_SAMPLES_INDEPENDENT to 1 on the available types might fix this.  I am guessing this attribute was not on the type passed to SetOutputType from what you said, but if there were other attributes on the media type it would be helpful to know what they are if this does not fix your problem.

    Hope this helps,
    Matt
    Friday, April 17, 2009 9:25 PM

All replies

  • Hi,

    After testing the media type on the mixer, the presenter actually checks the media type on itself before setting the final type on the mixer.  If the presenter rejects the format, the mixer will never get the SetOutputType call.

    There are a lot of reasons the presenter might reject a video format, but such a straighforward media type should be OK.  On a hunch, I am going to say that setting MF_MT_ALL_SAMPLES_INDEPENDENT to 1 on the available types might fix this.  I am guessing this attribute was not on the type passed to SetOutputType from what you said, but if there were other attributes on the media type it would be helpful to know what they are if this does not fix your problem.

    Hope this helps,
    Matt
    Friday, April 17, 2009 9:25 PM
  • I have the same problem with Custom Presenter, i force NV12 on renegociate function (it's seems to work) but when y check the graph i have YUY2 and cpu usage is greater than standard EVR. With standard EVR i have NV12 without doing any things...

    How force NV12 on input type ?

    PS : My Custom presenter is in D3D fullscreen mode.
    Monday, September 21, 2009 8:55 AM
  • I have the same problem - the custom presenter does not seem to accept the NV12 format and hence does not do DXVA. But the standard EVR works perfectly. How to overcome this problem.

    I am using Windows 7 system.

    Thanks,
    v.kishore
    Friday, January 29, 2010 8:03 AM