共用方式為


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或其他可寫入資料流程。

適用於