13 #ifndef __NVDSINFERSERVER_I_OPTIONS_H__
14 #define __NVDSINFERSERVER_I_OPTIONS_H__
23 #include <type_traits>
39 #define OPTION_SEQUENCE_ID "sequence_id" // uint64_t
40 #define OPTION_SEQUENCE_START "sequence_start" // bool
41 #define OPTION_SEQUENCE_END "sequence_end" // bool
42 #define OPTION_PRIORITY "priority" // uint64_t
43 #define OPTION_TIMEOUT "timeout_ms" // uint64_t
44 #define OPTION_NVDS_UNIQUE_ID "nvds_unique_id" // int64_t
45 #define OPTION_NVDS_SREAM_IDS "nvds_stream_ids" // source_id list, vector<uint64_t>
46 #define OPTION_NVDS_FRAME_META_LIST "nvds_frame_meta_list" // vector<NvDsFrameMeta*>
47 #define OPTION_NVDS_OBJ_META_LIST "nvds_obj_meta_list" // vector<NvDsObjectMeta*>
48 #define OPTION_NVDS_BATCH_META "nvds_batch_meta" // NvDsBatchMeta*
49 #define OPTION_NVDS_GST_BUFFER "nvds_gst_buffer" // GstBuffer*
50 #define OPTION_NVDS_BUF_SURFACE "nvds_buf_surface" // NvBufSurface*
51 #define OPTION_NVDS_BUF_SURFACE_PARAMS_LIST "nvds_buf_surface_params_list" // vector<NvBufSurfaceParams*>
52 #define OPTION_TIMESTAMP "timestamp" // uint64_t timestamp nano seconds
58 virtual bool hasValue(
const std::string& key)
const = 0;
60 virtual uint32_t
getCount()
const = 0;
61 virtual std::string
getKey(uint32_t idx)
const = 0;
65 const std::string& name,
OptionType t,
void*& ptr)
const = 0;
68 const std::string& name,
OptionType ot,
void** ptrBase, uint32_t size)
const = 0;
70 template <OptionType V>
74 template <
typename Value>
80 return getValue<double>(name, v);
84 return getValue<int64_t>(name, v);
88 return getValue<uint64_t>(name, v);
92 return getValue<std::string>(name, v);
96 return getValue<bool>(name, v);
98 template <
typename Obj>
101 return getValue<Obj*>(name, obj);
104 template <
typename Value>
107 using ValueType = std::remove_const_t<Value>;
113 value = *
reinterpret_cast<ValueType*
>(ptr);
118 template <
typename Value>
121 using ValueType = std::remove_const_t<Value>;
128 std::vector<ValueType*> valuePtrs(size);
129 void** ptrBase =
reinterpret_cast<void**
>(valuePtrs.data());
134 for (uint32_t i = 0; i < size; ++i) {
135 values[i] = *valuePtrs[i];
142 template <OptionType v>
145 template <
typename Value>
166 #endif // __NVDSINFERSERVER_I_OPTIONS_H__