NVIDIA DeepStream SDK API Reference

9.1 Release
sources/libs/nvstreammux/include/MuxConfigParser.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-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 __GST_NVSTREAMMUX_PROPERTY_PARSER_H__
19 #define __GST_NVSTREAMMUX_PROPERTY_PARSER_H__
20 
21 #include <glib.h>
22 #include <unordered_map>
23 #include "nvstreammux_batch.h"
24 #include <yaml-cpp/yaml.h>
25 
30 static guint constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_SIZE = 1;
31 static gboolean constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_ADAPTIVE_BATCHING = TRUE;
32 static gboolean constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_ENABLE_SOURCE_CONTROL = FALSE;
33 static gboolean constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_MAX_FPS_CONTROL = FALSE;
39 
41 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_N = 60;
42 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_D = 1;
43 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_N = 30;
44 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_D = 1;
45 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_PRIORITY = 0;
47 
58 {
59  public:
60 
63 
64  bool SetConfigFile(gchar const * const cfgFilePath);
65 
76  bool ParseConfigs(BatchPolicyConfig* batchPolicy, bool defaults=false, guint numSources=1);
77 
78  private:
79 
80  void ParseTxtConfigCommonProps(BatchPolicyConfig* batchPolicy, gchar* group, GKeyFile* keyFile);
81 
82  bool ParseTxtConfigPerSourceProps(NvStreammuxSourceProps* sourceProps, gchar* group, GKeyFile* keyFile);
83 
84  bool ParseTxtConfig(BatchPolicyConfig* batchPolicy);
85 
86  void ParseYmlConfigCommonProps(BatchPolicyConfig* batchPolicy, std::string group);
87 
88  bool ParseYmlConfigPerSourceProps(NvStreammuxSourceProps* sourceProps, std::string group);
89 
90  bool ParseYmlConfig(BatchPolicyConfig* batchPolicy);
91 
92  gchar* cfgFile;
93 };
94 
95 #endif /*__GST_NVSTREAMMUX_PROPERTY_PARSER_H__*/
NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_SIZE
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_SIZE
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:30
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_PRIORITY
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_PRIORITY
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:45
NVSTREAMMUX_DEFAULT_PROP_GROUP_MAX_FPS_CONTROL
static constexpr gboolean NVSTREAMMUX_DEFAULT_PROP_GROUP_MAX_FPS_CONTROL
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:33
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_N
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:34
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_N
Defaults for SOURCE_GROUP.
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:41
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_N
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:43
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FRAMES_PER_BATCH
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FRAMES_PER_BATCH
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:46
MuxConfigParser
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:57
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_N
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:36
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_D
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:42
MuxConfigParser::MuxConfigParser
MuxConfigParser()
BATCH_METHOD_ROUND_ROBIN
@ BATCH_METHOD_ROUND_ROBIN
Definition: sources/libs/nvstreammux/include/nvstreammux_batch.h:57
nvstreammux_batch.h
MuxConfigParser::~MuxConfigParser
~MuxConfigParser()
NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_METHOD_ALGO_TYPE
static constexpr NvStreammuxBatchMethod NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_METHOD_ALGO_TYPE
Defaults for PROP_GROUP.
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:29
NvStreammuxSourceProps
Definition: sources/libs/nvstreammux/include/nvstreammux_batch.h:44
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_D
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:35
MuxConfigParser::ParseConfigs
bool ParseConfigs(BatchPolicyConfig *batchPolicy, bool defaults=false, guint numSources=1)
Parse the Config file for per-source properties Note: For batch-size, if config unavailable in the fi...
NVSTREAMMUX_DEFAULT_PROP_GROUP_ENABLE_SOURCE_CONTROL
static constexpr gboolean NVSTREAMMUX_DEFAULT_PROP_GROUP_ENABLE_SOURCE_CONTROL
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:32
NVSTREAMMUX_DEFAULT_PROP_GROUP_ADAPTIVE_BATCHING
static constexpr gboolean NVSTREAMMUX_DEFAULT_PROP_GROUP_ADAPTIVE_BATCHING
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:31
NvStreammuxBatchMethod
NvStreammuxBatchMethod
Definition: sources/libs/nvstreammux/include/nvstreammux_batch.h:54
BatchPolicyConfig
Definition: sources/libs/nvstreammux/include/nvstreammux_batch.h:61
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_D
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:44
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_SAME_SOURCE_FRAMES
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_SAME_SOURCE_FRAMES
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:38
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_D
Definition: sources/libs/nvstreammux/include/MuxConfigParser.h:37
MuxConfigParser::SetConfigFile
bool SetConfigFile(gchar const *const cfgFilePath)