NVIDIA DeepStream SDK API Reference

8.0 Release
gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2025 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 
13 #ifndef _GST_NV_VIDEO_TEST_SRC_H_
14 #define _GST_NV_VIDEO_TEST_SRC_H_
15 
16 #undef __noinline__
17 
18 #include <stdio.h>
19 #include <gst/gst.h>
20 #include <gst/base/base.h>
21 #include <gst/video/video.h>
22 
23 #if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
24  #define __noinline__ __attribute__((noinline))
25 #endif
26 
27 #include <nvbufsurface.h>
28 
29 G_BEGIN_DECLS
30 
31 #define GST_TYPE_NV_VIDEO_TEST_SRC (gst_nv_video_test_src_get_type())
32 #define GST_NV_VIDEO_TEST_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_NV_VIDEO_TEST_SRC, GstNvVideoTestSrc))
33 #define GST_NV_VIDEO_TEST_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_NV_VIDEO_TEST_SRC, GstNvVideoTestSrcClass))
34 #define GST_IS_NV_VIDEO_TEST_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_NV_VIDEO_TEST_SRC))
35 #define GST_IS_NV_VIDEO_TEST_SRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_NV_VIDEO_TEST_SRC))
36 
37 typedef enum {
42 
43 typedef enum {
48 
51 
53  GstPushSrc parent;
54 
55  // Plugin parameters.
58  guint gpu_id;
60  gboolean enable_rdma;
62 
63  // Stream details set during caps negotiation.
64  GstCaps *caps;
65  GstVideoInfo info;
66 
67  // Runtime state.
68  GstClockTime running_time;
70 
72  unsigned int cuda_block_size;
73  unsigned int cuda_num_blocks;
75 
76  // File read related
77  gchar *filename; /* filename */
78  FILE *file_handle;
79  guint64 read_position; /* position of fd */
80  NvBufSurface *file_read_surface = NULL; /* surface for file read */
81  gboolean file_loop;
82 
83  // Jitter related
84  guint max_jitter = 0; // max jitter in ms
85  GstClockTime last_buffer_start_timestamp = 0;
86  void *p_fixed_jitter_list = NULL;
87 };
88 
90  GstPushSrcClass parent_class;
91 };
92 
94 
95 G_END_DECLS
96 
97 #endif
_GstNvVideoTestSrc::pattern
GstNvVideoTestSrcPattern pattern
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:56
_GstNvVideoTestSrc::parent
GstPushSrc parent
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:53
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:577
GstNvVideoTestSrcAnimationMode
GstNvVideoTestSrcAnimationMode
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:43
_GstNvVideoTestSrc
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:52
_GstNvVideoTestSrc::info
GstVideoInfo info
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:65
GST_NV_VIDEO_TEST_SRC_GRADIENT
@ GST_NV_VIDEO_TEST_SRC_GRADIENT
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:40
GST_NV_VIDEO_TEST_SRC_SMPTE
@ GST_NV_VIDEO_TEST_SRC_SMPTE
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:38
_GstNvVideoTestSrc::caps
GstCaps * caps
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:64
_GstNvVideoTestSrc::p_fixed_jitter_list
void * p_fixed_jitter_list
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:86
_GstNvVideoTestSrc::filename
gchar * filename
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:77
_GstNvVideoTestSrc::file_handle
FILE * file_handle
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:78
_GstNvVideoTestSrc::filled_frames
guint filled_frames
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:69
_GstNvVideoTestSrc::file_read_surface
NvBufSurface * file_read_surface
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:80
_GstNvVideoTestSrc::max_jitter
guint max_jitter
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:84
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: nvbufsurface.h:542
_GstNvVideoTestSrc::cuda_block_size
unsigned int cuda_block_size
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:72
_GstNvVideoTestSrc::animation_mode
GstNvVideoTestSrcAnimationMode animation_mode
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:57
_GstNvVideoTestSrc::cuda_fill_image
void(* cuda_fill_image)(GstNvVideoTestSrc *src)
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:74
_GstNvVideoTestSrc::gpu_id
guint gpu_id
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:58
GST_NV_VIDEO_TEST_SRC_FRAMES
@ GST_NV_VIDEO_TEST_SRC_FRAMES
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:44
_GstNvVideoTestSrc::file_loop
gboolean file_loop
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:81
gst_nv_video_test_src_get_type
GType gst_nv_video_test_src_get_type(void)
_GstNvVideoTestSrcClass
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:89
GST_NV_VIDEO_TEST_SRC_MANDELBROT
@ GST_NV_VIDEO_TEST_SRC_MANDELBROT
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:39
_GstNvVideoTestSrc::cuda_surf
NvBufSurfaceParams * cuda_surf
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:71
NvBufSurfaceMemType
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:332
_GstNvVideoTestSrc::running_time
GstClockTime running_time
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:68
_GstNvVideoTestSrc::last_buffer_start_timestamp
GstClockTime last_buffer_start_timestamp
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:85
_GstNvVideoTestSrcClass::parent_class
GstPushSrcClass parent_class
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:90
_GstNvVideoTestSrc::cuda_num_blocks
unsigned int cuda_num_blocks
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:73
GstNvVideoTestSrcPattern
GstNvVideoTestSrcPattern
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:37
_GstNvVideoTestSrc::enable_rdma
gboolean enable_rdma
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:60
GST_NV_VIDEO_TEST_SRC_WALL_TIME
@ GST_NV_VIDEO_TEST_SRC_WALL_TIME
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:45
_GstNvVideoTestSrc::horizontal_speed
gint horizontal_speed
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:61
GST_NV_VIDEO_TEST_SRC_RUNNING_TIME
@ GST_NV_VIDEO_TEST_SRC_RUNNING_TIME
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:46
_GstNvVideoTestSrc::memtype
NvBufSurfaceMemType memtype
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:59
_GstNvVideoTestSrc::read_position
guint64 read_position
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:79
nvbufsurface.h