@@ -262,13 +262,7 @@ bool init_device(
262262 }
263263 }
264264
265- // device support listener
266- g_device_support_listener = std::unique_ptr<DeviceSupportListener>(new DeviceSupportListener);
267265
268- g_device_support_listener->observe (
269- *g_xlink.get (),
270- c_streams_myriad_to_pc.at (" meta_d2h" )
271- );
272266
273267
274268 result = true ;
@@ -424,6 +418,8 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
424418 json_config_obj[" ai" ][" calc_dist_to_bb" ] = config.ai .calc_dist_to_bb ;
425419
426420 bool add_disparity_post_processing_color = false ;
421+ bool temp_measurement = false ;
422+
427423 std::vector<std::string> pipeline_device_streams;
428424
429425 for (const auto &stream : config.streams )
@@ -437,6 +433,10 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
437433 }
438434 else
439435 {
436+ if (stream.name == " meta_d2h" )
437+ {
438+ temp_measurement = true ;
439+ }
440440 json obj = { {" name" ,stream.name } };
441441
442442 if (!stream.data_type .empty ()) { obj[" data_type" ] = stream.data_type ; };
@@ -658,6 +658,18 @@ std::shared_ptr<CNNHostPipeline> create_pipeline(
658658 break ;
659659 }
660660 }
661+
662+ if (temp_measurement)
663+ {
664+ // device support listener
665+ g_device_support_listener = std::unique_ptr<DeviceSupportListener>(new DeviceSupportListener);
666+
667+ g_device_support_listener->observe (
668+ *g_xlink.get (),
669+ c_streams_myriad_to_pc.at (" meta_d2h" )
670+ );
671+ }
672+
661673 init_ok = true ;
662674 std::cout << " depthai: INIT OK!\n " ;
663675 }
0 commit comments