Jetson Linux API Reference

39.2 Release
NvSIPLCamera.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-2026 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 #include "NvSIPLCameraTypes.hpp"
22 
23 #include "nvscisync.h"
24 #include "nvscistream.h"
25 #include "nvscibuf.h"
26 
27 #include <cstdint>
28 #include <memory>
29 #include <vector>
30 
45 namespace nvsipl
46 {
47 
52 #if !NV_IS_SAFETY
53 
54 static constexpr size_t NITO_PARAMETER_SET_ID_SIZE {16U};
56 static constexpr size_t NITO_SCHEMA_HASH_SIZE {32U};
58 static constexpr size_t NITO_DATA_HASH_SIZE {32U};
59 
65 {
66  uint8_t parameterSetID[NITO_PARAMETER_SET_ID_SIZE]; //< Identifier of the parameter set
67  uint8_t schemaHash[NITO_SCHEMA_HASH_SIZE]; //< Hash value of the parameter set schema
68  uint8_t dataHash[NITO_DATA_HASH_SIZE]; //< Hash value of parameter values
69 };
70 
113 SIPLStatus GetNitoMetadataFromMemory(uint8_t const *const nitoMem,
114  size_t const nitoMemLength,
115  NvSIPLNitoMetadata *const metadataArray,
116  size_t const metadataArrayLength,
117  size_t *const metadataCount);
118 
119 #endif // NV_IS_SAFETY
120 
124 enum NvSiplNvSciSyncClientType : std::uint8_t
125 {
134 };
135 
139 enum NvSiplNvSciSyncObjType : std::uint8_t {
144 };
145 
151 enum FrameProcessingRate : std::uint8_t {
153  FULL_RATE = 0U,
162 };
163 
172 {
173  public:
205  static std::unique_ptr<INvSIPLCamera> GetInstance();
206 
242  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig) = 0;
243 
281  virtual SIPLStatus SetPlatformCfg(PlatformCfg const* const platformConfig, NvSIPLDeviceBlockQueues &queues) = 0;
282 
328 
364  virtual SIPLStatus SetPipelineCfg(uint32_t const index,
365  NvSIPLPipelineConfiguration const &pipelineCfg,
366  NvSIPLPipelineQueues& queues,
367  uint32_t const vcIdx = 0U) = 0;
368 
406  virtual SIPLStatus RegisterAutoControlPlugin(uint32_t const index,
407  PluginType type,
408  ISiplControlAuto *const autoControl,
409  std::vector<uint8_t> const &blob,
410  uint32_t const vcIdx = 0U,
411  FrameProcessingRate const processingRate = FULL_RATE) = 0;
412 
452  virtual SIPLStatus RegisterAutoControlPlugin(uint32_t const index,
453  PluginType type,
454  std::vector<ISiplControlAuto*> const &autoControls,
455  std::vector<std::vector<uint8_t>> const &blobs,
456  uint32_t const vcIdx = 0U,
457  std::vector<FrameProcessingRate> const &processingRates = {}) = 0;
458 
494  virtual SIPLStatus Init() = 0;
495 
496 #if !NV_IS_SAFETY
497 
536  virtual SIPLStatus SetSensorCharMode(uint32_t const index, uint8_t expNo) = 0;
537 #endif // !NV_IS_SAFETY
538 
640  virtual SIPLStatus GetImageAttributes(uint32_t const index,
642  NvSciBufAttrList const &imageAttr,
643  uint32_t const vcIdx = 0U) = 0;
644 
681  virtual SIPLStatus ReadEEPROMData(uint32_t const index,
682  uint16_t const address,
683  uint32_t const length,
684  uint8_t * const buffer) = 0;
685 
792  virtual SIPLStatus RegisterImages(uint32_t const index,
794  std::vector<NvSciBufObj> const &images,
795  uint32_t const vcIdx = 0U) = 0;
796 
831  virtual SIPLStatus Start() = 0;
832 
863  virtual SIPLStatus Stop() = 0;
864 
898  virtual SIPLStatus Deinit() = 0;
899 
937  virtual SIPLStatus GetMaxErrorSize(uint32_t const devBlkIndex,
938  size_t & maxErrorSize) = 0;
939 
987  virtual SIPLStatus GetDeserializerErrorInfo(uint32_t const devBlkIndex,
988  SIPLErrorDetails * const deserializerErrorInfo,
989  bool & isRemoteError,
990  uint8_t& linkErrorMask) = 0;
991 
1044  virtual SIPLStatus GetModuleErrorInfo(uint32_t const index,
1045  SIPLErrorDetails * const serializerErrorInfo,
1046  SIPLErrorDetails * const sensorErrorInfo,
1047  SIPLModuleErrorReadFlag const errorsToRead
1049 
1083  virtual SIPLStatus DisableLink(uint32_t const index) = 0;
1084 
1120  virtual SIPLStatus EnableLink(uint32_t const index, bool const resetModule) = 0;
1121 
1122 #if !NV_IS_SAFETY
1123 
1156  virtual SIPLStatus ToggleLED(uint32_t const index, bool enable) = 0;
1157 #endif // !NV_IS_SAFETY
1158 
1160  virtual ~INvSIPLCamera() = default;
1161 
1163  INvSIPLCamera(INvSIPLCamera& other) = delete;
1164 
1166  INvSIPLCamera& operator=(INvSIPLCamera& other) & = delete;
1167 
1169  INvSIPLCamera(INvSIPLCamera&& other) = delete;
1170 
1172  INvSIPLCamera& operator=(INvSIPLCamera&& other) & = delete;
1173 
1228  virtual SIPLStatus FillNvSciSyncAttrList(uint32_t const index,
1230  NvSciSyncAttrList const attrList,
1231  NvSiplNvSciSyncClientType const clientType,
1232  uint32_t const vcIdx = 0U) = 0;
1233 
1267  virtual SIPLStatus RegisterNvSciSyncObj(uint32_t const index,
1269  NvSiplNvSciSyncObjType const syncobjtype,
1270  NvSciSyncObj const syncobj,
1271  uint32_t const vcIdx = 0U) = 0;
1272 
1309  virtual SIPLStatus GetPipelineInterfaceProvider(uint32_t const index,
1310  IInterfaceProvider *&interfaceProvider,
1311  uint32_t const vcIdx = 0U) noexcept = 0;
1312 
1348  virtual SIPLStatus GetDeserializerInterfaceProvider(uint32_t const devBlkIndex,
1349  IInterfaceProvider *&interfaceProvider) = 0;
1350 
1387  virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index,
1388  IInterfaceProvider *&interfaceProvider) = 0;
1389 
1390 protected:
1392  INvSIPLCamera() = default;
1393 
1394 }; // INvSIPLCamera
1395 
1397 } // namespace nvsipl
1398 
1399 
1400 
1401 #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 const index, PluginType type, ISiplControlAuto *const autoControl, std::vector< uint8_t > const &blob, uint32_t const vcIdx=0U, FrameProcessingRate const processingRate=FULL_RATE)=0
Register the Auto Control plugin to be used for a specific pipeline.
nvsipl::FULL_RATE
@ FULL_RATE
Process Auto Control (AE-AWB) and ISP every frame (default).
Definition: NvSIPLCamera.hpp:153
nvsipl::INvSIPLCamera::SetPipelineCfg
virtual SIPLStatus SetPipelineCfg(uint32_t const index, NvSIPLPipelineConfiguration const &pipelineCfg, NvSIPLPipelineQueues &queues, uint32_t const vcIdx=0U)=0
Set a pipeline configuration.
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::GetImageAttributes
virtual SIPLStatus GetImageAttributes(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSciBufAttrList const &imageAttr, uint32_t const vcIdx=0U)=0
Get image attributes.
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::INvSIPLCamera::FillNvSciSyncAttrList
virtual SIPLStatus FillNvSciSyncAttrList(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSciSyncAttrList const attrList, NvSiplNvSciSyncClientType const clientType, uint32_t const vcIdx=0U)=0
Fill an NvSciSyncAttrList.
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::sensorconfig::SensorSystemConfig
Combined structure describing module configurations and transport configurations.
Definition: NvSIPLCameraTypes.hpp:824
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::NITO_PARAMETER_SET_ID_SIZE
static constexpr size_t NITO_PARAMETER_SET_ID_SIZE
Size of the NITO Parameters set ID.
Definition: NvSIPLCamera.hpp:54
NvSIPLCommon.hpp
NVIDIA SIPL: Common Data Structures - SIPL
nvsipl::HALF_RATE
@ HALF_RATE
Process Auto Control (AE-AWB) and ISP every 2nd frame (half rate).
Definition: NvSIPLCamera.hpp:155
nvsipl::INvSIPLClient::ConsumerDesc::OutputType
OutputType
Defines the types of the SIPL pipeline output.
Definition: NvSIPLClient.hpp:454
nvsipl::NvSiplNvSciSyncClientType
NvSiplNvSciSyncClientType
Defines SIPL NvSciSync client types.
Definition: NvSIPLCamera.hpp:124
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:67
NvSIPLPlatformCfg.hpp
NVIDIA SIPL: Camera Platform Configuration
INvSIPLDeviceInterfaceProvider.hpp
NVIDIA SIPL: Device Interface Provider Interface
nvsipl::INvSIPLCamera::Init
virtual SIPLStatus Init()=0
Initialize the API for the selected platform configuration.
NvSIPLCameraTypes.hpp
nvsipl::INvSIPLCamera::Deinit
virtual SIPLStatus Deinit()=0
Deinitialize the API for the selected platform configuration.
nvsipl::AWB_THIRD_RATE
@ AWB_THIRD_RATE
Process AE and ISP every frame, AWB every 3rd frame.
Definition: NvSIPLCamera.hpp:161
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:143
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::INvSIPLCamera::RegisterNvSciSyncObj
virtual SIPLStatus RegisterNvSciSyncObj(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, NvSiplNvSciSyncObjType const syncobjtype, NvSciSyncObj const syncobj, uint32_t const vcIdx=0U)=0
Register an NvSciSyncObj.
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:133
nvsipl::NvSIPLPipelineQueues
This is the output structure for INvSIPLCamera::SetPipelineCfg().
Definition: NvSIPLPipelineMgr.hpp:735
nvsipl::INvSIPLCamera::GetModuleInterfaceProvider
virtual SIPLStatus GetModuleInterfaceProvider(uint32_t const index, IInterfaceProvider *&interfaceProvider)=0
Retrieve custom interface provider for module.
nvsipl::INvSIPLCamera::RegisterImages
virtual SIPLStatus RegisterImages(uint32_t const index, INvSIPLClient::ConsumerDesc::OutputType const outType, std::vector< NvSciBufObj > const &images, uint32_t const vcIdx=0U)=0
Register images.
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:454
NvSIPLPipelineMgr.hpp
NVIDIA SIPL: Pipeline Manager - NvSIPL Pipeline Manager
nvsipl::INvSIPLCamera
The top-level API for SIPL.
Definition: NvSIPLCamera.hpp:171
nvsipl::NITO_DATA_HASH_SIZE
static constexpr size_t NITO_DATA_HASH_SIZE
Size of the NITO Data Hash.
Definition: NvSIPLCamera.hpp:58
nvsipl::SIPL_SIGNALER
@ SIPL_SIGNALER
For a given NvSciSyncObj SIPL acts as a signaler.
Definition: NvSIPLCamera.hpp:129
nvsipl::INvSIPLCamera::operator=
INvSIPLCamera & operator=(INvSIPLCamera &other) &=delete
Delete copy assignment operator.
nvsipl::IInterfaceProvider
Class providing access to device interfaces.
Definition: INvSIPLDeviceInterfaceProvider.hpp:173
nvsipl::NvSiplNvSciSyncObjType
NvSiplNvSciSyncObjType
Defines SIPL NvSciSyncObj types.
Definition: NvSIPLCamera.hpp:139
nvsipl::FrameProcessingRate
FrameProcessingRate
Defines Auto Control and ISP processing rate options.
Definition: NvSIPLCamera.hpp:151
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::GetPipelineInterfaceProvider
virtual SIPLStatus GetPipelineInterfaceProvider(uint32_t const index, IInterfaceProvider *&interfaceProvider, uint32_t const vcIdx=0U) noexcept=0
Retrieve the custom interface provider for a sensor pipeline.
nvsipl::AWB_HALF_RATE
@ AWB_HALF_RATE
Process AE and ISP every frame, AWB every 2nd frame.
Definition: NvSIPLCamera.hpp:159
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:141
nvsipl::THIRD_RATE
@ THIRD_RATE
Process Auto Control (AE-AWB) and ISP every 3rd frame (third rate).
Definition: NvSIPLCamera.hpp:157
nvsipl
Contains the classes and variables for implementation of SIPL.
Definition: NvSIPLCameraQuery.hpp:22
nvsipl::NITO_SCHEMA_HASH_SIZE
static constexpr size_t NITO_SCHEMA_HASH_SIZE
Size of the NITO Schema Hash.
Definition: NvSIPLCamera.hpp:56
nvsipl::NvSIPLNitoMetadata::dataHash
uint8_t dataHash[NITO_DATA_HASH_SIZE]
Definition: NvSIPLCamera.hpp:68
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:64
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:66
nvsipl::NvSIPLDeviceBlockQueues
Holds the queues used by the client to receive device block event notifications.
Definition: NvSIPLPipelineMgr.hpp:768
nvsipl::INvSIPLCamera::Start
virtual SIPLStatus Start()=0
Begin streaming from all sensors in the selected platform configuration.