mirror of
git://nv-tegra.nvidia.com/tegra/v4l2-src/libv4l2_nvargus.git
synced 2025-12-22 09:23:09 +03:00
8e62a0e398b15aa8ea7ad8b63a8e55a2d34c22d4 - libv4l2_nvargus/libv4l2_nvargus.cpp 08591e4e7c932d134ab3b5de5608f79817f25b10 - libv4l2_nvargus/Makefile e5896289dc5cf1a1be97cd111bef4715314a657d - libv4l2_nvargus/README 430402509552450f933f97376dbb547425dc6a1e - libv4l2_nvargus/nvargusv4l2_argus.cpp 592bab81439af0cb17984e0b0e1d1b4b1a498ea2 - libv4l2_nvargus/nvargusv4l2_nvqueue.cpp 62ff489fd24d7e62098d8bd0b681f017a3f1ed89 - libv4l2_nvargus/nvargusv4l2_os.cpp 1600ff6fb81d3a5f53ed343576eae3fb530a7135 - libv4l2_nvargus/LICENSE.libv4l2_nvargus 2a8f761ddbd0acd63d41333cfd33c0130a68f986 - libv4l2_nvargus/nvargusv4l2.cpp 1b22fa15e66aeb472a541aa4fa9ee68b6f631fdf - libv4l2_nvargus/nvargusv4l2_context.cpp 138a72695eb516d82dba17bf87260fe5a692ec74 - libv4l2_nvargus/nvargusv4l2_ioctl.cpp 1522ea0088250fb7ce0c9f77c75dbca5d0f511f4 - libv4l2_nvargus/inc/nvargusv4l2.h 25353aa29a931dfc9f52054852b50d690716a64c - libv4l2_nvargus/inc/nvargusv4l2_nvqueue.h e0025b2f87abda4cd744e356e26cef85246a1fdc - libv4l2_nvargus/inc/nvargusv4l2_os.h d1c5f6e8cd188bbd39c99c32d4e4e68ee85e0f8b - libv4l2_nvargus/inc/nvargusv4l2_argus.h ebcc91d051727ba390d71db0887f788ffcfd8091 - libv4l2_nvargus/inc/nvargusv4l2_ioctl.h 553b571fc97552659847ad0b2bc6e34384724d29 - libv4l2_nvargus/inc/nvargusv4l2_context.h Change-Id: I73b0a66e76ad1efdadcd8ad249783ded6958131d
91 lines
3.6 KiB
C
91 lines
3.6 KiB
C
/*
|
|
* Copyright (c) 2020-2023, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
* DEALINGS IN THE SOFTWARE.
|
|
*/
|
|
|
|
#ifndef __NVARGUSV4L2_HELPER_H__
|
|
#define __NVARGUSV4L2_HELPER_H__
|
|
|
|
#include "nvargusv4l2_context.h"
|
|
#include "nvargusv4l2_ioctl.h"
|
|
|
|
#define TIMEOUT_FOUR_SECONDS 4000000000
|
|
#define TIMEOUT_TWO_SECONDS 2000000000
|
|
|
|
extern Argus::CameraProvider *g_cameraProvider;
|
|
extern Argus::ICameraProvider *g_iCameraProvider;
|
|
|
|
/* Returns the Argus status code in string */
|
|
const char* getStatusString(Argus::Status status);
|
|
|
|
/* Reads boolean variable atomically */
|
|
bool v4l2_cam_atomic_read_bool(v4l2_camera_context* ctx, bool *var);
|
|
|
|
/* Writes boolean variable atomically */
|
|
void v4l2_cam_atomic_write_bool(v4l2_camera_context* ctx, bool *var, bool value);
|
|
|
|
/* Return the value of the variable atomically */
|
|
uint32_t v4l2_cam_atomic_get(v4l2_camera_context *ctx, uint32_t *var);
|
|
|
|
/* Release Argus::Buffer with the given index to the stream */
|
|
int32_t ReleaseStreamBuffer(v4l2_camera_context *ctx, int32_t index);
|
|
|
|
/* Recieves pointer to the filled Argus::Buffer from the stream */
|
|
Argus::Buffer* AcquireStreamBuffer(v4l2_camera_context *ctx, uint32_t timeout);
|
|
|
|
/* Initializes the Argus::OutputStream */
|
|
int32_t initialize_outputstream(v4l2_camera_context *ctx, cam_params *argus_params);
|
|
|
|
/* Set all the Argus related properties and settings */
|
|
int32_t v4l2_cam_set_argus_settings(v4l2_camera_context *ctx, uint32_t ctrl_id);
|
|
|
|
/* Sets Frame Rate */
|
|
int32_t set_framerate(v4l2_camera_context *ctx, float frame_duration);
|
|
|
|
/* Sets Denoise Settings */
|
|
int32_t v4l2_cam_set_denoise_settings(v4l2_camera_context *ctx, uint32_t ctrl_id,
|
|
struct denoise_values *ctrl_value);
|
|
|
|
/* Allocates all capture queues */
|
|
int32_t allocate_all_capture_queues(v4l2_camera_context *ctx);
|
|
|
|
/* Allocates buffers in the memory (MMAP) */
|
|
int32_t allocate_capture_buffers(v4l2_camera_context *ctx, cam_params *argus_params);
|
|
|
|
/* Allocate argus buffers for DMABUF memory */
|
|
int32_t allocate_argus_buffers(v4l2_camera_context *ctx, cam_params *argus_params, int32_t dmabuf_fd, uint32_t buffer_idx);
|
|
|
|
/* Deallocates the previously alloacted buffers */
|
|
void free_cap_buffers(v4l2_camera_context *ctx);
|
|
|
|
/* Query the buffer */
|
|
int32_t query_cam_buffers(v4l2_camera_context *ctx, cam_params *argus_params, uint64_t *psizes);
|
|
|
|
/* Close camera context */
|
|
void v4l2_close_argus_context(v4l2_context *v4l2_ctx);
|
|
|
|
/* Queues the empty capture plane buffers to Argus */
|
|
int32_t nvargus_enqueue_instream_buffers_from_capture_inQ(v4l2_camera_context *ctx, int32_t idx);
|
|
|
|
/* Callback function to the argus_thread */
|
|
void argus_capture_thread_func(void *args);
|
|
|
|
#endif
|