locked
Using IMFMixerBitmap RRS feed

  • Question

  • I have a DirectShow application that uses the VMR's IVMRMixerBitmap interface to blend a bitmap with a video. Before using it I understand you have to call IVMRFilterConfig's SetNumberOfStreams method to put the VMR into the correct state, and so far it works fine :)

    So now I'm trying to use Media Foundation and I've found corresponding interfaces such as IEVRFilterConfig and IMFMixerBitmap. Is the operation of these fairly similar? ie. do I need to call IEVRFilterConfig's SetNumberOfStreams() before I can use IMFMixerBitmap?

    I've been trying to do this and using IMFGetService's GetService() to try and get the IMFMixerBitmap interface afterwards but without much success - I keep getting a return code of 0xc00d36ba..

    Is there anything else I should be doing?

    Monday, July 24, 2006 3:44 PM

Answers

  • Ronan,

    First QI EVR filter for IMFGetService:

    hr = pEVRFilter->QueryInterface(IID_IMFGetService, (void**)&pGetService);

    Then request IMFVideoMixerBitmap as

    hr = pGetService->GetService(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerBitmap, (void**)&pMixerBitmap);

    Also, EVR is always in what was called 'mixing mode', so you do not have to change number of input pins of EVR.

    However, please note that mixer's interfaces are not available unless at least one EVR pin is connected. The reason is that EVR contains two plug-in modules, mixer and presenter; and their initialization is type-dependent.

    Thanks, Dennis Evseev

    Friday, July 28, 2006 1:03 AM

All replies

  • Sorry! That shoule be IMFVideoMixerBitmap, not IMFMixerBitmap...
    Tuesday, July 25, 2006 9:12 AM
  • There are actually two versions of the EVR: The EVR filter for DShow, and the EVR media sink for Media Foundation. They share many of the same interfaces but there are some differences to account for the different object models in DShow and Media Foundation.

    The EVR filter supports IEVRFilterConfig. You can use this to add substreams. However, the filter is always created with one input pin, so if you are rendering a single video stream, you do not have to use this interface. Also, there is no longer a concept of a "mixing mode" state that you need to set explicitly, as the VMR requires.

    To get the IMFVideoMixerBitmap interface, call GetService with service id = MF_VIDEO_MIXER_SERVICE, eg:

    hr = MFGetService(pEvr, MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerBitmap, (void**)&pMixerBitmap);

    This works the same way on the filter and the media sink.

    0xc00d36ba is MF_E_UNSUPPORTED_SERVICE. Are you using the MIXER_SERVICE guid?

    ----------------------------------------------------------------------------
    Mike Wasson, SDK Documentation
    This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2006 Microsoft Corporation. All rights reserved.

    Wednesday, July 26, 2006 11:55 PM
  • Thanks for the info! On second viewing, its not a Media Foundation app, rather I'm using the DirectShow EVR Filter as the Video Renderer...in that case should I be using IMFGetService->GetService to get the IMFVideoMixerBitmap? I tried it and am still getting the same error. I was also using the MF_VIDEO_MIXER_SERVICE...

    As I guess this is still DirectShow, should I post this somewhere else?..

    Thursday, July 27, 2006 2:57 PM
  •  

    You should be able to CoCreate the EVR filter and then call GetService for the IMFVideoMixerBitmap interface. (In fact I just tried it...)  I'm not sure why it's failing in your case.

    Generally MF_E_UNSUPPORTED_SERVICE means the object does not recognize the service GUID, versus E_NOINTERFACE if the service GUID is valid but the requested interface is not available.

     

    ----------------------------------------------------------------------------
    Mike Wasson, SDK Documentation
    This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.

    (c) 2006 Microsoft Corporation. All rights reserved.

    Thursday, July 27, 2006 5:09 PM
  • Ronan,

    First QI EVR filter for IMFGetService:

    hr = pEVRFilter->QueryInterface(IID_IMFGetService, (void**)&pGetService);

    Then request IMFVideoMixerBitmap as

    hr = pGetService->GetService(MR_VIDEO_MIXER_SERVICE, IID_IMFVideoMixerBitmap, (void**)&pMixerBitmap);

    Also, EVR is always in what was called 'mixing mode', so you do not have to change number of input pins of EVR.

    However, please note that mixer's interfaces are not available unless at least one EVR pin is connected. The reason is that EVR contains two plug-in modules, mixer and presenter; and their initialization is type-dependent.

    Thanks, Dennis Evseev

    Friday, July 28, 2006 1:03 AM