|
NVIDIA DeepStream SDK API Reference
|
7.1 Release
|
Go to the documentation of this file.
13 #ifndef __NVDS_SEQ_PREPROCESS_COMMON_H__
14 #define __NVDS_SEQ_PREPROCESS_COMMON_H__
22 #include <condition_variable>
34 #include <unordered_map>
38 #include "nvdspreprocess_interface.h"
41 #define CUSTOM_CONFIG_SUBSAMPLE "subsample"
42 #define CUSTOM_CONFIG_STRIDE "stride"
43 #define CUSTOM_CONFIG_CHANNEL_SCALE_FACTORS "channel-scale-factors"
44 #define CUSTOM_CONFIG_CHANNEL_MEANS "channel-mean-offsets"
47 #define DSASSERT assert
50 #define UNUSED(var) (void)(var)
55 #define LOG_PRINT_(out, level, fmt, ...) \
56 fprintf(out, "%s:%d, [%s: CUSTOM_LIB] " fmt "\n", __FILE__, __LINE__, #level, ##__VA_ARGS__)
58 #define LOG_DEBUG(fmt, ...) \
60 LOG_PRINT_(stdout, DEBUG, fmt, ##__VA_ARGS__); \
63 #define LOG_INFO(fmt, ...) LOG_PRINT_(stdout, INFO, fmt, ##__VA_ARGS__)
65 #define LOG_ERROR(fmt, ...) LOG_PRINT_(stderr, ERROR, fmt, ##__VA_ARGS__)
68 #define CHECK_PROCESS_ERROR(err, fmt, ...) \
70 NvDsPreProcessStatus _sno_ = (err); \
71 if (_sno_ != NVDSPREPROCESS_SUCCESS) { \
72 LOG_ERROR(fmt ", seq_process error: %d", ##__VA_ARGS__, (int)_sno_); \
78 #define CHECK_CUDA_ERR(err, fmt, ...) \
80 cudaError_t _errnum_ = (err); \
81 if (_errnum_ != cudaSuccess) { \
83 fmt ", cuda err_no: %d, err_str: %s", ##__VA_ARGS__, (int)_errnum_, \
84 cudaGetErrorName(_errnum_)); \
85 return NVDSPREPROCESS_CUDA_ERROR; \
90 #define PROCESS_EXPORT_API __attribute__((__visibility__("default")))
93 #define NVDSPREPROCESS_SKIP_FRAME (NvDsPreProcessStatus)255
96 #define FRAME_NO_NOT_SET UINT64_MAX
99 using SourceKey = std::tuple<uint64_t, int64_t, int64_t>;
150 using SrcDestBufMap = std::map<SourceKey, std::unique_ptr<RoiProcessedBuf>>;
154 using UniqPtr = std::unique_ptr<T, std::function<void(T*)>>;
156 #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.