C# D400 playback - delay in Pausing stream
I have been developing an application in C# to capture depth & optical frames from D435 sensor and recording in *.bag files as shared in the sample code in git repos.
The issue I'm facing is during the playback of recorded files. While executing the Pause() Api - it takes like 10 seconds to pause the playback stream. Not sure whats causing the delay.

-
In the SDK's C# documentation for playback, they use an instruction called Task.Delay to specify how many milliseconds the program should wait before executing the instruction on the next line. To quote from the example:
await Task.Delay(500);
playback.Pause();So the program is apparently being asked to wait 500 milliseconds (half a second) before executing the pause instruction.
Does it make any difference if you insert a similar delay instruction directly before your pause instruction, please?
If that doesn't work, the delay may be occurring with IsPauseRequested (a bool?) becoming True and allowing the pause instruction to execute. You could tell if this was the cause by having a debug log readout about the current state of IsPauseRequested (whether it is currently true or false). If it stays False for 10 seconds after the pause is requested and then becomes True, this may be the source of the problem.
Please sign in to leave a comment.
Comments
1 comment