NVIDIA DRIVE OS Linux SDK API Reference

6.0.7 Release
NvSIPLCamera.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
3  *
4  * NVIDIA CORPORATION and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA CORPORATION is strictly prohibited.
9  */
10 #ifndef NVSIPLCAMERA_HPP
11 #define NVSIPLCAMERA_HPP
12 
13 #include "NvSIPLCommon.hpp"
14 #include "NvSIPLPlatformCfg.hpp"
15 #include "NvSIPLPipelineMgr.hpp"
16 #include "INvSiplControlAuto.hpp"
17 #include "NvSIPLClient.hpp"
18 #include "INvSIPLDeviceInterfaceProvider.hpp"
19 
20 #include "nvscisync.h"
21 #include "nvscistream.h"
22 #include "nvscibuf.h"
23 
24 #include <cstdint>
25 #include <memory>
26 #include <vector>
27 
42 namespace nvsipl
43 {
44 
49 #if !NV_IS_SAFETY
50 static constexpr size_t NITO_PARAMETER_SET_ID_SIZE {16U};
51 static constexpr size_t NITO_SCHEMA_HASH_SIZE {32U};
52 static constexpr size_t NITO_DATA_HASH_SIZE {32U};
53 
59 {
60  uint8_t parameterSetID[NITO_PARAMETER_SET_ID_SIZE]; //< Identifier of the parameter set
61  uint8_t schemaHash[NITO_SCHEMA_HASH_SIZE]; //< Hash value of the parameter set schema
62  uint8_t dataHash[NITO_DATA_HASH_SIZE]; //< Hash value of parameter values
63 };
64 
103 SIPLStatus GetNitoMetadataFromMemory(uint8_t const *const nitoMem,
104  size_t const nitoMemLength,
105  NvSIPLNitoMetadata *const metadataArray,
106  size_t const metadataArrayLength,
107  size_t *const metadataCount);
108 
109 #endif // NV_IS_SAFETY
110 
111 typedef enum
112 {
116  /* For a given SyncObj SIPL acts as a waiter. This type corresponds to
117  * prefences to SIPL */
120 
124 typedef enum {
130 
131 
140 {
141  public:
169  static std::unique_ptr<INvSIPLCamera> GetInstance();
170 
202  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig) = 0;
203 
238  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig, NvSIPLDeviceBlockQueues &queues) = 0;
239 
269  virtual SIPLStatus SetPipelineCfg(uint32_t const index,
270  NvSIPLPipelineConfiguration const &pipelineCfg,
271  NvSIPLPipelineQueues& queues) = 0;
272 
304  virtual SIPLStatus RegisterAutoControlPlugin(uint32_t const index,
305  PluginType type,
306  ISiplControlAuto *const autoControl,
307  std::vector<uint8_t> const &blob) = 0;
308 
336  virtual SIPLStatus Init() = 0;
337 
338 #if !NV_IS_SAFETY
339 
374  virtual SIPLStatus SetSensorCharMode(uint32_t const index, uint8_t expNo) = 0;
375 #endif // !NV_IS_SAFETY
376 
468  virtual SIPLStatus GetImageAttributes(uint32_t const index,
470  NvSciBufAttrList &imageAttr) = 0;
471 
504  virtual SIPLStatus ReadEEPROMData(uint32_t const index,
505  uint16_t const address,
506  uint32_t const length,
507  uint8_t * const buffer) = 0;
508 
605  virtual SIPLStatus RegisterImages(uint32_t const index,
607  std::vector<NvSciBufObj> const &images) = 0;
608 
636  virtual SIPLStatus Start() = 0;
637 
664  virtual SIPLStatus Stop() = 0;
665 
695  virtual SIPLStatus Deinit() = 0;
696 
730  virtual SIPLStatus GetMaxErrorSize(uint32_t const devBlkIndex,
731  size_t & maxErrorSize) = 0;
732 
768  virtual SIPLStatus GetErrorGPIOEventInfo(uint32_t const devBlkIndex,
769  uint32_t const gpioIndex,
770  SIPLGpioEvent &event) = 0;
771 
815  virtual SIPLStatus GetDeserializerErrorInfo(uint32_t const devBlkIndex,
816  SIPLErrorDetails * const deserializerErrorInfo,
817  bool & isRemoteError,
818  uint8_t& linkErrorMask) = 0;
819 
868  virtual SIPLStatus GetModuleErrorInfo(uint32_t const index,
869  SIPLErrorDetails * const serializerErrorInfo,
870  SIPLErrorDetails * const sensorErrorInfo,
871  SIPLModuleErrorReadFlag const errorsToRead
873 
903  virtual SIPLStatus DisableLink(uint32_t const index) = 0;
904 
936  virtual SIPLStatus EnableLink(uint32_t const index, bool const resetModule) = 0;
937 
938 #if !NV_IS_SAFETY
939 
968  virtual SIPLStatus ToggleLED(uint32_t const index, bool enable) = 0;
969 #endif // !NV_IS_SAFETY
970 
972  virtual ~INvSIPLCamera() = default;
973 
1022  virtual SIPLStatus FillNvSciSyncAttrList(uint32_t const index,
1024  NvSciSyncAttrList const attrList,
1025  NvSiplNvSciSyncClientType const clientType) = 0;
1026 
1056  virtual SIPLStatus RegisterNvSciSyncObj(uint32_t const index,
1058  NvSiplNvSciSyncObjType const syncobjtype,
1059  NvSciSyncObj const syncobj) = 0;
1060 
1061 
1062 
1094  virtual SIPLStatus GetDeserializerInterfaceProvider(uint32_t const devBlkIndex,
1095  IInterfaceProvider *&interfaceProvider) = 0;
1096 
1129  virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index,
1130  IInterfaceProvider *&interfaceProvider) = 0;
1131 
1132 }; // INvSIPLCamera
1133 
1135 } // namespace nvsipl
1136 
1137 
1138 
1139 #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::SIPL_WAITER
@ SIPL_WAITER
Definition: NvSIPLCamera.hpp:118
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::SIPLGpioEvent
SIPLGpioEvent
CDAC GPIO event codes.
Definition: NvSIPLCommon.hpp:146
nvsipl::NITO_PARAMETER_SET_ID_SIZE
static constexpr size_t NITO_PARAMETER_SET_ID_SIZE
Definition: NvSIPLCamera.hpp:50
NvSIPLCommon.hpp
NVIDIA SIPL: Common Data Structures - SIPL
nvsipl::SIPL_SIGNALER
@ SIPL_SIGNALER
For a given SyncObj SIPL acts as a signaler.
Definition: NvSIPLCamera.hpp:115
nvsipl::SIPLModuleErrorReadFlag
SIPLModuleErrorReadFlag
Flag indicating which module errors to read.
Definition: NvSIPLCommon.hpp:196
NvSciSyncAttrList
struct NvSciSyncAttrListRec * NvSciSyncAttrList
A container constituting an NvSciSyncAttrList which contains:
Definition: nvscisync.h:323
nvsipl::SIPLErrorDetails
Error details for a particular device.
Definition: NvSIPLCommon.hpp:177
nvsipl::NvSIPLNitoMetadata::schemaHash
uint8_t schemaHash[NITO_SCHEMA_HASH_SIZE]
Definition: NvSIPLCamera.hpp:61
NvSIPLPlatformCfg.hpp
NVIDIA SIPL: Camera Platform Configuration
nvscisync.h
NVIDIA Software Communications Interface (SCI) : NvSciSync
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:211
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::INvSIPLClient::ConsumerDesc::OutputType
OutputType
Defines the types of the SIPL pipeline output.
Definition: NvSIPLClient.hpp:347
nvsipl::INvSIPLCamera::DisableLink
virtual SIPLStatus DisableLink(uint32_t const index)=0
Disable a given link.
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::PlatformCfg
Defines the camera platform configuration.
Definition: NvSIPLPlatformCfg.hpp:52
nvsipl::NvSIPLPipelineQueues
This is the output structure for SetPipelineCfg().
Definition: NvSIPLPipelineMgr.hpp:474
nvsipl::NVSIPL_PRESYNCOBJ
@ NVSIPL_PRESYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a waiter.
Definition: NvSIPLCamera.hpp:126
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:273
nvsipl::SIPLStatus
SIPLStatus
Defines the status codes returned by functions in SIPL modules.
Definition: NvSIPLCommon.hpp:115
NvSIPLPipelineMgr.hpp
NVIDIA SIPL: Pipeline Manager - NvSIPL Pipeline Manager
nvsipl::NvSiplNvSciSyncObjType
NvSiplNvSciSyncObjType
Defines SIPL NvSciSyncObj types.
Definition: NvSIPLCamera.hpp:124
NvSciBufAttrList
struct NvSciBufAttrListRec * NvSciBufAttrList
A container constituting an attribute list which contains.
Definition: nvscibuf.h:3123
nvsipl::INvSIPLCamera
The top-level API for SIPL.
Definition: NvSIPLCamera.hpp:139
nvsipl::NITO_DATA_HASH_SIZE
static constexpr size_t NITO_DATA_HASH_SIZE
Definition: NvSIPLCamera.hpp:52
nvscistream.h
NVIDIA Software Communications Interface (SCI) : NvSciStream
nvscibuf.h
NVIDIA Software Communications Interface (SCI) : NvSciBuf
nvsipl::NvSiplNvSciSyncClientType
NvSiplNvSciSyncClientType
Definition: NvSIPLCamera.hpp:111
nvsipl::INvSIPLCamera::SetSensorCharMode
virtual SIPLStatus SetSensorCharMode(uint32_t const index, uint8_t expNo)=0
Set sensor in characterization mode.
nvsipl::NVSIPL_EOFSYNCOBJ
@ NVSIPL_EOFSYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a signaler, signaling EOFFence.
Definition: NvSIPLCamera.hpp:128
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
Contains the classes and variables for implementation of SIPL.
Definition: INvSiplControlAuto.hpp:33
nvsipl::NITO_SCHEMA_HASH_SIZE
static constexpr size_t NITO_SCHEMA_HASH_SIZE
Definition: NvSIPLCamera.hpp:51
nvsipl::INvSIPLCamera::GetErrorGPIOEventInfo
virtual SIPLStatus GetErrorGPIOEventInfo(uint32_t const devBlkIndex, uint32_t const gpioIndex, SIPLGpioEvent &event)=0
Get the error interrupt event information for a GPIO activation.
nvsipl::NvSIPLNitoMetadata::dataHash
uint8_t dataHash[NITO_DATA_HASH_SIZE]
Definition: NvSIPLCamera.hpp:62
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:58
nvsipl::PluginType
PluginType
Defines types of SIPL Control Auto plug-ins.
Definition: NvSIPLControlAutoDef.hpp:32
NvSciSyncObj
struct NvSciSyncObjRec * NvSciSyncObj
A Synchronization Object is a container holding the reconciled NvSciSyncAttrList defining constraints...
Definition: nvscisync.h:304
nvsipl::ISiplControlAuto
Defines SIPL Control Auto Interface Class.
Definition: INvSiplControlAuto.hpp:44
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:60
nvsipl::NvSIPLDeviceBlockQueues
Holds the queues used by the client to receive device block event notifications.
Definition: NvSIPLPipelineMgr.hpp:507
nvsipl::INvSIPLCamera::Start
virtual SIPLStatus Start()=0
Begin streaming from all sensors in the selected platform configuration.