NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _GST_NV_VIDEO_TEST_SRC_H_
19 #define _GST_NV_VIDEO_TEST_SRC_H_
20 
21 #undef __noinline__
22 
23 #include <stdio.h>
24 #include <gst/gst.h>
25 #include <gst/base/base.h>
26 #include <gst/video/video.h>
27 
28 #if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
29  #define __noinline__ __attribute__((noinline))
30 #endif
31 
32 #include <nvbufsurface.h>
33 
34 G_BEGIN_DECLS
35 
36 #define GST_TYPE_NV_VIDEO_TEST_SRC (gst_nv_video_test_src_get_type())
37 #define GST_NV_VIDEO_TEST_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_NV_VIDEO_TEST_SRC, GstNvVideoTestSrc))
38 #define GST_NV_VIDEO_TEST_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_NV_VIDEO_TEST_SRC, GstNvVideoTestSrcClass))
39 #define GST_IS_NV_VIDEO_TEST_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_NV_VIDEO_TEST_SRC))
40 #define GST_IS_NV_VIDEO_TEST_SRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_NV_VIDEO_TEST_SRC))
41 
42 typedef enum {
47 
48 typedef enum {
53 
56 
58  GstPushSrc parent;
59 
60  // Plugin parameters.
63  guint gpu_id;
65  gboolean enable_rdma;
67 
68  // Stream details set during caps negotiation.
69  GstCaps *caps;
70  GstVideoInfo info;
71 
72  // Runtime state.
73  GstClockTime running_time;
75 
77  unsigned int cuda_block_size;
78  unsigned int cuda_num_blocks;
80 
81  // File read related
82  gchar *filename; /* filename */
83  FILE *file_handle;
84  guint64 read_position; /* position of fd */
85  NvBufSurface *file_read_surface = NULL; /* surface for file read */
86  gboolean file_loop;
87 
88  // Jitter related
89  guint max_jitter = 0; // max jitter in ms
90  GstClockTime last_buffer_start_timestamp = 0;
91  void *p_fixed_jitter_list = NULL;
92 };
93 
95  GstPushSrcClass parent_class;
96 };
97 
99 
100 G_END_DECLS
101 
102 #endif
_GstNvVideoTestSrc::pattern
GstNvVideoTestSrcPattern pattern
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:61
GstNvVideoTestSrcPattern
GstNvVideoTestSrcPattern
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:42
_GstNvVideoTestSrc::parent
GstPushSrc parent
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:58
NvBufSurface
Holds information about batched buffers.
Definition: sources/includes/nvbufsurface.h:597
GST_NV_VIDEO_TEST_SRC_MANDELBROT
@ GST_NV_VIDEO_TEST_SRC_MANDELBROT
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:44
_GstNvVideoTestSrc
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:57
_GstNvVideoTestSrc::info
GstVideoInfo info
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:70
GST_NV_VIDEO_TEST_SRC_WALL_TIME
@ GST_NV_VIDEO_TEST_SRC_WALL_TIME
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:50
GstNvVideoTestSrcAnimationMode
GstNvVideoTestSrcAnimationMode
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:48
_GstNvVideoTestSrc::caps
GstCaps * caps
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:69
_GstNvVideoTestSrc::p_fixed_jitter_list
void * p_fixed_jitter_list
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:91
_GstNvVideoTestSrc::filename
gchar * filename
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:82
_GstNvVideoTestSrc::file_handle
FILE * file_handle
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:83
_GstNvVideoTestSrc::filled_frames
guint filled_frames
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:74
_GstNvVideoTestSrc::file_read_surface
NvBufSurface * file_read_surface
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:85
_GstNvVideoTestSrc::max_jitter
guint max_jitter
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:89
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: sources/includes/nvbufsurface.h:562
_GstNvVideoTestSrc::cuda_block_size
unsigned int cuda_block_size
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:77
_GstNvVideoTestSrc::animation_mode
GstNvVideoTestSrcAnimationMode animation_mode
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:62
_GstNvVideoTestSrc::cuda_fill_image
void(* cuda_fill_image)(GstNvVideoTestSrc *src)
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:79
_GstNvVideoTestSrc::gpu_id
guint gpu_id
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:63
_GstNvVideoTestSrc::file_loop
gboolean file_loop
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:86
_GstNvVideoTestSrcClass
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:94
_GstNvVideoTestSrc::cuda_surf
NvBufSurfaceParams * cuda_surf
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:76
NvBufSurfaceMemType
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: sources/includes/nvbufsurface.h:350
gst_nv_video_test_src_get_type
GType gst_nv_video_test_src_get_type(void)
_GstNvVideoTestSrc::running_time
GstClockTime running_time
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:73
_GstNvVideoTestSrc::last_buffer_start_timestamp
GstClockTime last_buffer_start_timestamp
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:90
GST_NV_VIDEO_TEST_SRC_FRAMES
@ GST_NV_VIDEO_TEST_SRC_FRAMES
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:49
_GstNvVideoTestSrcClass::parent_class
GstPushSrcClass parent_class
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:95
_GstNvVideoTestSrc::cuda_num_blocks
unsigned int cuda_num_blocks
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:78
_GstNvVideoTestSrc::enable_rdma
gboolean enable_rdma
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:65
_GstNvVideoTestSrc::horizontal_speed
gint horizontal_speed
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:66
GST_NV_VIDEO_TEST_SRC_RUNNING_TIME
@ GST_NV_VIDEO_TEST_SRC_RUNNING_TIME
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:51
_GstNvVideoTestSrc::memtype
NvBufSurfaceMemType memtype
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:64
_GstNvVideoTestSrc::read_position
guint64 read_position
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:84
GST_NV_VIDEO_TEST_SRC_GRADIENT
@ GST_NV_VIDEO_TEST_SRC_GRADIENT
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:45
GST_NV_VIDEO_TEST_SRC_SMPTE
@ GST_NV_VIDEO_TEST_SRC_SMPTE
Definition: sources/gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:43