12 #ifndef __NVDSINFERSERVER_I_OPTIONS_H__
13 #define __NVDSINFERSERVER_I_OPTIONS_H__
22 #include <type_traits>
38 #define OPTION_SEQUENCE_ID "sequence_id" // uint64_t
39 #define OPTION_SEQUENCE_START "sequence_start" // bool
40 #define OPTION_SEQUENCE_END "sequence_end" // bool
41 #define OPTION_PRIORITY "priority" // uint64_t
42 #define OPTION_TIMEOUT "timeout_ms" // uint64_t
43 #define OPTION_NVDS_UNIQUE_ID "nvds_unique_id" // int64_t
44 #define OPTION_NVDS_SREAM_IDS "nvds_stream_ids" // source_id list, vector<uint64_t>
45 #define OPTION_NVDS_FRAME_META_LIST "nvds_frame_meta_list" // vector<NvDsFrameMeta*>
46 #define OPTION_NVDS_OBJ_META_LIST "nvds_obj_meta_list" // vector<NvDsObjectMeta*>
47 #define OPTION_NVDS_BATCH_META "nvds_batch_meta" // NvDsBatchMeta*
48 #define OPTION_NVDS_GST_BUFFER "nvds_gst_buffer" // GstBuffer*
49 #define OPTION_NVDS_BUF_SURFACE "nvds_buf_surface" // NvBufSurface*
50 #define OPTION_NVDS_BUF_SURFACE_PARAMS_LIST "nvds_buf_surface_params_list" // vector<NvBufSurfaceParams*>
51 #define OPTION_TIMESTAMP "timestamp" // uint64_t timestamp nano seconds
57 virtual bool hasValue(
const std::string& key)
const = 0;
59 virtual uint32_t
getCount()
const = 0;
60 virtual std::string
getKey(uint32_t idx)
const = 0;
64 const std::string& name,
OptionType t,
void*& ptr)
const = 0;
67 const std::string& name,
OptionType ot,
void** ptrBase, uint32_t size)
const = 0;
69 template <OptionType V>
73 template <
typename Value>
79 return getValue<double>(name, v);
83 return getValue<int64_t>(name, v);
87 return getValue<uint64_t>(name, v);
91 return getValue<std::string>(name, v);
95 return getValue<bool>(name, v);
97 template <
typename Obj>
100 return getValue<Obj*>(name, obj);
103 template <
typename Value>
106 using ValueType = std::remove_const_t<Value>;
112 value = *
reinterpret_cast<ValueType*
>(ptr);
117 template <
typename Value>
120 using ValueType = std::remove_const_t<Value>;
127 std::vector<ValueType*> valuePtrs(size);
128 void** ptrBase =
reinterpret_cast<void**
>(valuePtrs.data());
133 for (uint32_t i = 0; i < size; ++i) {
134 values[i] = *valuePtrs[i];
141 template <OptionType v>
144 template <
typename Value>
165 #endif // __NVDSINFERSERVER_I_OPTIONS_H__