简体   繁体   中英

IMFTransform Configuration

I want to write an IMFTransform that will blend 2 audio streams. But ideally I'd like to apply it in a stream-specific fashion. For example, I'd like to blend only a certain duration of the streams. To reiterate, the exact timing and duration would be different in each instance.

The problem is that I don't see any kind of function in the IMFTransform interface that allows me to pass this information. Am I missing something? Should I extend the IMFTransform interface with some custom methods or functions? What is the acceptable way forward?

You don't need to extend IMFTransform interface, this is not how things are supposed to be done. You typically implement another private interface on the same transform class and make it available using regular COM IUnknown::QueryInterface (or in some sense similar IMFGetService ). The application would create an instance of transofrm, query this additional interface and pass necessary configuration.

I use a similar approach with this projet: MFSkVideoRenderer

  • VideoShaderEffect.idl: declare COM object (interface/method/library)
  • SinkVideoRenderer.h: add public IMFVideoShaderEffect, and declare method (STDMETHOD(FunctionName)();)
  • SinkVideoRenderer.cpp: implement method HRESULT CSinkVideoRenderer::FunctionName(){ return S_OK: } (could also be inlined in SinkVideoRenderer.h, if simple code)
  • include: #include "VideoShaderEffect_h.h" (will be generated from.idl)
  • to use inside an another program: #include "VideoShaderEffect_i.c" (will also be generated from.idl) see MFNodePlayer for an example

You will have to learn a little about MIDL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM