none
INuiInteractionStream::GetNextFrame fails. RRS feed

  • Question

  • Hey I am new to Kinect programming. I made this simple program where I am trying to detect a grip gesture. The problem is the function INuiInteractionStream::GetNextFrame() fails every time. I know I must be making a very basic mistake since I am new to Kinect and have not found anybody else facing a problem similar to that.

    Here's the code.
    int _tmain(int argc, _TCHAR* argv[])
    {
    	INuiSensor            *m_nuiSensor;
    	NuiCreateSensorByIndex(0,&m_nuiSensor);
    	HRESULT hr = m_nuiSensor->NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON | NUI_INITIALIZE_FLAG_USES_COLOR | NUI_INITIALIZE_FLAG_USES_DEPTH_AND_PLAYER_INDEX);
    	if(FAILED(hr))    
    		{        
    			return 0;
    		}
    	
    	while (1)
    	{
    		NUI_INTERACTION_FRAME interactionFrame;		       		interactionClient* m_interactionClient =  new interactionClient();
    		INuiInteractionStream*          m_interactionStream;
    		
    		hr = NuiCreateInteractionStream(m_nuiSensor,m_interactionClient, &m_interactionStream);
    
    
    		hr = m_interactionStream->GetNextFrame(0, &interactionFrame); 
    		
    		if(FAILED(hr))    
    		{        
    			return 0;//Goes into this block every time
    		}
    }

    Any help will be appreciated.
    Wednesday, August 14, 2013 10:33 PM

Answers

All replies