다음을 통해 공유


IWMPTranscodePolicy::allowTranscode method (wmpservices.h)

[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 allowTranscode method retrieves a value specifying whether Windows Media Player is permitted to change the format of the digital media content to the Windows Media format.

Syntax

HRESULT allowTranscode(
  [out] VARIANT_BOOL *pvbAllow
);

Parameters

[out] pvbAllow

Pointer to a VARIANT_BOOL that contains a value indicating whether transcoding is permitted.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Value Description
S_OK The method succeeded.

Remarks

When you copy to a device a digital media file that is in a custom format, you must change the format of the content if the device does not support the custom format. This process is called transcoding.

If the format used by a digital media file is not supported, Windows Media Player first checks the registry for existing permission to transcode, as described in File Name Extension Registry Settings. If the custom format type is registered for permission to transcode, Windows Media Player locates the DirectShow source filter for the custom format type and calls QueryInterface to retrieve a pointer to IWMPTranscodePolicy. If the interface pointer is retrieved, the Player calls IWMPTranscodePolicy::allowTranscode. If allowTranscode returns VARIANT_TRUE, Windows Media Player performs the necessary transcoding. Otherwise, Windows Media Player does not copy the digital media file to the device. If any filter in the DirectShow graph returns VARIANT_FALSE from allowTranscode, the transcoding operation will fail.

Windows Media Player 10 Mobile: This method is not supported.

Requirements

Requirement Value
Minimum supported client Windows Media Player 10 or later.
Target Platform Windows
Header wmpservices.h
DLL Wmp.dll

See also

IWMPTranscodePolicy Interface