NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
NvSIPLCamera.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2025 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"
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 
119 enum NvSiplNvSciSyncClientType : std::uint8_t
120 {
129 };
130 
134 enum NvSiplNvSciSyncObjType : std::uint8_t {
139 };
140 
141 
150 {
151  public:
179  static std::unique_ptr<INvSIPLCamera> GetInstance();
180 
212  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig) = 0;
213 
247  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig, NvSIPLDeviceBlockQueues &queues) = 0;
248 
278  virtual SIPLStatus SetPipelineCfg(uint32_t const index,
279  NvSIPLPipelineConfiguration const &pipelineCfg,
280  NvSIPLPipelineQueues& queues) = 0;
281 
312  virtual SIPLStatus RegisterAutoControlPlugin(uint32_t const index,
314  ISiplControlAuto *const autoControl,
315  std::vector<uint8_t> const &blob) = 0;
316 
348  virtual SIPLStatus Init() = 0;
349 
350 #if !NV_IS_SAFETY
351 
386  virtual SIPLStatus SetSensorCharMode(uint32_t const index, uint8_t expNo) = 0;
387 #endif // !NV_IS_SAFETY
388 
485  virtual SIPLStatus GetImageAttributes(uint32_t const index,
487  NvSciBufAttrList const &imageAttr) = 0;
488 
521  virtual SIPLStatus ReadEEPROMData(uint32_t const index,
522  uint16_t const address,
523  uint32_t const length,
524  uint8_t * const buffer) = 0;
525 
624  virtual SIPLStatus RegisterImages(uint32_t const index,
626  std::vector<NvSciBufObj> const &images) = 0;
627 
658  virtual SIPLStatus Start() = 0;
659 
686  virtual SIPLStatus Stop() = 0;
687 
717  virtual SIPLStatus Deinit() = 0;
718 
752  virtual SIPLStatus GetMaxErrorSize(uint32_t const devBlkIndex,
753  size_t & maxErrorSize) = 0;
754 
798  virtual SIPLStatus GetDeserializerErrorInfo(uint32_t const devBlkIndex,
799  SIPLErrorDetails * const deserializerErrorInfo,
800  bool & isRemoteError,
801  uint8_t& linkErrorMask) = 0;
802 
851  virtual SIPLStatus GetModuleErrorInfo(uint32_t const index,
852  SIPLErrorDetails * const serializerErrorInfo,
853  SIPLErrorDetails * const sensorErrorInfo,
854  SIPLModuleErrorReadFlag const errorsToRead
856 
886  virtual SIPLStatus DisableLink(uint32_t const index) = 0;
887 
919  virtual SIPLStatus EnableLink(uint32_t const index, bool const resetModule) = 0;
920 
921 #if !NV_IS_SAFETY
922 
951  virtual SIPLStatus ToggleLED(uint32_t const index, bool enable) = 0;
952 #endif // !NV_IS_SAFETY
953 
955  virtual ~INvSIPLCamera() = default;
956 
958  INvSIPLCamera(INvSIPLCamera& other) = delete;
959 
961  INvSIPLCamera& operator=(INvSIPLCamera& other) & = delete;
962 
964  INvSIPLCamera(INvSIPLCamera&& other) = delete;
965 
967  INvSIPLCamera& operator=(INvSIPLCamera&& other) & = delete;
968 
1018  virtual SIPLStatus FillNvSciSyncAttrList(uint32_t const index,
1020  NvSciSyncAttrList const attrList,
1021  NvSiplNvSciSyncClientType const clientType) = 0;
1022 
1051  virtual SIPLStatus RegisterNvSciSyncObj(uint32_t const index,
1053  NvSiplNvSciSyncObjType const syncobjtype,
1054  NvSciSyncObj const syncobj) = 0;
1055 
1088  virtual SIPLStatus GetPipelineInterfaceProvider(uint32_t const index,
1089  IInterfaceProvider *&interfaceProvider) noexcept = 0;
1090 
1122  virtual SIPLStatus GetDeserializerInterfaceProvider(uint32_t const devBlkIndex,
1123  IInterfaceProvider *&interfaceProvider) = 0;
1124 
1157  virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index,
1158  IInterfaceProvider *&interfaceProvider) = 0;
1159 
1160 protected:
1162  INvSIPLCamera() = default;
1163 
1164 }; // INvSIPLCamera
1165 
1167 } // namespace nvsipl
1168 
1169 
1170 
1171 #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.
NvSciSyncObj
struct NvSciSyncObjRec * NvSciSyncObj
Definition: wfdext.h:86
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::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:246
nvsipl::PluginType
PluginType
Defines types of SIPL Control Auto plug-ins.
Definition: NvSiplControlAutoDef.hpp:40
nvsipl::SIPLModuleErrorReadFlag
SIPLModuleErrorReadFlag
Flag indicating which module errors to read.
Definition: NvSIPLCommon.hpp:231
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:461
nvsipl::NvSiplNvSciSyncClientType
NvSiplNvSciSyncClientType
Defines SIPL NvSciSync client types.
Definition: NvSIPLCamera.hpp:119
nvsipl::SIPLErrorDetails
Error details for a particular device.
Definition: NvSIPLCommon.hpp:212
nvsipl::NvSIPLNitoMetadata::schemaHash
uint8_t schemaHash[NITO_SCHEMA_HASH_SIZE]
Definition: NvSIPLCamera.hpp:66
NvSciBufAttrList
struct NvSciBufAttrListRec * NvSciBufAttrList
Definition: wfdext.h:73
NvSIPLPlatformCfg.hpp
NVIDIA SIPL: Camera Platform Configuration
nvscisync.h
NVIDIA Software Communications Interface (SCI) : NvSciSync
INvSIPLDeviceInterfaceProvider.hpp
NVIDIA SIPL: Device Interface Provider Interface
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::GetPipelineInterfaceProvider
virtual SIPLStatus GetPipelineInterfaceProvider(uint32_t const index, IInterfaceProvider *&interfaceProvider) noexcept=0
Retrieve the custom interface provider for a sensor pipeline.
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:138
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:153
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:128
nvsipl::NvSIPLPipelineQueues
This is the output structure for INvSIPLCamera::SetPipelineCfg().
Definition: NvSIPLPipelineMgr.hpp:646
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:400
WFDCommitType
WFDCommitType
Definition: wfd.h:112
NvSIPLPipelineMgr.hpp
NVIDIA SIPL: Pipeline Manager - NvSIPL Pipeline Manager
nvsipl::INvSIPLCamera
The top-level API for SIPL.
Definition: NvSIPLCamera.hpp:149
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:124
nvsipl::INvSIPLCamera::operator=
INvSIPLCamera & operator=(INvSIPLCamera &other) &=delete
Delete copy assignment operator.
nvscistream.h
NVIDIA Software Communications Interface (SCI) : NvSciStream
nvsipl::IInterfaceProvider
Class providing access to device interfaces.
Definition: INvSIPLDeviceInterfaceProvider.hpp:173
nvscibuf.h
NVIDIA Software Communications Interface (SCI) : NvSciBuf
nvsipl::NvSiplNvSciSyncObjType
NvSiplNvSciSyncObjType
Defines SIPL NvSciSyncObj types.
Definition: NvSIPLCamera.hpp:134
nvsipl::INvSIPLCamera::INvSIPLCamera
INvSIPLCamera()=default
Default constructor declared in order to allow construction of derived objects.
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.
NvSciSyncAttrList
struct NvSciSyncAttrListRec * NvSciSyncAttrList
Definition: wfdext.h:88
nvsipl::NVSIPL_PRESYNCOBJ
@ NVSIPL_PRESYNCOBJ
Specifies an NvSciSyncObj type for which SIPL acts as a waiter.
Definition: NvSIPLCamera.hpp:136
nvsipl
Contains the classes and variables for implementation of SIPL.
Definition: NvSIPLCamera.hpp:44
nvsipl::INvSIPLCamera::GetImageAttributes
virtual SIPLStatus GetImageAttributes(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSciBufAttrList const &imageAttr)=0
Get image attributes.
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
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:679
nvsipl::INvSIPLCamera::Start
virtual SIPLStatus Start()=0
Begin streaming from all sensors in the selected platform configuration.