MediaTranscoder.PrepareStreamTranscodeAsync 方法

定义

异步初始化指定流上的 trancode 操作,并返回可用于启动转码操作的 PrepareTranscodeResult 对象。

public:
 virtual IAsyncOperation<PrepareTranscodeResult ^> ^ PrepareStreamTranscodeAsync(IRandomAccessStream ^ source, IRandomAccessStream ^ destination, MediaEncodingProfile ^ profile) = PrepareStreamTranscodeAsync;
IAsyncOperation<PrepareTranscodeResult> PrepareStreamTranscodeAsync(IRandomAccessStream const& source, IRandomAccessStream const& destination, MediaEncodingProfile const& profile);
public IAsyncOperation<PrepareTranscodeResult> PrepareStreamTranscodeAsync(IRandomAccessStream source, IRandomAccessStream destination, MediaEncodingProfile profile);
function prepareStreamTranscodeAsync(source, destination, profile)
Public Function PrepareStreamTranscodeAsync (source As IRandomAccessStream, destination As IRandomAccessStream, profile As MediaEncodingProfile) As IAsyncOperation(Of PrepareTranscodeResult)

参数

source
IRandomAccessStream

源流。

source 不能是 InMemoryRandomAccessStream 或其他可写流。

destination
IRandomAccessStream

目标流。

profile
MediaEncodingProfile

要用于操作的配置文件。

返回

此方法完成后,将返回可用于启动转码的 PrepareTranscodeResult 对象。

示例

以下示例演示如何使用此方法对流进行转码。

var transcoder = new Windows.Media.Transcoding.MediaTranscoder();
return transcoder.prepareStreamTranscodeAsync(sourceStream, destinationStream, profile);

注解

参数不能是 InMemoryRandomAccessStream 或其他可写流。

适用于