ICameraCaptureSampleSink::OnSampleAvailable method for Windows Phone 8
Collapse the table of content
Expand the table of content

ICameraCaptureSampleSink::OnSampleAvailable method for Windows Phone 8

July 21, 2014

Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 only

Performs caller-implemented actions each time an encoded audio or video sample is captured.

VOID OnSampleAvailable(
   [in]    ULONGLONG hnsPresentationTime,
   [in]    ULONGLONG hnsSampleDuration,
   [in]    DWORD cbSample,
   [in]    BYTE* pSample
);

hnsPresentationTime [in]

Type: ULONGLONG

The start time of the sample in units of hundred-nanoseconds.

hnsSampleDuration [in]

Type: ULONGLONG

The duration of the sample in units of hundred-nanoseconds.

cbSample [in]

Type: DWORD

The size of the sample in bytes.

pSample [in]

Type: BYTE*

A pointer to the sample data.

This method does not return a value.

Use this sink by calling the IAudioVideoCaptureDeviceNative::SetAudioSampleSink method for Windows Phone 8 or the IAudioVideoCaptureDeviceNative::SetVideoSampleSink method for Windows Phone 8.

This sink only receives samples while the AudioVideoCaptureDevice object is recording. Recording starts when the StartRecordingToSinkAsync method is called and ends after StopRecordingAsync is called. Specify the audio and video encoding formats with the AudioEncodingFormat and VideoEncodingFormat properties, respectively.

Whether AudioVideoCaptureDevice captures audio or video is determined by which open method is used to create the capture device. Use the OpenAsync method for video samples with audio, OpenForAudioOnlyAsync for audio samples, and OpenForVideoOnlyAsync for video samples without audio.

Minimum supported phone

Windows Phone 8

Header

Windows.Phone.Media.Capture.Native.h

Namespace

Windows::Phone::Media::Capture

Show:
© 2017 Microsoft