NVIDIA DRIVE OS Linux SDK API Reference

6.0.4 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 const size_t NITO_PARAMETER_SET_ID_SIZE = 16U;
51 const size_t NITO_SCHEMA_HASH_SIZE = 32U;
52 const 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 
101 SIPLStatus GetNitoMetadataFromMemory(uint8_t const *const nitoMem,
102  size_t const nitoMemLength,
103  NvSIPLNitoMetadata *const metadataArray,
104  size_t const metadataArrayLength,
105  size_t *const metadataCount);
106 
107 #endif // NV_IS_SAFETY
108 
109 typedef enum
110 {
114  /* For a given SyncObj SIPL acts as a waiter. This type corresponds to
115  * prefences to SIPL */
117  /* For a given SyncObj SIPL acts as both signaler and waiter. */
120 
124 typedef enum {
145 
147 
148 
157 {
158  public:
184  static std::unique_ptr<INvSIPLCamera> GetInstance();
185 
215  virtual SIPLStatus SetPlatformCfg(const PlatformCfg *const platformConfig) = 0;
216 
249  virtual SIPLStatus SetPlatformCfg(const PlatformCfg *const platformConfig, NvSIPLDeviceBlockQueues &queues) = 0;
250 
279  virtual SIPLStatus SetPipelineCfg(uint32_t index,
280  const NvSIPLPipelineConfiguration &pipelineCfg,
281  NvSIPLPipelineQueues& queues) = 0;
282 
313  virtual SIPLStatus RegisterAutoControlPlugin(uint32_t index,
314  PluginType type,
315  ISiplControlAuto *const autoControl,
316  const std::vector<uint8_t>& blob) = 0;
317 
346  virtual SIPLStatus Init() = 0;
347 
348 #if !NV_IS_SAFETY
349 
384  virtual SIPLStatus SetSensorCharMode(uint32_t index, uint8_t expNo) = 0;
385 #endif // !NV_IS_SAFETY
386 
469  virtual SIPLStatus GetImageAttributes(uint32_t index,
471  NvSciBufAttrList &imageAttr) = 0;
472 
506  virtual SIPLStatus ReadEEPROMData(const uint32_t index,
507  const uint16_t address,
508  const uint32_t length,
509  uint8_t * const buffer) = 0;
510 
604  virtual SIPLStatus RegisterImages(uint32_t const index,
606  const std::vector<NvSciBufObj> &images) = 0;
607 
635  virtual SIPLStatus Start() = 0;
636 
663  virtual SIPLStatus Stop() = 0;
664 
692  virtual SIPLStatus Deinit() = 0;
693 
727  virtual SIPLStatus GetMaxErrorSize(const uint32_t devBlkIndex,
728  size_t & maxErrorSize) = 0;
729 
763  virtual SIPLStatus GetErrorGPIOEventInfo(const uint32_t devBlkIndex,
764  const uint32_t gpioIndex,
765  SIPLGpioEvent &event) = 0;
766 
810  virtual SIPLStatus GetDeserializerErrorInfo(const uint32_t devBlkIndex,
811  SIPLErrorDetails * const deserializerErrorInfo,
812  bool & isRemoteError,
813  uint8_t& linkErrorMask) = 0;
814 
863  virtual SIPLStatus GetModuleErrorInfo(const uint32_t index,
864  SIPLErrorDetails * const serializerErrorInfo,
865  SIPLErrorDetails * const sensorErrorInfo,
866  const SIPLModuleErrorReadFlag errorsToRead
868 
898  virtual SIPLStatus DisableLink(uint32_t index) = 0;
899 
931  virtual SIPLStatus EnableLink(uint32_t index, bool const resetModule) = 0;
932 
933 #if !NV_IS_SAFETY
934 
963  virtual SIPLStatus ToggleLED(uint32_t index, bool enable) = 0;
964 #endif // !NV_IS_SAFETY
965 
967  virtual ~INvSIPLCamera() = default;
968 
1001  virtual SIPLStatus FillNvSciSyncAttrList(uint32_t index,
1003  NvSciSyncAttrList const attrList,
1004  NvSiplNvSciSyncClientType const clientType) = 0;
1005 
1035  virtual SIPLStatus RegisterNvSciSyncObj(uint32_t index,
1037  NvSiplNvSciSyncObjType const syncobjtype,
1038  NvSciSyncObj const syncobj) = 0;
1039 
1040 
1041 
1073  virtual SIPLStatus GetDeserializerInterfaceProvider(uint32_t const devBlkIndex,
1074  IInterfaceProvider *&interfaceProvider) = 0;
1075 
1108  virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index,
1109  IInterfaceProvider *&interfaceProvider) = 0;
1110 
1111 }; // INvSIPLCamera
1112 
1114 } // namespace nvsipl
1115 
1116 
1117 
1118 #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::GetErrorGPIOEventInfo
virtual SIPLStatus GetErrorGPIOEventInfo(const uint32_t devBlkIndex, const uint32_t gpioIndex, SIPLGpioEvent &event)=0
Get the error interrupt event information for a GPIO activation.
INvSiplControlAuto.hpp
NVIDIA SIPL: Auto Control Interface - SIPL Auto Control
nvsipl::INvSIPLCamera::GetDeserializerErrorInfo
virtual SIPLStatus GetDeserializerErrorInfo(const uint32_t devBlkIndex, SIPLErrorDetails *const deserializerErrorInfo, bool &isRemoteError, uint8_t &linkErrorMask)=0
Get generic deserializer error information.
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::NITO_DATA_HASH_SIZE
const size_t NITO_DATA_HASH_SIZE
Definition: NvSIPLCamera.hpp:52
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:116
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:118
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::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:113
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:314
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::NITO_SCHEMA_HASH_SIZE
const size_t NITO_SCHEMA_HASH_SIZE
Definition: NvSIPLCamera.hpp:51
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::INvSIPLClient::ConsumerDesc::OutputType
OutputType
Defines the types of the SIPL pipeline output.
Definition: NvSIPLClient.hpp:340
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:439
nvsipl::INvSIPLCamera::SetPlatformCfg
virtual SIPLStatus SetPlatformCfg(const PlatformCfg *const platformConfig)=0
Set a platform configuration.
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::NVSIPL_EOF_PRESYNCOBJ
@ NVSIPL_EOF_PRESYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts both as a signaler, signaling EOFFence,...
Definition: NvSIPLCamera.hpp:137
nvsipl::INvSIPLCamera::ReadEEPROMData
virtual SIPLStatus ReadEEPROMData(const uint32_t index, const uint16_t address, const uint32_t length, uint8_t *const buffer)=0
Read from an EEPROM in a camera module.
nvsipl::INvSIPLCamera::RegisterImages
virtual SIPLStatus RegisterImages(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, const std::vector< NvSciBufObj > &images)=0
Register images.
nvsipl::NvSIPLPipelineConfiguration
Defines the camera pipeline configuration.
Definition: NvSIPLPipelineMgr.hpp:246
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
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:2735
nvsipl::INvSIPLCamera
The top-level API for SIPL.
Definition: NvSIPLCamera.hpp:156
nvscistream.h
NVIDIA Software Communications Interface (SCI) : NvSciStream
nvsipl::INvSIPLCamera::SetPipelineCfg
virtual SIPLStatus SetPipelineCfg(uint32_t index, const NvSIPLPipelineConfiguration &pipelineCfg, NvSIPLPipelineQueues &queues)=0
Set a pipeline configuration.
nvscibuf.h
NVIDIA Software Communications Interface (SCI) : NvSciBuf
nvsipl::NvSiplNvSciSyncClientType
NvSiplNvSciSyncClientType
Definition: NvSIPLCamera.hpp:109
nvsipl::INvSIPLCamera::GetMaxErrorSize
virtual SIPLStatus GetMaxErrorSize(const uint32_t devBlkIndex, size_t &maxErrorSize)=0
Get maximum size of error information.
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:144
nvsipl::INvSIPLCamera::RegisterAutoControlPlugin
virtual SIPLStatus RegisterAutoControlPlugin(uint32_t index, PluginType type, ISiplControlAuto *const autoControl, const std::vector< uint8_t > &blob)=0
Register the Auto Control plugin to be used for a specific pipeline.
nvsipl::NVSIPL_EOFSYNCOBJ
@ NVSIPL_EOFSYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a signaler, signaling EOFFence.
Definition: NvSIPLCamera.hpp:128
nvsipl
Contains the classes and variables for implementation of SIPL.
Definition: INvSiplControlAuto.hpp:33
nvsipl::NITO_PARAMETER_SET_ID_SIZE
const size_t NITO_PARAMETER_SET_ID_SIZE
Definition: NvSIPLCamera.hpp:50
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:130
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:295
nvsipl::ISiplControlAuto
Defines SIPL Control Auto Interface Class.
Definition: INvSiplControlAuto.hpp:44
nvsipl::INvSIPLCamera::~INvSIPLCamera
virtual ~INvSIPLCamera()=default
Default destructor.
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:472
nvsipl::INvSIPLCamera::Start
virtual SIPLStatus Start()=0
Begin streaming from all sensors in the selected platform configuration.
nvsipl::INvSIPLCamera::GetModuleErrorInfo
virtual SIPLStatus GetModuleErrorInfo(const uint32_t index, SIPLErrorDetails *const serializerErrorInfo, SIPLErrorDetails *const sensorErrorInfo, const SIPLModuleErrorReadFlag errorsToRead=NVSIPL_MODULE_ERROR_READ_ALL)=0
Gets generic module error information.