NVIDIA DeepStream SDK API Reference

7.1 Release
MuxConfigParser.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef __GST_NVSTREAMMUX_PROPERTY_PARSER_H__
14 #define __GST_NVSTREAMMUX_PROPERTY_PARSER_H__
15 
16 #include <glib.h>
17 #include <unordered_map>
18 #include "nvstreammux_batch.h"
19 #include <yaml-cpp/yaml.h>
20 
25 static guint constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_SIZE = 1;
26 static gboolean constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_ADAPTIVE_BATCHING = TRUE;
27 static gboolean constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_ENABLE_SOURCE_CONTROL = FALSE;
28 static gboolean constexpr NVSTREAMMUX_DEFAULT_PROP_GROUP_MAX_FPS_CONTROL = FALSE;
34 
36 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_N = 60;
37 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_D = 1;
38 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_N = 30;
39 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_D = 1;
40 static guint constexpr NVSTREAMMUX_DEFAULT_SOURCE_GROUP_PRIORITY = 0;
42 
53 {
54  public:
55 
58 
59  bool SetConfigFile(gchar const * const cfgFilePath);
60 
71  bool ParseConfigs(BatchPolicyConfig* batchPolicy, bool defaults=false, guint numSources=1);
72 
73  private:
74 
75  void ParseTxtConfigCommonProps(BatchPolicyConfig* batchPolicy, gchar* group, GKeyFile* keyFile);
76 
77  bool ParseTxtConfigPerSourceProps(NvStreammuxSourceProps* sourceProps, gchar* group, GKeyFile* keyFile);
78 
79  bool ParseTxtConfig(BatchPolicyConfig* batchPolicy);
80 
81  void ParseYmlConfigCommonProps(BatchPolicyConfig* batchPolicy, std::string group);
82 
83  bool ParseYmlConfigPerSourceProps(NvStreammuxSourceProps* sourceProps, std::string group);
84 
85  bool ParseYmlConfig(BatchPolicyConfig* batchPolicy);
86 
87  gchar* cfgFile;
88 };
89 
90 #endif /*__GST_NVSTREAMMUX_PROPERTY_PARSER_H__*/
NVSTREAMMUX_DEFAULT_PROP_GROUP_ENABLE_SOURCE_CONTROL
static constexpr gboolean NVSTREAMMUX_DEFAULT_PROP_GROUP_ENABLE_SOURCE_CONTROL
Definition: MuxConfigParser.h:27
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FRAMES_PER_BATCH
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FRAMES_PER_BATCH
Definition: MuxConfigParser.h:41
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_N
Definition: MuxConfigParser.h:31
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_D
Definition: MuxConfigParser.h:39
NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_SIZE
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_SIZE
Definition: MuxConfigParser.h:25
MuxConfigParser
Definition: MuxConfigParser.h:52
NvStreammuxBatchMethod
NvStreammuxBatchMethod
Definition: nvstreammux_batch.h:49
NVSTREAMMUX_DEFAULT_PROP_GROUP_MAX_FPS_CONTROL
static constexpr gboolean NVSTREAMMUX_DEFAULT_PROP_GROUP_MAX_FPS_CONTROL
Definition: MuxConfigParser.h:28
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_N
Defaults for SOURCE_GROUP.
Definition: MuxConfigParser.h:36
MuxConfigParser::MuxConfigParser
MuxConfigParser()
MuxConfigParser::~MuxConfigParser
~MuxConfigParser()
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_PRIORITY
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_PRIORITY
Definition: MuxConfigParser.h:40
NvStreammuxSourceProps
Definition: nvstreammux_batch.h:39
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MAX_FPS_D
Definition: MuxConfigParser.h:37
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_OVERALL_MAX_SAME_SOURCE_FRAMES
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_SAME_SOURCE_FRAMES
Definition: MuxConfigParser.h:33
NVSTREAMMUX_DEFAULT_PROP_GROUP_ADAPTIVE_BATCHING
static constexpr gboolean NVSTREAMMUX_DEFAULT_PROP_GROUP_ADAPTIVE_BATCHING
Definition: MuxConfigParser.h:26
BATCH_METHOD_ROUND_ROBIN
@ BATCH_METHOD_ROUND_ROBIN
Definition: nvstreammux_batch.h:52
nvstreammux_batch.h
NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_METHOD_ALGO_TYPE
static constexpr NvStreammuxBatchMethod NVSTREAMMUX_DEFAULT_PROP_GROUP_BATCH_METHOD_ALGO_TYPE
Defaults for PROP_GROUP.
Definition: MuxConfigParser.h:24
BatchPolicyConfig
Definition: nvstreammux_batch.h:56
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_N
Definition: MuxConfigParser.h:29
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MAX_FPS_D
Definition: MuxConfigParser.h:30
NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_N
static constexpr guint NVSTREAMMUX_DEFAULT_SOURCE_GROUP_MIN_FPS_N
Definition: MuxConfigParser.h:38
MuxConfigParser::SetConfigFile
bool SetConfigFile(gchar const *const cfgFilePath)
NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_D
static constexpr guint NVSTREAMMUX_DEFAULT_PROP_GROUP_OVERALL_MIN_FPS_D
Definition: MuxConfigParser.h:32