Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Pol_P_
Beginner
58 Views

C# - SenseManager.StreamFrames(false) is not stopped by SenseManager.Close()

Hi, 

I observed that when I use StreamFrames with a false flag my programs get stuck when I try to stop streaming frames.

According to the documentation StreamFrames method in SenseManager takes a boolean; true for blocking and false for non-blocking.

I am starting my stream like this:

_senseManager.StreamFrames(false);

and to stop it I call:

_senseManager.Close();
_senseManager.Dispose()

This hangs the program when the Close method is called.

However, if I create a new Thread and I call StreamFrames with a true flag everything works fine when I call Close and Dispose.

Something like this works fine:

Task.Factory.StartNew(() => { _senseManager.StreamFrames(true); });

Is this normal? Am I doing something wrong? I would like to call the non-blocking version of StreamFrames but also be able to Close it.

Thanks,

0 Kudos
5 Replies
samontab
Valued Contributor II
58 Views

This video may be of help. It explains how to access the raw frames in both modes:

https://www.youtube.com/watch?v=wIkIdjN6Oyw

Pol_P_
Beginner
58 Views

As I understand, my approach is exactly the same as the one proposed in the video.

The only difference I can see is that the video is using C++ instead of C#. This shouldn't make a difference however...

Thanks,

samontab
Valued Contributor II
58 Views

Pol P. wrote:

As I understand, my approach is exactly the same as the one proposed in the video.

The only difference I can see is that the video is using C++ instead of C#. This shouldn't make a difference however...

Thanks,

Double check the function names though. I remember there were a bit different in different languages. Something like Close in C++ vs CloseDown in C#, or something similar. Or maybe they changed that now.

Pol_P_
Beginner
58 Views

I just looked up the documentation and the function you have to call is called Close (same as in C++).

Here:

https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/streamfram...

Thanks,

samontab
Valued Contributor II
58 Views

OK. If you did everything right there might be a bug in the C# implementation...

I guess Intel guys would need to have a sample code to check for this.

Reply