test-non-realtime.py
Go to the documentation of this file.
1 # License: Apache 2.0. See LICENSE file in root directory.
2 # Copyright(c) 2021 Intel Corporation. All Rights Reserved.
3 
4 #test:timeout 20
5 
6 import os
7 import pyrealsense2 as rs2
8 from rspy import test
9 import tempfile
10 
11 # This test checks that stop of pipeline with playback file
12 # and non realtime mode is not stuck due to deadlock of
13 # pipeline stop thread and syncer blocking enqueue thread (DSO-15157)
14 #############################################################################################
15 test.start("Playback with non realtime isn't stuck at stop")
16 
17 filename = tempfile.gettempdir() + os.sep + 'recording_deadlock.bag'
18 
19 pipeline = rs2.pipeline()
20 config = rs2.config()
21 config.enable_all_streams()
22 config.enable_device_from_file(filename, repeat_playback=False)
23 profile = pipeline.start(config)
24 device = profile.get_device().as_playback().set_real_time(False)
25 success = True
26 while success:
27  success, _ = pipeline.try_wait_for_frames(1000)
28 print("stopping...")
29 pipeline.stop()
30 print("stopped")
31 
33 #############################################################################################
34 
35 test.print_results_and_exit()
static std::string print(const transformation &tf)
virtual frame finish(frame f)


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:11