Condividi tramite


About Allocating Streaming Resources

[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The sample DSP plug-in generated by the Windows Media Player Plug-in Wizard does not require any additional streaming buffers. However, you might want to allocate memory resources for your DSP plug-in. For example, a plug-in that produces an echo effect would require a secondary buffer to create the necessary time delay.

The IMediaObject interface contains two methods to handle this situation. Windows Media Player calls IMediaObject::AllocateStreamingResources to give you an opportunity to create any buffers you require. Windows Media Player later calls IMediaObject::FreeStreamingResources to allow you to free any memory you allocated previously. The sample DSP plug-in implementation also calls FreeStreamingResources from CProjectName::FinalRelease to ensure that all resources are freed before the plug-in object is destroyed.

Implementing an Audio DSP Plug-in