NVIDIA DRIVE OS Linux SDK API Reference

6.0.6 Release
NvSIPLCamera.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2022, 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 */
119  /* For a given SyncObj SIPL acts as both signaler and waiter. */
122 
126 typedef enum {
147 
149 
150 
159 {
160  public:
188  static std::unique_ptr<INvSIPLCamera> GetInstance();
189 
221  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig) = 0;
222 
257  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig, NvSIPLDeviceBlockQueues &queues) = 0;
258 
288  virtual SIPLStatus SetPipelineCfg(uint32_t index,
289  NvSIPLPipelineConfiguration const &pipelineCfg,
290  NvSIPLPipelineQueues& queues) = 0;
291 
323  virtual SIPLStatus RegisterAutoControlPlugin(uint32_t index,
324  PluginType type,
325  ISiplControlAuto *const autoControl,
326  std::vector<uint8_t> const &blob) = 0;
327 
355  virtual SIPLStatus Init() = 0;
356 
357 #if !NV_IS_SAFETY
358 
393  virtual SIPLStatus SetSensorCharMode(uint32_t index, uint8_t expNo) = 0;
394 #endif // !NV_IS_SAFETY
395 
478  virtual SIPLStatus GetImageAttributes(uint32_t 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 
611  virtual SIPLStatus RegisterImages(uint32_t const index,
613  std::vector<NvSciBufObj> const &images) = 0;
614 
642  virtual SIPLStatus Start() = 0;
643 
670  virtual SIPLStatus Stop() = 0;
671 
701  virtual SIPLStatus Deinit() = 0;
702 
736  virtual SIPLStatus GetMaxErrorSize(uint32_t const devBlkIndex,
737  size_t & maxErrorSize) = 0;
738 
774  virtual SIPLStatus GetErrorGPIOEventInfo(uint32_t const devBlkIndex,
775  uint32_t const gpioIndex,
776  SIPLGpioEvent &event) = 0;
777 
821  virtual SIPLStatus GetDeserializerErrorInfo(uint32_t const devBlkIndex,
822  SIPLErrorDetails * const deserializerErrorInfo,
823  bool & isRemoteError,
824  uint8_t& linkErrorMask) = 0;
825 
874  virtual SIPLStatus GetModuleErrorInfo(uint32_t const index,
875  SIPLErrorDetails * const serializerErrorInfo,
876  SIPLErrorDetails * const sensorErrorInfo,
877  SIPLModuleErrorReadFlag const errorsToRead
879 
909  virtual SIPLStatus DisableLink(uint32_t index) = 0;
910 
942  virtual SIPLStatus EnableLink(uint32_t index, bool const resetModule) = 0;
943 
944 #if !NV_IS_SAFETY
945 
974  virtual SIPLStatus ToggleLED(uint32_t index, bool enable) = 0;
975 #endif // !NV_IS_SAFETY
976 
978  virtual ~INvSIPLCamera() = default;
979 
1021  virtual SIPLStatus FillNvSciSyncAttrList(uint32_t index,
1023  NvSciSyncAttrList const attrList,
1024  NvSiplNvSciSyncClientType const clientType) = 0;
1025 
1055  virtual SIPLStatus RegisterNvSciSyncObj(uint32_t index,
1057  NvSiplNvSciSyncObjType const syncobjtype,
1058  NvSciSyncObj const syncobj) = 0;
1059 
1060 
1061 
1093  virtual SIPLStatus GetDeserializerInterfaceProvider(uint32_t const devBlkIndex,
1094  IInterfaceProvider *&interfaceProvider) = 0;
1095 
1128  virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index,
1129  IInterfaceProvider *&interfaceProvider) = 0;
1130 
1131 }; // INvSIPLCamera
1132 
1134 } // namespace nvsipl
1135 
1136 
1137 
1138 #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::RegisterAutoControlPlugin
virtual SIPLStatus RegisterAutoControlPlugin(uint32_t 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::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 index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSciSyncAttrList const attrList, NvSiplNvSciSyncClientType const clientType)=0
Fill an NvSciSyncAttrList.
nvsipl::INvSIPLCamera::ToggleLED
virtual SIPLStatus ToggleLED(uint32_t index, bool enable)=0
Control the LED on the associated camera module.
nvsipl::SIPL_WAITER
@ SIPL_WAITER
Definition: NvSIPLCamera.hpp:118
nvsipl::INvSIPLCamera::RegisterNvSciSyncObj
virtual SIPLStatus RegisterNvSciSyncObj(uint32_t index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSiplNvSciSyncObjType const syncobjtype, NvSciSyncObj const syncobj)=0
Register an NvSciSyncObj.
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::SIPL_SIGNALER_WAITER
@ SIPL_SIGNALER_WAITER
Definition: NvSIPLCamera.hpp:120
nvsipl::INvSIPLCamera::SetSensorCharMode
virtual SIPLStatus SetSensorCharMode(uint32_t index, uint8_t expNo)=0
Set sensor in characterization mode.
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
nvsipl::INvSIPLCamera::GetImageAttributes
virtual SIPLStatus GetImageAttributes(uint32_t index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSciBufAttrList &imageAttr)=0
Get image attributes.
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:322
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
nvsipl::INvSIPLCamera::EnableLink
virtual SIPLStatus EnableLink(uint32_t index, bool const resetModule)=0
Enable a given link.
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::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:128
nvsipl::INvSIPLCamera::SetPipelineCfg
virtual SIPLStatus SetPipelineCfg(uint32_t index, NvSIPLPipelineConfiguration const &pipelineCfg, NvSIPLPipelineQueues &queues)=0
Set a pipeline configuration.
nvsipl::INvSIPLCamera::GetModuleInterfaceProvider
virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index, IInterfaceProvider *&interfaceProvider)=0
Retrieve custom interface provider for module.
nvsipl::NVSIPL_EOF_PRESYNCOBJ
@ NVSIPL_EOF_PRESYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts both as a signaler, signaling EOFFence,...
Definition: NvSIPLCamera.hpp:139
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:126
nvsipl::INvSIPLCamera::DisableLink
virtual SIPLStatus DisableLink(uint32_t index)=0
Disable a given link.
NvSciBufAttrList
struct NvSciBufAttrListRec * NvSciBufAttrList
A container constituting an attribute list which contains.
Definition: nvscibuf.h:2758
nvsipl::INvSIPLCamera
The top-level API for SIPL.
Definition: NvSIPLCamera.hpp:158
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::NVSIPL_SOF_PRESYNCOBJ
@ NVSIPL_SOF_PRESYNCOBJ
Specifies an NvSciSyncObj type for which a SIPL component acts as a signaler, signaling SOFFence,...
Definition: NvSIPLCamera.hpp:146
nvsipl::NVSIPL_EOFSYNCOBJ
@ NVSIPL_EOFSYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a signaler, signaling EOFFence.
Definition: NvSIPLCamera.hpp:130
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::NVSIPL_SOFSYNCOBJ
@ NVSIPL_SOFSYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a signaler, signaling SOFFence.
Definition: NvSIPLCamera.hpp:132
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:303
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.