NVIDIA DeepStream SDK API Reference

7.0 Release
deepstream_can_context.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #ifndef DS_APP_DEEPSTREAM_CAN_CONTEXT_H
14 #define DS_APP_DEEPSTREAM_CAN_CONTEXT_H
15 
16 #include "gstnvdsmeta.h"
17 
18 #include <sstream>
19 #include <unistd.h>
20 
22 #include <ds3d/common/func_utils.h>
25 // inlucde nvds3d Gst header files
28 #include <ds3d/gst/nvds3d_meta.h>
29 #include <gst/gst.h>
30 
31 #define GST_CAPS_FEATURES_NVMM "memory:NVMM"
32 
33 const uint32_t kNvDsCanResultMeta = (NVDS_GST_CUSTOM_META + 100);
34 
35 using namespace ds3d;
36 
37 enum class NvDsCanContextConfigType : int {
38  kConfigPath = 0,
39  kConfigContent = 1,
40 };
41 
43  void* buf;
44  size_t bufLen;
45  uint32_t fourcc; // GREY, RGBA
46  uint32_t width, height;
47 };
48 
50  float rotation; // normalized result
51 };
52 
53 enum class NvDsCanSrcType : int {
54  kNone = 0,
55  kUri,
56  kFrame,
58 };
59 
61  uint32_t fourcc = 0;
62  uint32_t height = 0;
63  uint32_t width = 0;
64 };
65 
67  std::string devSN; // Basler Camera Device Serial Number
68  std::string pfsPath; // PFS location
69  uint32_t height = 0;
70  uint32_t width = 0;
71  std::string format = "GRAY8";
72 };
73 
76 
77  std::string srcUri;
80  std::string srcFrameRate;
81 
82  uint32_t muxWidth = 1280, muxHeight = 720;
83  int32_t muxBatchTimeout = 40000;
84 
85  std::string templateCustomLibName;
87 
88  std::string inferConfig;
89  uint32_t debugLevel = 0;
90  bool printRes = true;
91  bool enableEglSink = false;
92  bool syncDisplay = true;
93 };
94 
95 #define NVDS_MAKE_FOURCC(c0, c1, c2, c3) \
96  ((uint32_t)(c0) | ((uint32_t)(c1)) << 8 | ((uint32_t)(c2)) << 16 | ((uint32_t)(c3)) << 24)
97 
98 
99 const uint32_t NvDsCanFormatRGBA = NVDS_MAKE_FOURCC('R', 'G', 'B', 'A');
100 const uint32_t NvDsCanFormatGREY = NVDS_MAKE_FOURCC('G', 'R', 'E', 'Y');
101 
102 typedef void (*NvDsCanContextTaskQuitCb)(void* usrData);
103 
104 class DsCanContext;
105 
107 
109  NvDsCanContextConfig* config, const char* str, uint32_t len, NvDsCanContextConfigType type);
111 NvDs_CanContextCreate(DsCanContext** ctx, const NvDsCanContextConfig* config);
113 NvDs_CanContextStart(DsCanContext* ctx, NvDsCanContextTaskQuitCb cb, void* usrData);
115  DsCanContext* ctx, const NvDsCanContextFrame* frame, NvDsCanContextResultMeta* res);
116 DS3D_EXPORT_API bool NvDs_CanContextIsRunning(DsCanContext* ctx);
117 DS3D_EXPORT_API ErrCode NvDs_CanContextStop(DsCanContext* ctx);
119 
121 
122 #endif // DS_APP_DEEPSTREAM_CAN_CONTEXT_H
yaml_config.hpp
NvDs_CanContextParseConfig
DS3D_EXTERN_C_BEGIN DS3D_EXPORT_API ErrCode NvDs_CanContextParseConfig(NvDsCanContextConfig *config, const char *str, uint32_t len, NvDsCanContextConfigType type)
NvDsCanContextConfig::srcFrameInfo
NvDsCanFrameInfo srcFrameInfo
Definition: deepstream_can_context.hpp:79
NVDS_MAKE_FOURCC
#define NVDS_MAKE_FOURCC(c0, c1, c2, c3)
Definition: deepstream_can_context.hpp:95
NvDsCanContextFrame
Definition: deepstream_can_context.hpp:42
nvds3d_gst_plugin.h
NvDsCanContextConfig::cameraInfo
NvDsCanCameraInfo cameraInfo
Definition: deepstream_can_context.hpp:78
NvDsCanFormatRGBA
const uint32_t NvDsCanFormatRGBA
Definition: deepstream_can_context.hpp:99
NvDsCanContextFrame::bufLen
size_t bufLen
Definition: deepstream_can_context.hpp:44
NvDs_CanContextCreate
DS3D_EXPORT_API ErrCode NvDs_CanContextCreate(DsCanContext **ctx, const NvDsCanContextConfig *config)
NvDsCanContextFrame::buf
void * buf
Definition: deepstream_can_context.hpp:43
NvDsCanFrameInfo
Definition: deepstream_can_context.hpp:60
NvDs_CanContextStart
DS3D_EXPORT_API ErrCode NvDs_CanContextStart(DsCanContext *ctx, NvDsCanContextTaskQuitCb cb, void *usrData)
DS3D_EXTERN_C_BEGIN
#define DS3D_EXTERN_C_BEGIN
Definition: defines.h:125
NvDsCanContextConfig::inferConfig
std::string inferConfig
Definition: deepstream_can_context.hpp:88
NvDs_CanContextProcessFrame
DS3D_EXPORT_API ErrCode NvDs_CanContextProcessFrame(DsCanContext *ctx, const NvDsCanContextFrame *frame, NvDsCanContextResultMeta *res)
ds3d::ErrCode
ErrCode
Definition: common.h:43
nvds3d_gst_ptr.h
NvDsCanContextFrame::fourcc
uint32_t fourcc
Definition: deepstream_can_context.hpp:45
NvDsCanContextResultMeta
Definition: deepstream_can_context.hpp:49
kNvDsCanResultMeta
const uint32_t kNvDsCanResultMeta
Definition: deepstream_can_context.hpp:33
DS3D_EXTERN_C_END
#define DS3D_EXTERN_C_END
Definition: defines.h:126
gstnvdsmeta.h
NvDsCanFormatGREY
const uint32_t NvDsCanFormatGREY
Definition: deepstream_can_context.hpp:100
NvDsCanContextConfig::srcUri
std::string srcUri
Definition: deepstream_can_context.hpp:77
NvDsCanContextFrame::width
uint32_t width
Definition: deepstream_can_context.hpp:46
NvDsCanContextConfigType
NvDsCanContextConfigType
Definition: deepstream_can_context.hpp:37
NvDsCanCameraInfo
Definition: deepstream_can_context.hpp:66
NvDsCanContextConfig::templateCustomLibProps
std::string templateCustomLibProps
Definition: deepstream_can_context.hpp:86
NvDs_CanContextIsRunning
DS3D_EXPORT_API bool NvDs_CanContextIsRunning(DsCanContext *ctx)
nvds3d_meta.h
NvDsCanContextResultMeta::rotation
float rotation
Definition: deepstream_can_context.hpp:50
NvDsCanContextConfigType::kConfigContent
@ kConfigContent
nvdsinferserver::InferTensorOrder::kNone
@ kNone
NvDsCanContextTaskQuitCb
void(* NvDsCanContextTaskQuitCb)(void *usrData)
Definition: deepstream_can_context.hpp:102
NvDsCanContextConfig::templateCustomLibName
std::string templateCustomLibName
Definition: deepstream_can_context.hpp:85
NVDS_GST_CUSTOM_META
@ NVDS_GST_CUSTOM_META
Specifies the start of a range of enum values that represent types of NVIDIA-defined Gst metas.
Definition: nvdsmeta.h:170
NvDsCanSrcType::kBaslerCamera
@ kBaslerCamera
NvDsCanContextConfigType::kConfigPath
@ kConfigPath
NvDsCanSrcType
NvDsCanSrcType
Definition: deepstream_can_context.hpp:53
NvDsCanCameraInfo::pfsPath
std::string pfsPath
Definition: deepstream_can_context.hpp:68
profiling.hpp
DS3D_EXPORT_API
#define DS3D_EXPORT_API
Definition: defines.h:124
NvDsCanSrcType::kNone
@ kNone
func_utils.h
NvDsCanSrcType::kUri
@ kUri
NvDsCanContextConfig
Definition: deepstream_can_context.hpp:74
NvDsCanSrcType::kFrame
@ kFrame
NvDsCanContextConfig::srcFrameRate
std::string srcFrameRate
Definition: deepstream_can_context.hpp:80
NvDsCanCameraInfo::devSN
std::string devSN
Definition: deepstream_can_context.hpp:67
ds3d
Definition: lidar_3d_datatype.h:35
NvDs_CanContextStop
DS3D_EXPORT_API ErrCode NvDs_CanContextStop(DsCanContext *ctx)
NvDs_CanContextDestroy
DS3D_EXPORT_API ErrCode NvDs_CanContextDestroy(DsCanContext *ctx)