Share via


NuiImageStreamGetNextFrame

Kinect for Windows 1.5, 1.6, 1.7, 1.8

Gets the next frame of data from the specified image stream.

Syntax

HRESULT NuiImageStreamGetNextFrame(
         HANDLE hStream,
         DWORD dwMillisecondsToWait,
         const NUI_IMAGE_FRAME **ppcImageFrame
)

Parameters

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

    Note

    You must open the stream by calling the NuiImageStreamOpen function, before calling NuiImageStreamGetNextFrame.

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

  • ppcImageFrame
    Type: NUI_IMAGE_FRAME
    [out] A pointer that receives 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 hNextFrameEvent parameter is an invalid handle.

Requirements

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