Working with Output Protection Levels

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

Licenses created by using the Windows Media Rights Manager 10 SDK can specify action restrictions using output protection levels (OPLs). OPLs enable a license creator to allow some actions only on devices with specific technologies. The benefits of using OPLs is that you get more flexibility in creating license restrictions than previous versions. In addition, OPLs are expandable to accommodate future technologies. You can support such licenses in your applications by using the methods of the IWMDRMReader2 interface.

To read files that are protected by a license that specifies OPLs, you must check the OPL for the desired action. The output technology your application is using must be allowed by the OPL in the license. For example, some licenses for protected audio may require that you use secure audio path to play it.

Configuring the Reader to Evaluate Output Protection Levels

Before you can check OPLs for files loaded in the reader, you must call the IWMDRMReader2::SetEvaluateOutputLevelLicenses method, passing TRUE for the fEvaluate parameter. If you do not call this method, licenses that require OPLs are not visible to your application.

Evaluating Copy Output Protection Levels

To get output protection levels for the copy action, call the IWMDRMReader2::GetCopyOutputLevels method. The data you receive from the call is stored in a DRM_COPY_OPL structure. The structure contains a base output protection level, which specifies the minimum output level for the copy action in the license. However, the DRM_COPY_OPL structure also contains two lists of technology identifiers: one for allowed technologies that are rated at a lower OPL than the base, and one for technologies that are rated equal to or higher than the base OPL but that are restricted by the license. You must check the inclusions and exclusions to ensure that the technology your application is using is allowed by the license.

Evaluating Play Output Protection Levels

To get output protection levels for the play action, call the IWMDRMReader2::GetPlayOutputLevels method. The data you receive from the call is stored in a DRM_PLAY_OPL structure. The structure contains several other structures. The base output protection levels for the play action are stored in a DRM_MINIMUM_OUTPUT_PROTECTION_LEVELS structure (the minOPL member of DRM_PLAY_OPL), which defines the minimum OPL required to play content in a variety of formats. You must check the member for the type of output formats that your application delivers.

The DRM_PLAY_OPL structure defines two kinds of restrictions: required down-sampling and allowed video output protection identifiers.

Required down-sampling is defined as a list of output technology identifiers (the oplIdDownsample member of DRM_PLAY_OPL) that, if used, can receive the content for playback only if the content is first down-sampled to a lower bit rate.

Allowed video output protection identifiers are defined as a list of video output technologies with configuration information for each.

Handling Multiple Licenses

Some files may have multiple licenses associated with them in the local license store. When you evaluate OPLs for a file that you are reading, you can check for additional licenses by calling the IWMDRMReader2::TryNextLicense method. You should continue trying licenses until you find one that allows the action you want to perform or until TryNextLicense returns DRM_S_FALSE, which indicates that there are no more licenses.

In some cases, a file might have an associated license that requires an OPL that your application cannot support. In such a case it is important to check for additional licenses because a license may exist that does not specify OPLs.

Note DRM is not supported by the x64-based version of this SDK.

Enabling DRM Support

IWMDRMReader2 Interface