Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenNI2CloudDataSource - Cannot subscribe to more than one stream #93

Open
jc211 opened this issue Jun 27, 2017 · 0 comments
Open

OpenNI2CloudDataSource - Cannot subscribe to more than one stream #93

jc211 opened this issue Jun 27, 2017 · 0 comments

Comments

@jc211
Copy link

jc211 commented Jun 27, 2017

Hi,
I've been trying to get this working with my kinect2, but it seems that it will crash when a clouddatasource subscribes to more than one stream.

The error is here:

void OpenNI2CloudDataSource::onStart() {
  util::checkStatus(device_.open(uri_.c_str()), "openni::Device::open() failed.");

  startColorStream();
  startDepthStream();
  //startIrStream();
  enableMirroring();
  enableDepthToColorRegistration();
}

Looking at the OpenNI2 source code:

	/**
	Adds a new Listener to receive this VideoStream onNewFrame event.  See @ref VideoStream::NewFrameListener for
	more information on implementing an event driven frame reading architecture. An instance of a listener can be added to only one source.

	@param [in] pListener Pointer to a @ref VideoStream::NewFrameListener object (or a derivative) that will respond to this event.
	@returns Status code indicating success or failure of the operation.
	*/
	Status addNewFrameListener(NewFrameListener* pListener)
	{
		if (!isValid())
		{
			return STATUS_ERROR;
		}

		return (Status)oniStreamRegisterNewFrameCallback(m_stream, pListener->callback, pListener, &pListener->m_callbackHandle);
	}

"An instance of a listener can be added to only one source."

So I'm not sure if this approach would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant