Click to Rate and Give Feedback
MSDN
MSDN Library
Building Windows Media Player and Windows Media Encoder Plug-ins

by David Wrede

Microsoft New Media Platforms Division

November 2002

Applies to:

   Windows Media Player 9 Series

   Windows Media Encoder 9 Series

Summary: This document discusses the various types of plug-ins that can be created for Microsoft® Windows Media® Player 9 Series and Windows Media Encoder 9 Series. This document is designed for readers who have a basic understanding of Component Object Model (COM) technology.

Introduction

Plug-ins are an essential part of extending the functionality of Microsoft Windows Media Player 9 Series and Windows Media Encoder 9 Series. They provide users with new playback experiences and third parties with additional opportunities for revenue growth. Developers must use the Windows Media Player 9 Series and Windows Media Encoder 9 Series Software Development Kits (SDKs) to create and provide access to plug-ins; however, certain plug-ins are based on Microsoft DirectX® Media Objects (DMOs), which require the use of the DirectX SDK.

This paper contains the following topics that describe the creation and use of plug-ins in more detail:

  • Why Create Plug-ins? Provides several business-related reasons why you might want to create plug-ins.
  • What Are the New Plug-in Types? Describes the new types of plug-ins you can create by using the Windows Media Player 9 Series and Windows Media Encoder 9 Series SDKs.
  • How Do Users Interact with Plug-ins? Discusses how users enable your plug-in and how they can configure the plug-in by using an optional property page.
  • For More Information. Provides links to the various SDKs mentioned in this paper, as well as plug-in submission information.

Why Create Plug-ins?

Plug-ins are a great way for third parties to generate revenue and tie their products in with an established platform.

The following list provides a few reasons why you might want to create a plug-in:

  • Sales opportunity. Users do purchase third-party plug-ins. Various digital signal processing (DSP) plug-ins, DVD decoder plug-ins, and MP3 encoder plug-ins have been successful in the marketplace.
  • Large installed base. Millions of worldwide users have installed Windows Media Player and Windows Media Encoder, providing you with a large group of potential customers.
  • Ongoing services revenue. By having your plug-in experience contained within Windows Media Player, you can use the Player to provide additional services. For example, a user interface plug-in can be used to configure a DSP plug-in, or a DSP plug-in can interact with a rendering plug-into provide features such as hot spots for video.

What Are the New Plug-in Types?

Previous versions of the Windows Media Player SDK enabled you to create custom visualization, MP3 encoder, and DVD decoder plug-ins. With the Windows Media Player 9 Series SDK, you now have the ability to create other types of plug-ins through a new plug-in architecture. This enables you to create the following types of plug-ins:

  • User interface plug-ins. These plug-ins add new functionality to the Now Playing pane in the Player. You can create plug-ins that appear in the Video and Visualization pane, the Enhancements pane, the Media Information pane, or a separate window, or you can create background plug-ins that do not expose any visible user interface.
  • DSP plug-ins. These plug-ins modify or process audio and video data before it is rendered by the Player. DSP plug-ins are based on DMOs that connect to the Player through COM interfaces.
  • Rendering plug-ins. These plug-ins decode (if necessary) and render custom data contained in a Windows Media stream. Rendering plug-ins are also based on DMOs that connect to the Player through COM interfaces.

The Windows Media Player Plug-in Wizard is included with the Windows Media Player SDK and helps you create plug-ins easily by handling the standard implementation details. If you use the Plug-in Wizard to create a plug-in, you can then focus your development effort on implementing the logic of your plug-in without having to worry about the basic implementation details.

The functionality of Windows Media Encoder can also be extended through the use of the following type of plug-in:

  • Transform plug-ins. These plug-ins modify uncompressed audio and video samples prior to compression. Transform plug-ins are based on DMOs or Microsoft DirectShow® transform filters that are accessed by a wrapper plug-in through COM interfaces.

User Interface Plug-ins

The following five types of user interface plug-in extend Windows Media Player functionality:

  • Display plug-ins. These plug-ins can be used to display a variety of information. For example, a display area plug-in can retrieve information about the item that is currently playing and display related articles, interviews, and reviews.
  • Settings plug-ins. These plug-ins can display custom controls that are similar to the graphic equalizer or video settings controls.
  • Metadata plug-ins. These plug-ins can display information about the currently playing media item, simple controls, or hyperlinks to additional information.
  • Window plug-ins. These plug-ins are useful if you want the information or controls your plug-in provides to remain visible when the user switches out of the Now Playing area or enables another user interface plug-in.
  • Background plug-ins. These plug-ins can provide automatic services that do not require user input. Background plug-ins do not have user interfaces unless they implement property pages.

The following illustration shows where each of these user interface plug-ins appear in Windows Media Player.

User interface plug-ins in the Player

Figure 1. User interface plug-ins in the Player

All user interface plug-ins access the Player object model through a pointer to the core Windows Media Player application programming interfaces (APIs). This allows your plug-in to access core Player functionality such as Media Library, the current playlist, Player controls, events, and so on.

When creating a user interface plug-in, you must only implement IWMPPluginUI. This API exposes several methods that must also be implemented. If you use the Windows Media Player Plug-in Wizard, the basic implementation is done for you.

User interface plug-ins are supported in the full mode of the Player and on any operating system that supports Windows Media Player 9 Series.

DSP Plug-ins

DSP plug-ins process audio or video data before Windows Media Player renders it. For example, a DSP plug-in could add an echo effect to an audio stream or convert a color video stream to grayscale to modify the user's content during playback.

DSP plug-ins work with all Windows Media files, MP3 files, AVI and WAV files, and CDs. DSP plug-ins do not work with any content protected by digital rights management (DRM), except content that was copied locally. They also do not work with DVDs.

When creating a DSP plug-in, you must implement two APIs: IMediaObject and IWMPPluginEnable. As mentioned previously, DSP plug-ins are based on DMOs, so format negotiation and data processing are managed by the IMediaObject interface. The IWMPPluginEnable interface stores a value indicating whether the plug-in has been enabled in the Player.

If you want to create a property page to enable users to change the behavior of the plug-in, you must implement the IPropertyPage and ISpecifyPropertyPages interfaces.

The Windows Media Player Plug-in Wizard provides the basic implementation for either audio or video DSP plug-ins.

DSP plug-ins are supported in the full mode of the Player, skins, and embedded controls. They are supported on any operating system that supports Windows Media Player 9 Series.

Rendering Plug-ins

Rendering plug-ins receive arbitrary data streams from the Player, and then render that data. This enables you to render data in virtually any format and display it in the Player. For example, you could use a rendering plug-in to create "hot spots" in a video that users can click to change the video playback experience. Arbitrary data streams, like the one in the hot spots example, must be written into a Windows Media file using an authoring tool based on the Windows Media Format 9 Series SDK.

When creating a rendering plug-in, you must implement six interfaces: IMediaObject, IWMPNodeRealEstate, IWMPNodeWindowed, IWMPNodeWindowless, IWMPPlugin, and IWMPWindowMessageSink. Because rendering plug-ins are also based on DMOs, the IMediaObject interface manages format negotiation and data processing for the rendering plug-in. The IWMPNodeRealEstate interface is used to make requests and receive responses related to the rendering region. Because the Player can render data in either window or windowless mode, the rendering plug-in must implement both the IWMPNodeWindowed and IWMPNodeWindowless interfaces. The IWMPNodeWindowed interface specifies and retrieves the owner window. The IWMPNodeWindowless interface initiates drawing in the windowless mode. The IWMPPlugin interface manages the connection to the Player. Finally, the IWMPWindowMessageSink receives Microsoft Windows® messages when the plug-in is in windowless mode.

If you want to enable users to access a property page, you must implement the IPropertyPage and ISpecifyPropertyPages interfaces.

The Windows Media Player Plug-in Wizard creates a sample rendering plug-in that displays text while playing an audio file.

Rendering plug-ins are supported in the full mode of the Player, skins, and embedded controls. They are supported on any operating system that supports Windows Media Player 9 Series.

Transform Plug-ins

Transform plug-ins modify uncompressed audio and video samples prior to compression. For example, transform plug-ins can perform tasks such as watermarking, video annotation, fingerprinting, and custom audio/video processing.

Transform plug-ins are based on DMOs or on transform filters that Windows Media Encoder accesses through a wrapper plug-in. Transform plug-ins can modify any input type that is supported by Windows Media Encoder, but they can modify only one media type per plug-in. For example, if you want to modify both the audio and video streams in a file, you must to create two separate transform plug-ins.

When creating transform plug-ins, you must implement the IMediaObject interface. After you have created and registered your plug-in, you can use the IWMEncTransformPluginInfoManager and IWMEncPluginInfo interfaces to manage and retrieve information about your plug-in.

Transform plug-ins are supported on any operating system that supports Windows Media Encoder 9 Series.

How Do Users Interact with Plug-ins?

Users can download Windows Media Player plug-ins from WindowsMedia.com. They can also download plug-ins by using the Media Guide feature of the Player; by clicking the Tools menu, pointing to Plug-ins, and clicking Download Plug-ins; or by clicking the Plug-ins tab in the Options dialog box.

Users must install Windows Media Player and Windows Media Encoder plug-ins by using installation programs, so that the plug-ins are properly registered on their computers.

After the Windows Media Player plug-ins have been installed, users can then enable and disable them by using the check boxes provided on the Plug-ins tab. Users can also enable and disable plug-ins by clicking the Tools menu, pointing to Plug-ins, and clicking the plug-in name. Plug-ins may use a property page, which users can also access from the Plug-ins tab.

After the Windows Media Encoder plug-ins have been installed, users must register them using the Plug-ins tab in the Session Properties dialog box. Once the plug-ins are registered, users can click a plug-in and move it to their current list of plug-ins. The order of the plug-ins in this list determines how the content is processed.

For More Information

  • You can submit information about your plug-in to the Windows Media Plug-in portal by sending an e-mail message to mpplugin@microsoft.com.
  • The Windows Media Player, Windows Media Encoder, Windows Media Format, and DirectX SDKs can be downloaded from MSDN® Online.

Related articles on this CD:

  • "Creating a Windows Media Services Logging Plug-in"
  • "Creating Customized Web Experiences with Windows Media Player 9 Series"

Legal Notice

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.

This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE INFORMATION IN THIS DOCUMENT.

Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2002 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows Media, Windows NT, ActiveSync, ActiveX, Direct3D, DirectDraw, DirectInput, DirectMusic, DirectPlay, DirectShow, DirectSound, DirectX, FrontPage, HighMAT, JScript, Microsoft Press, MSN, NetShow, Outlook, PowerPoint, Visual Basic, Visual C++, Visual InterDev, Visual J++, Visual Studio, WebTV, Win32, and Win32s are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker