16 #ifndef __NVDSINFERSERVER_I_OPTIONS_H__
17 #define __NVDSINFERSERVER_I_OPTIONS_H__
26 #include <type_traits>
42 #define OPTION_SEQUENCE_ID "sequence_id" // uint64_t
43 #define OPTION_SEQUENCE_START "sequence_start" // bool
44 #define OPTION_SEQUENCE_END "sequence_end" // bool
45 #define OPTION_PRIORITY "priority" // uint64_t
46 #define OPTION_TIMEOUT "timeout_ms" // uint64_t
47 #define OPTION_NVDS_UNIQUE_ID "nvds_unique_id" // int64_t
48 #define OPTION_NVDS_SREAM_IDS "nvds_stream_ids" // source_id list, vector<uint64_t>
49 #define OPTION_NVDS_FRAME_META_LIST "nvds_frame_meta_list" // vector<NvDsFrameMeta*>
50 #define OPTION_NVDS_OBJ_META_LIST "nvds_obj_meta_list" // vector<NvDsObjectMeta*>
51 #define OPTION_NVDS_BATCH_META "nvds_batch_meta" // NvDsBatchMeta*
52 #define OPTION_NVDS_GST_BUFFER "nvds_gst_buffer" // GstBuffer*
53 #define OPTION_NVDS_BUF_SURFACE "nvds_buf_surface" // NvBufSurface*
54 #define OPTION_NVDS_BUF_SURFACE_PARAMS_LIST "nvds_buf_surface_params_list" // vector<NvBufSurfaceParams*>
55 #define OPTION_TIMESTAMP "timestamp" // uint64_t timestamp nano seconds
61 virtual bool hasValue(
const std::string& key)
const = 0;
63 virtual uint32_t
getCount()
const = 0;
64 virtual std::string
getKey(uint32_t idx)
const = 0;
68 const std::string& name,
OptionType t,
void*& ptr)
const = 0;
71 const std::string& name,
OptionType ot,
void** ptrBase, uint32_t size)
const = 0;
73 template <OptionType V>
77 template <
typename Value>
83 return getValue<double>(name, v);
87 return getValue<int64_t>(name, v);
91 return getValue<uint64_t>(name, v);
95 return getValue<std::string>(name, v);
99 return getValue<bool>(name, v);
101 template <
typename Obj>
104 return getValue<Obj*>(name, obj);
107 template <
typename Value>
110 using ValueType = std::remove_const_t<Value>;
116 value = *
reinterpret_cast<ValueType*
>(ptr);
121 template <
typename Value>
124 using ValueType = std::remove_const_t<Value>;
131 std::vector<ValueType*> valuePtrs(size);
132 void** ptrBase =
reinterpret_cast<void**
>(valuePtrs.data());
137 for (uint32_t i = 0; i < size; ++i) {
138 values[i] = *valuePtrs[i];
145 template <OptionType v>
148 template <
typename Value>
169 #endif // __NVDSINFERSERVER_I_OPTIONS_H__