mirror of
git://nv-tegra.nvidia.com/tegra/gst-src/gst-nvv4l2camera.git
synced 2025-12-22 09:22:13 +03:00
Updating prebuilts and/or headers
e114dc3572c1d3ff56f1a5ad3114b94252fb6966 - gst-nvv4l2camera/Makefile ebface35fce001fdc5889214e11a84bf13cb5fde - gst-nvv4l2camera/3rdpartyheaders.tbz2 6e6ebff3d31c6038d6f6611c014f45f24377ca18 - gst-nvv4l2camera/gstnvv4l2camerasrc.cpp 6861c1f1059a2771ef0501014722328bbea6694a - gst-nvv4l2camera/gstnvv4l2camerasrc.hpp 88370b0b6feb1d5bce7a3de19b31a29334e21dfc - gst-nvv4l2camera/gstnvv4l2camerabufferpool.h Change-Id: Ie224a0bd39636d832608683a85dcef358ca95233
This commit is contained in:
7
commitFile.txt
Normal file
7
commitFile.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Updating prebuilts and/or headers
|
||||
|
||||
e114dc3572c1d3ff56f1a5ad3114b94252fb6966 - gst-nvv4l2camera/Makefile
|
||||
ebface35fce001fdc5889214e11a84bf13cb5fde - gst-nvv4l2camera/3rdpartyheaders.tbz2
|
||||
6e6ebff3d31c6038d6f6611c014f45f24377ca18 - gst-nvv4l2camera/gstnvv4l2camerasrc.cpp
|
||||
6861c1f1059a2771ef0501014722328bbea6694a - gst-nvv4l2camera/gstnvv4l2camerasrc.hpp
|
||||
88370b0b6feb1d5bce7a3de19b31a29334e21dfc - gst-nvv4l2camera/gstnvv4l2camerabufferpool.h
|
||||
BIN
gst-nvv4l2camera/3rdpartyheaders.tbz2
Normal file
BIN
gst-nvv4l2camera/3rdpartyheaders.tbz2
Normal file
Binary file not shown.
78
gst-nvv4l2camera/Makefile
Normal file
78
gst-nvv4l2camera/Makefile
Normal file
@@ -0,0 +1,78 @@
|
||||
# Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
SO_NAME := libgstnvv4l2camerasrc.so
|
||||
|
||||
CC := g++
|
||||
|
||||
TARGET_DEVICE = $(shell gcc -dumpmachine | cut -f1 -d -)
|
||||
|
||||
GST_INSTALL_DIR?=/usr/lib/aarch64-linux-gnu/gstreamer-1.0/
|
||||
LIB_INSTALL_DIR?=/usr/lib/aarch64-linux-gnu/tegra/
|
||||
CFLAGS:=
|
||||
LIBS:= -lnvbufsurface -lnvbufsurftransform
|
||||
|
||||
|
||||
SRCS := $(wildcard *.cpp)
|
||||
|
||||
INCLUDES += -I./ -I../
|
||||
|
||||
PKGS := gstreamer-1.0 \
|
||||
gstreamer-base-1.0 \
|
||||
gstreamer-video-1.0 \
|
||||
gstreamer-allocators-1.0 \
|
||||
glib-2.0 \
|
||||
libv4l2
|
||||
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
|
||||
CFLAGS += -fPIC \
|
||||
-DEXPLICITLY_ADDED=1 \
|
||||
-DGETTEXT_PACKAGE=1 \
|
||||
-DHAVE_LIBV4L2=1 \
|
||||
-DUSE_V4L2_TARGET_NV=1
|
||||
|
||||
CFLAGS += `pkg-config --cflags $(PKGS)`
|
||||
|
||||
LDFLAGS = -Wl,--no-undefined -L$(LIB_INSTALL_DIR) -Wl,-rpath,$(LIB_INSTALL_DIR)
|
||||
|
||||
LIBS += `pkg-config --libs $(PKGS)`
|
||||
|
||||
all: $(SO_NAME)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) -c $< $(CFLAGS) $(INCLUDES) -o $@
|
||||
|
||||
$(SO_NAME): $(OBJS)
|
||||
$(CC) -shared -o $(SO_NAME) $(OBJS) $(LIBS) $(LDFLAGS)
|
||||
|
||||
.PHONY: install
|
||||
install: $(SO_NAME)
|
||||
cp -vp $(SO_NAME) $(GST_INSTALL_DIR)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(OBJS) $(SO_NAME)
|
||||
49
gst-nvv4l2camera/README.txt
Normal file
49
gst-nvv4l2camera/README.txt
Normal file
@@ -0,0 +1,49 @@
|
||||
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# 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
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Steps to compile the "gst-nvv4l2camera" sources natively:
|
||||
|
||||
1) Install gstreamer related packages on target using the command:
|
||||
|
||||
sudo apt-get install libgstreamer1.0-dev \
|
||||
gstreamer1.0-plugins-base \
|
||||
gstreamer1.0-plugins-good \
|
||||
libgstreamer-plugins-base1.0-dev \
|
||||
libv4l-dev \
|
||||
libegl1-mesa-dev
|
||||
|
||||
2) Download and extract the package "gst-nvv4l2camera_src.tbz2" as follow:
|
||||
|
||||
tar -I lbzip2 -xvf gst-nvv4l2camera_src.tbz2
|
||||
|
||||
3) Run the following commands to build and install "libgstnvv4l2camerasrc.so":
|
||||
make
|
||||
make install
|
||||
or
|
||||
DEST_DIR=<dir> make install
|
||||
|
||||
Note: "make install" will copy library "libgstnvv4l2camerasrc.so"
|
||||
into "/usr/lib/aarch64-linux-gnu/gstreamer-1.0" directory.
|
||||
65
gst-nvv4l2camera/gstnvv4l2camerabufferpool.h
Normal file
65
gst-nvv4l2camera/gstnvv4l2camerabufferpool.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef GSTNVV4L2CAMERABUFFERPOOL_H_
|
||||
#define GSTNVV4L2CAMERABUFFERPOOL_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GstNvV4l2CameraBufferPool GstNvV4l2CameraBufferPool;
|
||||
typedef struct _GstNvV4l2CameraBufferPoolClass GstNvV4l2CameraBufferPoolClass;
|
||||
typedef struct _GstNvV4l2CameraBufferPoolPrivate GstNvV4l2CameraBufferPoolPrivate;
|
||||
|
||||
#define GST_TYPE_NVV4L2CAMERA_BUFFER_POOL (gst_nvv4l2camera_buffer_pool_get_type())
|
||||
#define GST_IS_NVV4L2CAMERA_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_NVV4L2CAMERA_BUFFER_POOL))
|
||||
#define GST_NVV4L2CAMERA_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_NVV4L2CAMERA_BUFFER_POOL, GstNvV4l2CameraBufferPool))
|
||||
#define GST_NVV4L2CAMERA_BUFFER_POOL_CAST(obj) ((GstNvV4l2CameraBufferPool*)(obj))
|
||||
|
||||
#define GST_NVV4L2_MEMORY_TYPE "nvV4l2Memory"
|
||||
|
||||
struct _GstNvV4l2CameraBufferPool
|
||||
{
|
||||
GstBufferPool bufferpool;
|
||||
GstNvV4l2CameraBufferPoolPrivate *priv;
|
||||
int video_fd;
|
||||
};
|
||||
|
||||
struct _GstNvV4l2CameraBufferPoolClass
|
||||
{
|
||||
GstBufferPoolClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_nvv4l2camera_buffer_pool_get_type (void);
|
||||
|
||||
GstBufferPool* gst_nvv4l2camera_buffer_pool_new (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* GSTNVV4L2CAMERABUFFERPOOL_H_ */
|
||||
1241
gst-nvv4l2camera/gstnvv4l2camerasrc.cpp
Normal file
1241
gst-nvv4l2camera/gstnvv4l2camerasrc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
111
gst-nvv4l2camera/gstnvv4l2camerasrc.hpp
Normal file
111
gst-nvv4l2camera/gstnvv4l2camerasrc.hpp
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2022, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __GST_NVV4L2CAMERASRC_H__
|
||||
#define __GST_NVV4L2CAMERASRC_H__
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* #defines don't like whitespacey bits */
|
||||
#define GST_TYPE_NVV4L2CAMERASRC \
|
||||
(gst_nv_v4l2_camera_src_get_type())
|
||||
#define GST_NVV4L2CAMERASRC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVV4L2CAMERASRC,GstNvV4l2CameraSrc))
|
||||
#define GST_NVV4L2CAMERASRC_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVV4L2CAMERASRC,GstNvV4l2CameraSrcClass))
|
||||
#define GST_IS_NVV4L2CAMERASRC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVV4L2CAMERASRC))
|
||||
#define GST_IS_NVV4L2CAMERASRC_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVV4L2CAMERASRC))
|
||||
|
||||
#define DEFAULT_PROP_DEVICE "/dev/video0"
|
||||
#define MIN_BUFFERS 6
|
||||
#define MAX_BUFFERS 16
|
||||
#define GST_NVV4L2_MEMORY_TYPE "nvV4l2Memory"
|
||||
#define DEQUE_TIMEOUT 5
|
||||
|
||||
|
||||
typedef struct _GstNvV4l2CameraSrc GstNvV4l2CameraSrc;
|
||||
typedef struct _GstNvV4l2CameraSrcClass GstNvV4l2CameraSrcClass;
|
||||
|
||||
typedef struct _GstNvV4l2CameraSrcBuffer GstNvV4l2CameraSrcBuffer;
|
||||
|
||||
/* NvV4l2CameraSrc buffer */
|
||||
struct _GstNvV4l2CameraSrcBuffer
|
||||
{
|
||||
gint dmabuf_fd;
|
||||
GstBuffer *gst_buf;
|
||||
NvBufSurface *surface;
|
||||
struct v4l2_buffer *buffer;
|
||||
};
|
||||
|
||||
struct _GstNvV4l2CameraSrc
|
||||
{
|
||||
GstBaseSrc base_nvv4l2camera;
|
||||
|
||||
GstPad *srcpad;
|
||||
|
||||
/* the video device */
|
||||
char *videodev;
|
||||
int video_fd;
|
||||
struct v4l2_capability *caps;
|
||||
struct v4l2_format *fmt;
|
||||
struct v4l2_requestbuffers *req;
|
||||
gint index;
|
||||
guint cap_buf;
|
||||
|
||||
GstBufferPool *pool;
|
||||
|
||||
GstCaps *outcaps;
|
||||
|
||||
gint width;
|
||||
gint height;
|
||||
gint fps_n;
|
||||
gint fps_d;
|
||||
gint field_order;
|
||||
|
||||
gboolean stop_requested;
|
||||
gboolean unlock_requested;
|
||||
gboolean interlaced_flag;
|
||||
fd_set read_set;
|
||||
struct timeval tv;
|
||||
};
|
||||
|
||||
struct _GstNvV4l2CameraSrcClass
|
||||
{
|
||||
GstBaseSrcClass base_nvv4l2camera_class;
|
||||
};
|
||||
|
||||
GType gst_nv_v4l2_camera_src_get_type (void);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GST_NVV4L2CAMERASRC_H__ */
|
||||
1
push_info.txt
Normal file
1
push_info.txt
Normal file
@@ -0,0 +1 @@
|
||||
jetson_38.2
|
||||
Reference in New Issue
Block a user