Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.8.1
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other
Target Operating System
Linux
QNX
other
Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-300)
DRIVE AGX Orin Developer Kit (940-63710-0010-200)
DRIVE AGX Orin Developer Kit (940-63710-0010-100)
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other
SDK Manager Version
1.9.3.10904
other
Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other
It is not clear to me from the documentation if NvSciBufObjGetPixels is copying pixels or just returning a view. This snippet from sample code (CFileWriter.hpp) would imply it is doing an actual copy:
if (m_pBuff == nullptr) {
m_pBuff = new (std::nothrow) uint8_t[imageSize];
if (m_pBuff == nullptr) {
LOG_ERR("Out of memory\n");
return NVSIPL_STATUS_OUT_OF_MEMORY;
}
std::fill(m_pBuff, m_pBuff + imageSize, 0x00);
}
uint8_t *buffIter = m_pBuff;
for (uint32_t i = 0U; i < numSurfaces; i++) {
pBuff[i] = buffIter;
buffIter += (uint32_t)(height * yScalePtr[i] * pBuffPitches[i]);
}
if ((bufAttrs.needSwCacheCoherency) && (m_isRawOutput)) {
sciErr = NvSciBufObjFlushCpuCacheRange(bufPtr, 0U, bufAttrs.planePitches[0] * height);
CHK_NVSCISTATUS_AND_RETURN(sciErr, "NvSciBufObjFlushCpuCacheRange Failed");
}
sciErr = NvSciBufObjGetPixels(bufPtr, nullptr, (void **)pBuff, size, pBuffPitches); <------ copy?
CHK_NVSCISTATUS_AND_RETURN(sciErr, "NvSciBufObjGetPixels Failed");
for (uint32_t i = 0U; i < numSurfaces; i++) {
if (fwrite(pBuff[i], size[i], 1U, m_pOutFile) != 1U) {
LOG_ERR("File write failed\n");
return NVSIPL_STATUS_ERROR;
}
}
}
If it is copying - is there a function that just provides a view?