[orx-realsense2] Add timeOut parameter to Sensor.waitForFrames
This commit is contained in:
@@ -142,7 +142,7 @@ abstract class Sensor {
|
|||||||
/**
|
/**
|
||||||
* wait for frames to arrives
|
* wait for frames to arrives
|
||||||
*/
|
*/
|
||||||
abstract fun waitForFrames()
|
abstract fun waitForFrames(timeOut: Int = 15000)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* destroy the sensor
|
* destroy the sensor
|
||||||
@@ -153,7 +153,7 @@ abstract class Sensor {
|
|||||||
class DummySensor : Sensor() {
|
class DummySensor : Sensor() {
|
||||||
override val serial: String = "DummySensor-${System.identityHashCode(this)}"
|
override val serial: String = "DummySensor-${System.identityHashCode(this)}"
|
||||||
|
|
||||||
override fun waitForFrames() {
|
override fun waitForFrames(timeOut: Int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun destroy() {
|
override fun destroy() {
|
||||||
@@ -179,9 +179,9 @@ class RS2Sensor(
|
|||||||
serial
|
serial
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun waitForFrames() {
|
override fun waitForFrames(timeOut: Int) {
|
||||||
val error = rs2_error()
|
val error = rs2_error()
|
||||||
val frames = rs2_pipeline_wait_for_frames(pipeline, RS2_DEFAULT_TIMEOUT, error)
|
val frames = rs2_pipeline_wait_for_frames(pipeline, timeOut, error)
|
||||||
error.check()
|
error.check()
|
||||||
|
|
||||||
val frameCount = rs2_embedded_frames_count(frames, error)
|
val frameCount = rs2_embedded_frames_count(frames, error)
|
||||||
|
|||||||
Reference in New Issue
Block a user