Share via


INuiSensor::NuiImageStreamGetNextFrame Method

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Gets the next frame of data.

Syntax

public:
HRESULT NuiImageStreamGetNextFrame(
         HANDLE hStream,
         DWORD dwMillisecondsToWait,
         NUI_IMAGE_FRAME *pImageFrame
)

Parameters

  • hStream
    Type: HANDLE
    [in] A handle to the image stream.

    Note

    Open the stream by calling the NuiImageStreamOpen method, before calling NuiImageStreamGetNextFrame.

  • dwMillisecondsToWait
    Type: DWORD
    [in] The time in milliseconds to wait before returning without a frame.

  • pImageFrame
    Type: NUI_IMAGE_FRAME
    A pointer to a NUI_IMAGE_FRAME structure that contains the next image frame in the specified stream. The pFrameTexture member of the structure points to an INuiFrameTexture instance that contains the frame data.

Return Value

Type: HRESULT
Returns S_OK if successful; otherwise, returns one of the failure codes in the following table.

Error Description
S_FALSE The waiting timeout expired before a frame was available and hStream was opened using the NUI_IMAGE_STREAM_FLAG_SUPPRESS_NO_FRAME_DATA flag.
E_INVALIDARG The value of the hStream parameter is NULL.
E_NUI_FRAME_NO_DATA The waiting timeout expired before a frame was available.
E_POINTER The value of the pImageFrame parameter is NULL.

Requirements

Header: Declared in NuiSensor.h; however, include NuiApi.h in your project.