|
NVIDIA DeepStream SDK API Reference
|
6.4 Release
|
Go to the documentation of this file.
23 #ifndef __NVDS_SEQ_PREPROCESS_COMMON_H__
24 #define __NVDS_SEQ_PREPROCESS_COMMON_H__
32 #include <condition_variable>
44 #include <unordered_map>
48 #include "nvdspreprocess_interface.h"
51 #define CUSTOM_CONFIG_SUBSAMPLE "subsample"
52 #define CUSTOM_CONFIG_STRIDE "stride"
53 #define CUSTOM_CONFIG_CHANNEL_SCALE_FACTORS "channel-scale-factors"
54 #define CUSTOM_CONFIG_CHANNEL_MEANS "channel-mean-offsets"
57 #define DSASSERT assert
60 #define UNUSED(var) (void)(var)
65 #define LOG_PRINT_(out, level, fmt, ...) \
66 fprintf(out, "%s:%d, [%s: CUSTOM_LIB] " fmt "\n", __FILE__, __LINE__, #level, ##__VA_ARGS__)
68 #define LOG_DEBUG(fmt, ...) \
70 LOG_PRINT_(stdout, DEBUG, fmt, ##__VA_ARGS__); \
73 #define LOG_INFO(fmt, ...) LOG_PRINT_(stdout, INFO, fmt, ##__VA_ARGS__)
75 #define LOG_ERROR(fmt, ...) LOG_PRINT_(stderr, ERROR, fmt, ##__VA_ARGS__)
78 #define CHECK_PROCESS_ERROR(err, fmt, ...) \
80 NvDsPreProcessStatus _sno_ = (err); \
81 if (_sno_ != NVDSPREPROCESS_SUCCESS) { \
82 LOG_ERROR(fmt ", seq_process error: %d", ##__VA_ARGS__, (int)_sno_); \
88 #define CHECK_CUDA_ERR(err, fmt, ...) \
90 cudaError_t _errnum_ = (err); \
91 if (_errnum_ != cudaSuccess) { \
93 fmt ", cuda err_no: %d, err_str: %s", ##__VA_ARGS__, (int)_errnum_, \
94 cudaGetErrorName(_errnum_)); \
95 return NVDSPREPROCESS_CUDA_ERROR; \
100 #define PROCESS_EXPORT_API __attribute__((__visibility__("default")))
103 #define NVDSPREPROCESS_SKIP_FRAME (NvDsPreProcessStatus)255
106 #define FRAME_NO_NOT_SET UINT64_MAX
109 using SourceKey = std::tuple<uint64_t, int64_t, int64_t>;
160 using SrcDestBufMap = std::map<SourceKey, std::unique_ptr<RoiProcessedBuf>>;
164 using UniqPtr = std::unique_ptr<T, std::function<void(T*)>>;
166 #endif // __NVDS_SEQ_PREPROCESS_COMMON_H__
@ NvDsPreProcessFormat_RGB
Specifies 24-bit interleaved R-G-B format.
std::unique_ptr< T, std::function< void(T *)> > UniqPtr
NvDsPreProcessTensorParams param
NvDsPreProcessUnit latestUnit
A preprocess unit for processing which can be Frame/ROI.
NvDsPreProcessTensorParams param
NvDsPreProcessCustomBuf * readyBuf
NvDsPreProcessCustomBuf * buf
Custom Buffer passed to the custom lib for preparing tensor.
uint64_t nextReadyFrameNo
Holds model parameters for tensor preparation.
std::tuple< uint64_t, int64_t, int64_t > SourceKey
std::map< SourceKey, std::unique_ptr< RoiProcessedBuf > > SrcDestBufMap
std::vector< NvDsRoiMeta > rois
@ NvDsPreProcessNetworkInputOrder_CUSTOM
Specifies any other custom input order handled by custom lib.