Compare commits

..

1 Commits

Author SHA1 Message Date
svcmobrel-release
0a0b3b7837 Updating prebuilts and/or headers
1be6fc0d7406e0633b7e2cba49166a2f0a085cdd - gst-nvarguscamera/Makefile
e310614224d9d26be54be52bfd512622b835afed - gst-nvarguscamera/3rdpartyheaders.tbz2
606c0ecfa180dc6018edd226b18d32a54cb62abc - gst-nvarguscamera/gstnvarguscamerasrc.hpp
dfad5fd023bad3d49ecdfcd13e493fa5a5023662 - gst-nvarguscamera/gstnvarguscamerasrc.cpp
f2949ff626879be5aaeabf40e9ad8eab11238b6e - gst-nvarguscamera/gstnvarguscamera_utils.h
cf95aafffccb74b1cef48bfdbe954fb0410dbe77 - gst-nvarguscamera/nvbufsurface.h
5b71a3ab30d24949dcf3770e509d17dd1af64256 - gst-nvarguscamera/gstnvarguscamera_utils.cpp
fa14f1cb043a26a6465ce793ac78479d8f6afa02 - gst-nvarguscamera/gstnvdsbufferpool.h

Change-Id: If78b521acbec516f2f2d384bf691f7a59a3b5b9a
2024-09-27 12:48:57 -07:00
6 changed files with 218 additions and 83 deletions

View File

@@ -1,10 +1,10 @@
Updating prebuilts and/or headers
ed8273ff6102bb0b4fa7975a401b12b3e95a7187 - gst-nvarguscamera/nvbufsurface.h
1be6fc0d7406e0633b7e2cba49166a2f0a085cdd - gst-nvarguscamera/Makefile
e310614224d9d26be54be52bfd512622b835afed - gst-nvarguscamera/3rdpartyheaders.tbz2
606c0ecfa180dc6018edd226b18d32a54cb62abc - gst-nvarguscamera/gstnvarguscamerasrc.hpp
dfad5fd023bad3d49ecdfcd13e493fa5a5023662 - gst-nvarguscamera/gstnvarguscamerasrc.cpp
f2949ff626879be5aaeabf40e9ad8eab11238b6e - gst-nvarguscamera/gstnvarguscamera_utils.h
cf95aafffccb74b1cef48bfdbe954fb0410dbe77 - gst-nvarguscamera/nvbufsurface.h
5b71a3ab30d24949dcf3770e509d17dd1af64256 - gst-nvarguscamera/gstnvarguscamera_utils.cpp
704bc9c630378dd0ab3da09d386464aaca369d05 - gst-nvarguscamera/gstnvarguscamerasrc.hpp
9fd26f352da599c05d8d648a43f9db533fa34a38 - gst-nvarguscamera/gstnvarguscamerasrc.cpp
148776e441cabf96340f87c88ba7ebd406ab0707 - gst-nvarguscamera/3rdpartyheaders.tbz2
fa14f1cb043a26a6465ce793ac78479d8f6afa02 - gst-nvarguscamera/gstnvdsbufferpool.h

View File

Binary file not shown.

View File

@@ -1,28 +1,30 @@
/*
* Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
* modification, are permitted provided that the following conditions are met:
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@@ -49,6 +51,7 @@
#include <EGLStream/NV/ImageNativeBuffer.h>
#include <iostream>
#include <fstream>
#include <map>
#include <math.h>
#include <pthread.h>
@@ -69,12 +72,7 @@
#define MIN_BUFFERS 6
#define MAX_BUFFERS 8
#define MIN_GAIN 1
#define MAX_GAIN 16
#define MIN_EXPOSURE_TIME 34000
#define MAX_EXPOSURE_TIME 358733000
// this is gain value applied by ISP, its default range is [1, 256].
#define MIN_DIGITAL_GAIN 1
#define MAX_DIGITAL_GAIN 256
@@ -351,11 +349,13 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
src->frameInfo = g_slice_new(NvArgusFrameInfo);
src->frameInfo->fd = -1;
src->captureIdMap.clear();
GError *error = NULL;
while (true)
{
Argus::Status frame_status;
Argus::EventType frame_event;
GError *error = NULL;
Event* event = NULL;
IEvent* iEvent = NULL;
static GQuark domain = g_quark_from_static_string ("NvArgusCameraSrc");
@@ -380,6 +380,7 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
event = (Event* )iEventQueue_ptr->getEvent(iEventQueue_ptr->getSize() - 1);
iEvent = (IEvent*)interface_cast<const IEvent>(event);
if (!iEvent)
{
src->argus_in_error = TRUE;
@@ -407,7 +408,10 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
}
else if (frame_event == EVENT_TYPE_CAPTURE_STARTED)
{
continue;
guint64 capture_id = iEvent->getCaptureId();
guint64 time = g_get_monotonic_time();
src->captureIdMap.insert(std::pair<guint64, guint64>(capture_id, time));
continue;
}
else if (frame_event == EVENT_TYPE_CAPTURE_COMPLETE)
{
@@ -563,12 +567,12 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
src->edgeEnhancementModePropSet = FALSE;
}
if(src->edgeEnhancementStrengthPropSet)
{
l_iEeSettings_ptr->setEdgeEnhanceStrength(src->controls.EdgeEnhancementStrength);
l_iCaptureSession->repeat(l_captureRequest);
src->edgeEnhancementStrengthPropSet = FALSE;
}
if(src->edgeEnhancementStrengthPropSet)
{
l_iEeSettings_ptr->setEdgeEnhanceStrength(src->controls.EdgeEnhancementStrength);
l_iCaptureSession->repeat(l_captureRequest);
src->edgeEnhancementStrengthPropSet = FALSE;
}
if(src->aeAntibandingPropSet)
{
@@ -596,6 +600,19 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
if(src->gainRangePropSet == TRUE)
{
if (src->controls.gainRange.low < sensorModeAnalogGainRange.min())
{
GST_ARGUS_PRINT("Invalid min gain value, using default minimum gain: %f instead.\n",
sensorModeAnalogGainRange.min());
src->controls.gainRange.low = sensorModeAnalogGainRange.min();
}
if (src->controls.gainRange.high > sensorModeAnalogGainRange.max())
{
GST_ARGUS_PRINT("Invalid max gain value, using default maximum gain: %f instead.\n",
sensorModeAnalogGainRange.max());
src->controls.gainRange.high = sensorModeAnalogGainRange.max();
}
sensorModeAnalogGainRange.min() = src->controls.gainRange.low;
sensorModeAnalogGainRange.max() = src->controls.gainRange.high;
l_iRequestSourceSettings_ptr->setGainRange(sensorModeAnalogGainRange);
@@ -614,6 +631,19 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
if(src->exposureTimePropSet == TRUE)
{
if (src->controls.exposureTimeRange.low < limitExposureTimeRange.min())
{
GST_ARGUS_PRINT("Invalid min exp value, using default minimum exp: %ju instead.\n",
limitExposureTimeRange.min());
src->controls.exposureTimeRange.low = limitExposureTimeRange.min();
}
if (src->controls.exposureTimeRange.high > limitExposureTimeRange.max())
{
GST_ARGUS_PRINT("Invalid max exp value, using default maximum exp: %ju instead.\n",
limitExposureTimeRange.max());
src->controls.exposureTimeRange.high = limitExposureTimeRange.max();
}
limitExposureTimeRange.min() = src->controls.exposureTimeRange.low;
limitExposureTimeRange.max() = src->controls.exposureTimeRange.high;
l_iRequestSourceSettings_ptr->setExposureTimeRange(limitExposureTimeRange);
@@ -675,6 +705,8 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
src->frameInfo->frameNum = iFrame->getNumber();
src->frameInfo->frameTime = iFrame->getTime();
src->frameInfo->captureTime = src->captureIdMap[iFrame->getNumber()];
src->captureIdMap.erase(iFrame->getNumber());
g_mutex_lock (&src->argus_buffers_queue_lock);
g_queue_push_tail (src->argus_buffers, (src->frameInfo));
@@ -709,6 +741,9 @@ bool StreamConsumer::threadExecute(GstNvArgusCameraSrc *src)
g_slice_free (NvArgusFrameInfo, src->frameInfo);
if (error)
g_error_free(error);
if (!src->argus_in_error)
{
CONSUMER_PRINT("Done Success\n");
@@ -1095,6 +1130,19 @@ static bool execute(int32_t cameraIndex,
if(src->exposureTimePropSet == TRUE)
{
if (src->controls.exposureTimeRange.low < limitExposureTimeRange.min())
{
GST_ARGUS_PRINT("Invalid min exp value, using default minimum exp: %ju instead.\n",
limitExposureTimeRange.min());
src->controls.exposureTimeRange.low = limitExposureTimeRange.min();
}
if (src->controls.exposureTimeRange.high > limitExposureTimeRange.max())
{
GST_ARGUS_PRINT("Invalid max exp value, using default maximum exp: %ju instead.\n",
limitExposureTimeRange.max());
src->controls.exposureTimeRange.high = limitExposureTimeRange.max();
}
limitExposureTimeRange.min() = src->controls.exposureTimeRange.low;
limitExposureTimeRange.max() = src->controls.exposureTimeRange.high;
requestSourceSettings->setExposureTimeRange(limitExposureTimeRange);
@@ -1103,6 +1151,19 @@ static bool execute(int32_t cameraIndex,
if(src->gainRangePropSet == TRUE)
{
if (src->controls.gainRange.low < sensorModeAnalogGainRange.min())
{
GST_ARGUS_PRINT("Invalid min gain value, using default minimum gain: %f instead.\n",
sensorModeAnalogGainRange.min());
src->controls.gainRange.low = sensorModeAnalogGainRange.min();
}
if (src->controls.gainRange.high > sensorModeAnalogGainRange.max())
{
GST_ARGUS_PRINT("Invalid max gain value, using default maximum gain: %f instead.\n",
sensorModeAnalogGainRange.max());
src->controls.gainRange.high = sensorModeAnalogGainRange.max();
}
sensorModeAnalogGainRange.min() = src->controls.gainRange.low;
sensorModeAnalogGainRange.max() = src->controls.gainRange.high;
requestSourceSettings->setGainRange(sensorModeAnalogGainRange);
@@ -1221,6 +1282,7 @@ enum
{
PROP_0,
PROP_SILENT,
PROP_SHOW_LATENCY,
PROP_TIMEOUT,
PROP_WHITE_BALANCE,
PROP_SATURATION,
@@ -1342,7 +1404,6 @@ gst_nv_memory_allocator_alloc (GstAllocator * allocator,
mem = g_slice_new0 (GstNVArgusMemory);
nvbuf = g_slice_new0 (GstNvArgusCameraSrcBuffer);
{
input_params.params.width = self->width;
input_params.params.height = self->height;
@@ -1449,7 +1510,7 @@ static GstCaps * gst_nv_argus_camera_fixate (GstBaseSrc *src, GstCaps *caps)
static gboolean gst_nv_argus_camera_set_caps (GstBaseSrc *base, GstCaps *caps)
{
GstVideoInfo info;
GstVideoInfo info = {0};
GstCaps *old;
GstNvArgusCameraSrc *src = GST_NVARGUSCAMERASRC (base);
// write own allocator here
@@ -1481,18 +1542,22 @@ static gboolean gst_nv_argus_camera_set_caps (GstBaseSrc *base, GstCaps *caps)
gst_object_unref (src->pool);
src->pool = NULL;
}
src->pool = gst_nvds_buffer_pool_new();
GstStructure *config = gst_buffer_pool_get_config (src->pool);
gst_buffer_pool_config_set_params (config, src->outcaps, sizeof(NvBufSurface), MIN_BUFFERS, MAX_BUFFERS);
gst_structure_set (config,
"memtype", G_TYPE_UINT, NVBUF_MEM_DEFAULT,
"memtag", G_TYPE_UINT, NvBufSurfaceTag_CAMERA,
"gpu-id", G_TYPE_UINT, 0,
"batch-size", G_TYPE_UINT, 1, NULL);
gst_buffer_pool_set_config (src->pool, config);
src->argus_buffers = g_queue_new ();
src->nvmm_buffers = g_queue_new ();
gst_buffer_pool_set_active (src->pool, TRUE);
src->pool = gst_buffer_pool_new();
GstNVArgusMemoryAllocator *allocator =
(GstNVArgusMemoryAllocator *)g_object_new(gst_nv_memory_allocator_get_type(), NULL);
allocator->owner = src;
GstStructure *config = gst_buffer_pool_get_config(src->pool);
gst_buffer_pool_config_set_allocator(config, GST_ALLOCATOR(allocator), NULL);
gst_buffer_pool_config_set_params(config, NULL, sizeof(NvBufSurface), MIN_BUFFERS, MAX_BUFFERS);
gst_buffer_pool_set_config(src->pool, config);
src->argus_buffers = g_queue_new();
src->nvmm_buffers = g_queue_new();
gst_buffer_pool_set_active(src->pool, TRUE);
gst_object_unref(allocator);
src->consumer_thread = g_thread_new ("consumer_thread", consumer_thread, src);
@@ -1566,7 +1631,7 @@ static gboolean gst_nv_argus_camera_stop (GstBaseSrc * src_base)
}
g_thread_join(src->consumer_thread);
while (!g_queue_is_empty (src->nvmm_buffers)) {
while (!g_queue_is_empty (src->nvmm_buffers)) {
buf = (GstBuffer *) g_queue_pop_head (src->nvmm_buffers);
gst_buffer_unref (buf);
}
@@ -1685,14 +1750,34 @@ consumer_thread (gpointer src_base)
goto done;
}
mem = gst_buffer_peek_memory (buffer, 0);
GstMapInfo outmap = GST_MAP_INFO_INIT;
if (!mem) {
GST_ERROR_OBJECT(src, "no memory block");
GstNVArgusMemory *nv_mem = NULL;
mem = gst_buffer_peek_memory(buffer, 0);
GstMiniObject *miniobj = NULL;
nv_mem = (GstNVArgusMemory *)mem;
nv_mem->auxData.frame_num = consumerFrameInfo->frameNum;
nv_mem->auxData.timestamp = consumerFrameInfo->frameTime;
miniobj = GST_MINI_OBJECT_CAST(buffer);
if (gst_mini_object_is_writable(miniobj))
gst_mini_object_set_qdata(miniobj,
gst_buffer_metadata_quark, &((GstNVArgusMemory *)mem)->auxData, NULL);
if (consumerFrameInfo->fd == 0)
{
g_mutex_lock(&src->argus_buffer_consumed_lock);
g_cond_signal(&src->argus_buffer_consumed_cond);
src->is_argus_buffer_consumed = TRUE;
g_mutex_unlock(&src->argus_buffer_consumed_lock);
goto done;
}
NvBufSurface *surf = 0;
retn = NvBufSurfaceFromFd(nv_mem->nvcam_buf->dmabuf_fd, (void **)(&surf));
if (retn != 0) {
GST_ERROR_OBJECT(src, "NvBufSurfaceFromFd Failed");
goto done;
}
gst_buffer_map (buffer, &outmap, GST_MAP_WRITE);
NvBufSurface* surf = (NvBufSurface *)outmap.data;
NvBufSurface *nvbuf_surf = 0;
retn = NvBufSurfaceFromFd(consumerFrameInfo->fd, (void**)(&nvbuf_surf));
@@ -1701,6 +1786,7 @@ consumer_thread (gpointer src_base)
goto done;
}
retn = NvBufSurfTransform(nvbuf_surf, surf, &src->transform_params);
g_mutex_lock (&src->argus_buffer_consumed_lock);
g_cond_signal (&src->argus_buffer_consumed_cond);
src->is_argus_buffer_consumed = TRUE;
@@ -1711,7 +1797,11 @@ consumer_thread (gpointer src_base)
goto done;
}
gst_buffer_unmap (buffer, &outmap);
if (src->show_latency)
{
double latency = (g_get_monotonic_time() - consumerFrameInfo->captureTime)/1000.0;
GST_DEBUG_OBJECT (src, "capture id %lu latency %.2lf ms", consumerFrameInfo->frameNum, latency);
}
g_mutex_lock (&src->nvmm_buffers_queue_lock);
g_queue_push_tail (src->nvmm_buffers, buffer);
@@ -1831,22 +1921,12 @@ static gboolean set_range (GstNvArgusCameraSrc *src, guint prop_id)
{
if(prop_id == PROP_GAIN_RANGE)
{
if (array[0] < MIN_GAIN || array[1] > MAX_GAIN) {
GST_ARGUS_PRINT("Invalid Gain Range Input\n");
ret = FALSE;
goto done;
}
range.low = array[0];
range.high = array[1];
src->controls.gainRange = range;
}
else if(prop_id == PROP_EXPOSURE_TIME_RANGE)
{
if (array[0] < MIN_EXPOSURE_TIME || array[1] > MAX_EXPOSURE_TIME) {
GST_ARGUS_PRINT("Invalid Exposure Time Range Input\n");
ret = FALSE;
goto done;
}
range.low = array[0];
range.high = array[1];
src->controls.exposureTimeRange = range;
@@ -1977,6 +2057,11 @@ gst_nv_argus_camera_src_class_init (GstNvArgusCameraSrcClass * klass)
g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?",
FALSE, (GParamFlags) G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_SHOW_LATENCY,
g_param_spec_boolean ("show-latency", "show-latency",
"Show capture latency between start of frame and GstBuffer push",
FALSE, (GParamFlags) G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_TIMEOUT,
g_param_spec_uint ("timeout", "timeout",
"timeout to capture in seconds (Either specify timeout or num-buffers, not both)",
@@ -2030,7 +2115,7 @@ gst_nv_argus_camera_src_class_init (GstNvArgusCameraSrcClass * klass)
"\t\t\tUse string with values of ISP Digital Gain Range (low, high)\n"
"\t\t\tin that order, to set the property.\n"
"\t\t\teg: ispdigitalgainrange=\"1 8\"",
NVARGUSCAM_DEFAULT_GAIN_RANGE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
NVARGUSCAM_DEFAULT_DIGITAL_GAIN_RANGE, (GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)));
g_object_class_install_property (gobject_class, PROP_TNR_STRENGTH,
g_param_spec_float ("tnr-strength", "TNR Strength",
@@ -2115,6 +2200,7 @@ gst_nv_argus_camera_src_init (GstNvArgusCameraSrc * src)
src->stop_requested = FALSE;
src->unlock_requested = FALSE;
src->silent = TRUE;
src->show_latency = FALSE;
src->outcaps = NULL;
src->timeout = 0;
src->event_timeout = DEFAULT_WAIT_FOR_EVENT_TIMEOUT;
@@ -2181,6 +2267,10 @@ static void gst_nv_argus_camera_src_finalize (GObject *object)
g_free (src->ispDigitalGainRangeString);
src->ispDigitalGainRangeString = NULL;
}
if(src->outcaps) {
gst_caps_unref (src->outcaps);
src->outcaps = NULL;
}
}
static void
@@ -2194,6 +2284,9 @@ gst_nv_argus_camera_src_set_property (GObject * object, guint prop_id,
case PROP_SILENT:
src->silent = g_value_get_boolean (value);
break;
case PROP_SHOW_LATENCY:
src->show_latency = g_value_get_boolean (value);
break;
case PROP_TIMEOUT:
src->timeout = g_value_get_uint (value);
break;
@@ -2326,6 +2419,9 @@ gst_nv_argus_camera_src_get_property (GObject * object, guint prop_id,
case PROP_SILENT:
g_value_set_boolean (value, src->silent);
break;
case PROP_SHOW_LATENCY:
g_value_set_boolean (value, src->show_latency);
break;
case PROP_TIMEOUT:
g_value_set_uint (value, src->timeout);
break;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -113,6 +113,7 @@ typedef struct NvArgusFrameInfo
gint fd;
guint64 frameNum;
guint64 frameTime;
guint64 captureTime;
} NvArgusFrameInfo;
struct _GstNvArgusCameraSrc
@@ -125,6 +126,7 @@ struct _GstNvArgusCameraSrc
GThread *argus_thread;
gboolean silent;
gboolean show_latency;
GstBufferPool *pool;
@@ -204,6 +206,9 @@ struct _GstNvArgusCameraSrc
Argus::UniqueObj<Argus::OutputStreamSettings> streamSettings;
Argus::UniqueObj<Argus::Request> request;
NvArgusFrameInfo *frameInfo;
/* Key: capture id, value: timestamp */
std::map<guint64, guint64> captureIdMap;
};
struct _GstNvArgusCameraSrcClass

View File

@@ -1,11 +1,12 @@
/*
* Copyright (c) 2019-2023, NVIDIA CORPORATION. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: LicenseRef-NvidiaProprietary
*
* NVIDIA Corporation and its licensors retain all intellectual property
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this software and related documentation without an express
* license agreement from NVIDIA Corporation is strictly prohibited.
* license agreement from NVIDIA CORPORATION is strictly prohibited.
*/
/**
@@ -30,6 +31,9 @@
#include <stdint.h>
#include <stdbool.h>
#ifdef __ANDROID__
#include <cutils/native_handle.h>
#endif
#ifdef __cplusplus
extern "C"
@@ -278,6 +282,16 @@ typedef enum
NVBUF_COLOR_FORMAT_NV12_12LE_709,
/** Specifies BT.709 colorspace - Y/CbCr ER 4:2:0 12-bit multi-planar. */
NVBUF_COLOR_FORMAT_NV12_12LE_709_ER,
/** Specifies 8 bit GRAY scale ER - single plane */
NVBUF_COLOR_FORMAT_GRAY8_ER,
/** Specifies BT.709 colorspace - Y/CbCr 4:2:2 planar */
NVBUF_COLOR_FORMAT_UYVY_709,
/** Specifies BT.709 colorspace - Y/CbCr ER 4:2:2 planar */
NVBUF_COLOR_FORMAT_UYVY_709_ER,
/** Specifies BT.2020 colorspace - Y/CbCr 4:2:2 planar */
NVBUF_COLOR_FORMAT_UYVY_2020,
/** Specifies 16 bit GRAY scale - single plane */
NVBUF_COLOR_FORMAT_GRAY16_LE,
NVBUF_COLOR_FORMAT_LAST
} NvBufSurfaceColorFormat;
@@ -341,8 +355,9 @@ typedef struct NvBufSurfacePlaneParamsEx
uint32_t physicaladdress[NVBUF_MAX_PLANES];
/** flags associated with planes */
uint64_t flags[NVBUF_MAX_PLANES];
void * _reserved[STRUCTURE_PADDING * NVBUF_MAX_PLANES];
/** DRM modifier for plane */
uint64_t drmModifier[NVBUF_MAX_PLANES];
void * _reserved[(STRUCTURE_PADDING - 1) * NVBUF_MAX_PLANES];
} NvBufSurfacePlaneParamsEx;
/**
@@ -371,6 +386,10 @@ typedef struct NvBufSurfacePlaneParams
/**
* Holds Chroma Subsampling parameters for NvBufSurface allocation.
* The members chromaLocHoriz and chromaLocVert accept these values:
* 0: Left horizontal or top vertical position
* 1: Center horizontal or center vertical position
* 2: Right horizontal or bottom vertical position
*/
typedef struct NvBufSurfaceChromaSubsamplingParams
{
@@ -699,7 +718,7 @@ int NvBufSurfaceCopy (NvBufSurface *srcSurf, NvBufSurface *dstSurf);
* This function can be used to copy plane memory content from source raw buffer pointer
* to specific destination batch buffer of supported memory type.
*
* @param[in] surf pointer to NvBufSurface structure.
* @param[in] Surf pointer to NvBufSurface structure.
* @param[in] index index of buffer in the batch.
* @param[in] plane index of plane in buffer.
* @param[in] out_width aligned width of the raw data plane.
@@ -708,7 +727,7 @@ int NvBufSurfaceCopy (NvBufSurface *srcSurf, NvBufSurface *dstSurf);
*
* @return 0 for success, -1 for failure.
*/
int NvBufSurface2Raw (NvBufSurface *Surf, unsigned int index, unsigned int plane, unsigned int outwidth, unsigned int outheight, unsigned char *ptr);
int NvBufSurface2Raw (NvBufSurface *Surf, unsigned int index, unsigned int plane, unsigned int out_width, unsigned int out_height, unsigned char *ptr);
/**
* \brief Copies the raw buffer plane memory content to the NvBufSurface plane memory of a specific
@@ -722,11 +741,11 @@ int NvBufSurface2Raw (NvBufSurface *Surf, unsigned int index, unsigned int plane
* @param[in] plane index of plane in buffer.
* @param[in] in_width aligned width of the raw data plane.
* @param[in] in_height aligned height of the raw data plane.
* @param[in] surf pointer to NvBufSurface structure.
* @param[in] Surf pointer to NvBufSurface structure.
*
* @return 0 for success, -1 for failure.
*/
int Raw2NvBufSurface (unsigned char *ptr, unsigned int index, unsigned int plane, unsigned int inwidth, unsigned int inheight, NvBufSurface *Surf);
int Raw2NvBufSurface (unsigned char *ptr, unsigned int index, unsigned int plane, unsigned int in_width, unsigned int in_height, NvBufSurface *Surf);
/**
* Syncs the HW memory cache for the CPU.
@@ -848,6 +867,21 @@ int NvBufSurfaceImport (NvBufSurface **out_nvbuf_surf, const NvBufSurfaceMapPara
*
* @return 0 for success, -1 for failure.
*/
#ifdef __ANDROID__
/**
* Extracts the surface from android native buffer handle. Returns the DMA buffer FD for the surface.
* Fills the extended parameters which are extracted from surface.
*
* @param[out] out_dmabuf_fd Returns the Output hardware DMABUF FD.
* @param[in] handle Android native buffer handle.
* @param[out] exparams A pointer to the structure to fill with extended parameters.
*
* @returns 0 for success, -1 for failure
*/
int NvBufSurfaceImportGraphicBufferFd(int *out_dmabuf_fd, buffer_handle_t *handle, NvBufSurfaceMapParams *exparams);
#endif
int NvBufSurfaceGetMapParams (const NvBufSurface *surf, int index, NvBufSurfaceMapParams *params);
/** @} */

View File

@@ -1 +1 @@
jetson_35.5_APT1
jetson_36.4