NVIDIA DRIVE OS Linux SDK API Reference

6.0.10.0 Release
NvSIPLCamera.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2024 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 #ifndef NVSIPLCAMERA_HPP
13 #define NVSIPLCAMERA_HPP
14 
15 #include "NvSIPLCommon.hpp"
16 #include "NvSIPLPlatformCfg.hpp"
17 #include "NvSIPLPipelineMgr.hpp"
18 #include "INvSiplControlAuto.hpp"
19 #include "NvSIPLClient.hpp"
20 #include "INvSIPLDeviceInterfaceProvider.hpp"
21 
22 #include "nvscisync.h"
23 #include "nvscistream.h"
24 #include "nvscibuf.h"
25 
26 #include <cstdint>
27 #include <memory>
28 #include <vector>
29 
44 namespace nvsipl
45 {
46 
51 #if !NV_IS_SAFETY
52 
53 static constexpr size_t NITO_PARAMETER_SET_ID_SIZE {16U};
55 static constexpr size_t NITO_SCHEMA_HASH_SIZE {32U};
57 static constexpr size_t NITO_DATA_HASH_SIZE {32U};
58 
64 {
65  uint8_t parameterSetID[NITO_PARAMETER_SET_ID_SIZE]; //< Identifier of the parameter set
66  uint8_t schemaHash[NITO_SCHEMA_HASH_SIZE]; //< Hash value of the parameter set schema
67  uint8_t dataHash[NITO_DATA_HASH_SIZE]; //< Hash value of parameter values
68 };
69 
108 SIPLStatus GetNitoMetadataFromMemory(uint8_t const *const nitoMem,
109  size_t const nitoMemLength,
110  NvSIPLNitoMetadata *const metadataArray,
111  size_t const metadataArrayLength,
112  size_t *const metadataCount);
113 
114 #endif // NV_IS_SAFETY
115 
116 typedef enum : std::uint8_t
117 {
127 
131 typedef enum : std::uint8_t {
137 
138 
147 {
148  public:
176  static std::unique_ptr<INvSIPLCamera> GetInstance();
177 
209  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig) = 0;
210 
244  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig, NvSIPLDeviceBlockQueues &queues) = 0;
245 
275  virtual SIPLStatus SetPipelineCfg(uint32_t const index,
276  NvSIPLPipelineConfiguration const &pipelineCfg,
277  NvSIPLPipelineQueues& queues) = 0;
278 
309  virtual SIPLStatus RegisterAutoControlPlugin(uint32_t const index,
310  PluginType type,
311  ISiplControlAuto *const autoControl,
312  std::vector<uint8_t> const &blob) = 0;
313 
341  virtual SIPLStatus Init() = 0;
342 
343 #if !NV_IS_SAFETY
344 
379  virtual SIPLStatus SetSensorCharMode(uint32_t const index, uint8_t expNo) = 0;
380 #endif // !NV_IS_SAFETY
381 
478  virtual SIPLStatus GetImageAttributes(uint32_t const index,
480  NvSciBufAttrList &imageAttr) = 0;
481 
514  virtual SIPLStatus ReadEEPROMData(uint32_t const index,
515  uint16_t const address,
516  uint32_t const length,
517  uint8_t * const buffer) = 0;
518 
616  virtual SIPLStatus RegisterImages(uint32_t const index,
618  std::vector<NvSciBufObj> const &images) = 0;
619 
647  virtual SIPLStatus Start() = 0;
648 
675  virtual SIPLStatus Stop() = 0;
676 
706  virtual SIPLStatus Deinit() = 0;
707 
741  virtual SIPLStatus GetMaxErrorSize(uint32_t const devBlkIndex,
742  size_t & maxErrorSize) = 0;
743 
787  virtual SIPLStatus GetDeserializerErrorInfo(uint32_t const devBlkIndex,
788  SIPLErrorDetails * const deserializerErrorInfo,
789  bool & isRemoteError,
790  uint8_t& linkErrorMask) = 0;
791 
840  virtual SIPLStatus GetModuleErrorInfo(uint32_t const index,
841  SIPLErrorDetails * const serializerErrorInfo,
842  SIPLErrorDetails * const sensorErrorInfo,
843  SIPLModuleErrorReadFlag const errorsToRead
845 
875  virtual SIPLStatus DisableLink(uint32_t const index) = 0;
876 
908  virtual SIPLStatus EnableLink(uint32_t const index, bool const resetModule) = 0;
909 
910 #if !NV_IS_SAFETY
911 
940  virtual SIPLStatus ToggleLED(uint32_t const index, bool enable) = 0;
941 #endif // !NV_IS_SAFETY
942 
944  virtual ~INvSIPLCamera() = default;
945 
946  // copy constructor
947  INvSIPLCamera(INvSIPLCamera& other) = delete;
948 
949  // copy assignment operator.
950  INvSIPLCamera& operator=(INvSIPLCamera& other) & = delete;
951 
952  // move constructor
953  INvSIPLCamera(INvSIPLCamera&& other) = delete;
954 
955  // move assignment operator.
956  INvSIPLCamera& operator=(INvSIPLCamera&& other) & = delete;
957 
1007  virtual SIPLStatus FillNvSciSyncAttrList(uint32_t const index,
1009  NvSciSyncAttrList const attrList,
1010  NvSiplNvSciSyncClientType const clientType) = 0;
1011 
1040  virtual SIPLStatus RegisterNvSciSyncObj(uint32_t const index,
1042  NvSiplNvSciSyncObjType const syncobjtype,
1043  NvSciSyncObj const syncobj) = 0;
1044 
1045 
1046 
1078  virtual SIPLStatus GetDeserializerInterfaceProvider(uint32_t const devBlkIndex,
1079  IInterfaceProvider *&interfaceProvider) = 0;
1080 
1113  virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index,
1114  IInterfaceProvider *&interfaceProvider) = 0;
1115 
1116 protected:
1117  // Default constructor declared in order to allow construction of derived objects.
1118  INvSIPLCamera() = default;
1119 
1120 }; // INvSIPLCamera
1121 
1123 } // namespace nvsipl
1124 
1125 
1126 
1127 #endif // NVSIPLCAMERA_HPP
NvSIPLClient.hpp
NVIDIA SIPL: Client Interface - NvSIPL Client
nvsipl::INvSIPLCamera::GetDeserializerInterfaceProvider
virtual SIPLStatus GetDeserializerInterfaceProvider(uint32_t const devBlkIndex, IInterfaceProvider *&interfaceProvider)=0
Retrieve custom interface provider for deserializer.
nvsipl::INvSIPLCamera::GetMaxErrorSize
virtual SIPLStatus GetMaxErrorSize(uint32_t const devBlkIndex, size_t &maxErrorSize)=0
Get maximum size of error information.
INvSiplControlAuto.hpp
NVIDIA SIPL: Auto Control Interface - SIPL Auto Control
nvsipl::INvSIPLCamera::FillNvSciSyncAttrList
virtual SIPLStatus FillNvSciSyncAttrList(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSciSyncAttrList const attrList, NvSiplNvSciSyncClientType const clientType)=0
Fill an NvSciSyncAttrList.
nvsipl::INvSIPLCamera::GetImageAttributes
virtual SIPLStatus GetImageAttributes(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSciBufAttrList &imageAttr)=0
Get image attributes.
nvsipl::INvSIPLCamera::RegisterNvSciSyncObj
virtual SIPLStatus RegisterNvSciSyncObj(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSiplNvSciSyncObjType const syncobjtype, NvSciSyncObj const syncobj)=0
Register an NvSciSyncObj.
nvsipl::INvSIPLCamera::SetPipelineCfg
virtual SIPLStatus SetPipelineCfg(uint32_t const index, NvSIPLPipelineConfiguration const &pipelineCfg, NvSIPLPipelineQueues &queues)=0
Set a pipeline configuration.
nvsipl::NVSIPL_MODULE_ERROR_READ_ALL
@ NVSIPL_MODULE_ERROR_READ_ALL
Read both sensor and serializer error information when getting error details.
Definition: NvSIPLCommon.hpp:245
nvsipl::PluginType
PluginType
Defines types of SIPL Control Auto plug-ins.
Definition: NvSIPLControlAutoDef.hpp:37
nvsipl::SIPLModuleErrorReadFlag
SIPLModuleErrorReadFlag
Flag indicating which module errors to read.
Definition: NvSIPLCommon.hpp:230
nvsipl::INvSIPLCamera::Stop
virtual SIPLStatus Stop()=0
Stop streaming from all sensors in the selected platform configuration.
nvsipl::INvSIPLCamera::GetInstance
static std::unique_ptr< INvSIPLCamera > GetInstance()
Get a handle to an INvSIPLCamera instance.
nvsipl::INvSIPLCamera::RegisterAutoControlPlugin
virtual SIPLStatus RegisterAutoControlPlugin(uint32_t const index, PluginType type, ISiplControlAuto *const autoControl, std::vector< uint8_t > const &blob)=0
Register the Auto Control plugin to be used for a specific pipeline.
nvsipl::NITO_PARAMETER_SET_ID_SIZE
static constexpr size_t NITO_PARAMETER_SET_ID_SIZE
Size of the NITO Parameters set ID.
Definition: NvSIPLCamera.hpp:53
NvSIPLCommon.hpp
NVIDIA SIPL: Common Data Structures - SIPL
nvsipl::INvSIPLClient::ConsumerDesc::OutputType
OutputType
Defines the types of the SIPL pipeline output.
Definition: NvSIPLClient.hpp:400
nvsipl::NvSiplNvSciSyncClientType
NvSiplNvSciSyncClientType
Definition: NvSIPLCamera.hpp:116
NvSciSyncAttrList
struct NvSciSyncAttrListRec * NvSciSyncAttrList
A container constituting an NvSciSyncAttrList which contains:
Definition: nvscisync.h:330
nvsipl::SIPLErrorDetails
Error details for a particular device.
Definition: NvSIPLCommon.hpp:211
nvsipl::NvSIPLNitoMetadata::schemaHash
uint8_t schemaHash[NITO_SCHEMA_HASH_SIZE]
Definition: NvSIPLCamera.hpp:66
NvSIPLPlatformCfg.hpp
NVIDIA SIPL: Camera Platform Configuration
nvscisync.h
NVIDIA Software Communications Interface (SCI) : NvSciSync
nvsipl::INvSIPLCamera::Init
virtual SIPLStatus Init()=0
Initialize the API for the selected platform configuration.
nvsipl::INvSIPLCamera::Deinit
virtual SIPLStatus Deinit()=0
Deinitialize the API for the selected platform configuration.
nvsipl::INvSIPLCamera::RegisterImages
virtual SIPLStatus RegisterImages(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, std::vector< NvSciBufObj > const &images)=0
Register images.
nvsipl::INvSIPLCamera::DisableLink
virtual SIPLStatus DisableLink(uint32_t const index)=0
Disable a given link.
nvsipl::NVSIPL_EOFSYNCOBJ
@ NVSIPL_EOFSYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a signaler, signaling EOFFence.
Definition: NvSIPLCamera.hpp:135
nvsipl::GetNitoMetadataFromMemory
SIPLStatus GetNitoMetadataFromMemory(uint8_t const *const nitoMem, size_t const nitoMemLength, NvSIPLNitoMetadata *const metadataArray, size_t const metadataArrayLength, size_t *const metadataCount)
Get NITO Metadata (knobset UUID, schema hash, data hash) from a NITO memory buffer.
nvsipl::SIPLStatus
SIPLStatus
Defines the status codes returned by functions in SIPL modules.
Definition: NvSIPLCommon.hpp:152
nvsipl::PlatformCfg
Defines the camera platform configuration.
Definition: NvSIPLPlatformCfg.hpp:39
nvsipl::SIPL_WAITER
@ SIPL_WAITER
For a given NvSciSyncObj SIPL acts as a waiter.
Definition: NvSIPLCamera.hpp:125
nvsipl::NvSIPLPipelineQueues
This is the output structure for INvSIPLCamera::SetPipelineCfg().
Definition: NvSIPLPipelineMgr.hpp:562
nvsipl::INvSIPLCamera::GetModuleInterfaceProvider
virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index, IInterfaceProvider *&interfaceProvider)=0
Retrieve custom interface provider for module.
nvsipl::INvSIPLCamera::SetPlatformCfg
virtual SIPLStatus SetPlatformCfg(PlatformCfg const *const platformConfig)=0
Set a platform configuration.
nvsipl::NvSIPLPipelineConfiguration
Defines the camera pipeline configuration.
Definition: NvSIPLPipelineMgr.hpp:335
NvSIPLPipelineMgr.hpp
NVIDIA SIPL: Pipeline Manager - NvSIPL Pipeline Manager
NvSciBufAttrList
struct NvSciBufAttrListRec * NvSciBufAttrList
A container constituting an attribute list which contains.
Definition: nvscibuf.h:3120
nvsipl::INvSIPLCamera
The top-level API for SIPL.
Definition: NvSIPLCamera.hpp:146
nvsipl::NITO_DATA_HASH_SIZE
static constexpr size_t NITO_DATA_HASH_SIZE
Size of the NITO Data Hash.
Definition: NvSIPLCamera.hpp:57
nvsipl::SIPL_SIGNALER
@ SIPL_SIGNALER
For a given NvSciSyncObj SIPL acts as a signaler.
Definition: NvSIPLCamera.hpp:121
nvsipl::INvSIPLCamera::operator=
INvSIPLCamera & operator=(INvSIPLCamera &other) &=delete
nvscistream.h
NVIDIA Software Communications Interface (SCI) : NvSciStream
nvscibuf.h
NVIDIA Software Communications Interface (SCI) : NvSciBuf
nvsipl::NvSiplNvSciSyncObjType
NvSiplNvSciSyncObjType
Defines SIPL NvSciSyncObj types.
Definition: NvSIPLCamera.hpp:131
nvsipl::INvSIPLCamera::INvSIPLCamera
INvSIPLCamera()=default
nvsipl::INvSIPLCamera::SetSensorCharMode
virtual SIPLStatus SetSensorCharMode(uint32_t const index, uint8_t expNo)=0
Set sensor in characterization mode.
nvsipl::INvSIPLCamera::GetModuleErrorInfo
virtual SIPLStatus GetModuleErrorInfo(uint32_t const index, SIPLErrorDetails *const serializerErrorInfo, SIPLErrorDetails *const sensorErrorInfo, SIPLModuleErrorReadFlag const errorsToRead=NVSIPL_MODULE_ERROR_READ_ALL)=0
Gets generic module error information.
nvsipl::INvSIPLCamera::GetDeserializerErrorInfo
virtual SIPLStatus GetDeserializerErrorInfo(uint32_t const devBlkIndex, SIPLErrorDetails *const deserializerErrorInfo, bool &isRemoteError, uint8_t &linkErrorMask)=0
Get generic deserializer error information.
nvsipl::NVSIPL_PRESYNCOBJ
@ NVSIPL_PRESYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a waiter.
Definition: NvSIPLCamera.hpp:133
nvsipl
Contains the classes and variables for implementation of SIPL.
Definition: INvSiplControlAuto.hpp:35
nvsipl::NITO_SCHEMA_HASH_SIZE
static constexpr size_t NITO_SCHEMA_HASH_SIZE
Size of the NITO Schema Hash.
Definition: NvSIPLCamera.hpp:55
nvsipl::NvSIPLNitoMetadata::dataHash
uint8_t dataHash[NITO_DATA_HASH_SIZE]
Definition: NvSIPLCamera.hpp:67
nvsipl::INvSIPLCamera::EnableLink
virtual SIPLStatus EnableLink(uint32_t const index, bool const resetModule)=0
Enable a given link.
nvsipl::INvSIPLCamera::ToggleLED
virtual SIPLStatus ToggleLED(uint32_t const index, bool enable)=0
Control the LED on the associated camera module.
nvsipl::NvSIPLNitoMetadata
NvSIPLNitoMetadata defines the 3-tuple returned by a successful call to GetNitoMetadataFromMemory().
Definition: NvSIPLCamera.hpp:63
NvSciSyncObj
struct NvSciSyncObjRec * NvSciSyncObj
A Synchronization Object is a container holding the reconciled NvSciSyncAttrList defining constraints...
Definition: nvscisync.h:311
nvsipl::ISiplControlAuto
Defines SIPL Control Auto Interface Class.
Definition: INvSiplControlAuto.hpp:46
nvsipl::INvSIPLCamera::~INvSIPLCamera
virtual ~INvSIPLCamera()=default
Default destructor.
nvsipl::INvSIPLCamera::ReadEEPROMData
virtual SIPLStatus ReadEEPROMData(uint32_t const index, uint16_t const address, uint32_t const length, uint8_t *const buffer)=0
Read from an EEPROM in a camera module.
nvsipl::NvSIPLNitoMetadata::parameterSetID
uint8_t parameterSetID[NITO_PARAMETER_SET_ID_SIZE]
Definition: NvSIPLCamera.hpp:65
nvsipl::NvSIPLDeviceBlockQueues
Holds the queues used by the client to receive device block event notifications.
Definition: NvSIPLPipelineMgr.hpp:595
nvsipl::INvSIPLCamera::Start
virtual SIPLStatus Start()=0
Begin streaming from all sensors in the selected platform configuration.