NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef DS3D_DATAMIXER_MULTISENSOR_CONFIG_H
19 #define DS3D_DATAMIXER_MULTISENSOR_CONFIG_H
20 
21 #include <ds3d/common/common.h>
22 #include <ds3d/common/func_utils.h>
23 
24 #include "ds3d/common/hpp/yaml_config.hpp"
25 
26 namespace ds3d { namespace impl { namespace mixer {
27 
28 constexpr const float kMultiSensorMixerDefaultFrameRate = 30.0;
29 constexpr const double kSToNas = 1000000000.0;
30 constexpr const double kMsToNas = 1000000.0;
31 constexpr const double kUsToNas = 1000.0;
32 constexpr const double kNasToMs = (1.0 / 1000000.0);
34 constexpr const bool kMultiSensorMixerDefaultForceSync = true;
35 
36 struct Config {
40 };
41 
42 inline ErrCode
43 parseConfig(const std::string& content, const std::string& path, Config& config)
44 {
46  config::parseComponentConfig(content, path, config.compConfig), "parse dataloader component content failed");
47  YAML::Node node = YAML::Load(config.compConfig.configBody);
48  auto yFrameTimeout = node["timeout"];
49  auto yForceSync = node["force_sync"];
50 
51  if (yFrameTimeout) {
52  config.frameTimeout = yFrameTimeout.as<double>() * kMsToNas;
53  }
54  if (yForceSync) {
55  config.forceSync = yForceSync.as<bool>();
56  }
57  return ErrCode::kGood;
58 }
59 
60 
61 }}} // namespace ds3d::impl::mixer
62 
63 #endif // DS3D_DATAMIXER_MULTISENSOR_CONFIG_H
ds3d::impl::mixer::kSToNas
constexpr const double kSToNas
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:29
ds3d::impl::mixer::parseConfig
ErrCode parseConfig(const std::string &content, const std::string &path, Config &config)
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:43
ds3d::ErrCode::kGood
@ kGood
ds3d::config::parseComponentConfig
ErrCode parseComponentConfig(const std::string &yamlComp, const std::string &path, ComponentConfig &config)
Definition: includes/ds3d/common/hpp/yaml_config.hpp:57
ds3d::impl::mixer::kMultiSensorMixerDefaultForceSync
constexpr const bool kMultiSensorMixerDefaultForceSync
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:34
ds3d::ErrCode
ErrCode
Definition: includes/ds3d/common/common.h:47
ds3d::impl::mixer::kMsToNas
constexpr const double kMsToNas
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:30
ds3d::impl::mixer::Config::compConfig
config::ComponentConfig compConfig
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:37
ds3d::impl::mixer::kMultiSensorMixerDefaultFrameRate
constexpr const float kMultiSensorMixerDefaultFrameRate
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:28
ds3d::impl::mixer::kMultiSensorMixerDefaultFrameTimeout
constexpr const double kMultiSensorMixerDefaultFrameTimeout
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:33
ds3d::impl::mixer::Config
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:36
ds3d::config::ComponentConfig::configBody
std::string configBody
Definition: includes/ds3d/common/config.h:48
ds3d::impl::mixer::Config::forceSync
bool forceSync
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:39
DS3D_ERROR_RETURN
#define DS3D_ERROR_RETURN(code, fmt,...)
Definition: includes/ds3d/common/defines.h:77
ds3d::config::ComponentConfig
Definition: includes/ds3d/common/config.h:38
ds3d
Definition: includes/ds3d/common/abi_dataprocess.h:25
ds3d::impl::mixer::Config::frameTimeout
double frameTimeout
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:38
ds3d::impl::mixer::kNasToMs
constexpr const double kNasToMs
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:32
ds3d::impl::mixer::kUsToNas
constexpr const double kUsToNas
Definition: sources/libs/ds3d/datamixer/multisensor/multisensor_mixer_config.h:31