Dirk_1

Hi,

We would like to create a media player plug-in that controls some lights based on the music playing. What is the best approach to do this. We tried a visualisation plug-in but than we don't get samples when the player is minimized. When using a DSP plug-in we always get samples but we can't synchronize the audio with the light effects, due to buffering.

Does anyone have any ideas of other possibilities to achieve this

Thanks


Re: Media Foundation Development Howto use a media player plug-in to control lights?

Becky Weiss - MSFT

It took me a long time to respond to this, since I didn't have any good ideas for you; you are correct in observing that an MFT (i.e. a DSP plugin) doesn't automatically get to see the Presentation Clock, which makes synchronizing impossible.

After asking around to some of our more WMP-knowledgeable people, I got this. Note that none of us has tried this, so let me know how it goes:

There is a way to get the current Stream (clock) time from WMP in a DSP plug-in. You need to get a pointer to the IWMPServices interface in the WMP plugin. Roughly this would be the sequence of events:

n IWMPPlugin->AdviseWMPServices( IWMPServices *pServices) is called.

n Store a pointer to IWMPServices and call m_pServices->GetStreamTime to get the current time.

n Let go of the pointer in IWMPPlugin->UnAdviseWMPServices()






Re: Media Foundation Development Howto use a media player plug-in to control lights?

Dirk_1

That is absolutely correct, except it doesn't work on Vista anymore. In Vista we are unable to obtain the IWMPServices interface.




Re: Media Foundation Development Howto use a media player plug-in to control lights?

Becky Weiss - MSFT

How do you make your IWMPPlugin available Through QueryInterface, or through IMFGetService

Can you try making this available via IMFGetService and let us know if that works