NVIDIA DeepStream SDK API Reference

7.1 Release
includes/gstnvvideotestsrc.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2023 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 
52 struct _GstNvVideoTestSrc {
53  GstPushSrc parent;
54 
55  // Plugin parameters.
58  guint gpu_id;
60  gboolean enable_rdma;
61 
62  // Stream details set during caps negotiation.
63  GstCaps *caps;
64  GstVideoInfo info;
65 
66  // Runtime state.
67  GstClockTime running_time;
68  guint filled_frames;
69 
71  unsigned int cuda_block_size;
72  unsigned int cuda_num_blocks;
73  void (*cuda_fill_image)(GstNvVideoTestSrc *src);
74 
75  // File read related
76  gchar *filename; /* filename */
77  FILE *file_handle;
78  guint64 read_position; /* position of fd */
79  NvBufSurface *file_read_surface = NULL; /* surface for file read */
80  gboolean file_loop;
81 
82  // Jitter related
83  guint max_jitter = 0; // max jitter in ms
84  GstClockTime last_buffer_start_timestamp = 0;
85  void *p_fixed_jitter_list = NULL;
86 };
87 
89  GstPushSrcClass parent_class;
90 };
91 
93 
94 G_END_DECLS
95 
96 #endif
GST_NV_VIDEO_TEST_SRC_RUNNING_TIME
@ GST_NV_VIDEO_TEST_SRC_RUNNING_TIME
Definition: includes/gstnvvideotestsrc.h:46
_GstNvVideoTestSrc::pattern
GstNvVideoTestSrcPattern pattern
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:56
GST_NV_VIDEO_TEST_SRC_WALL_TIME
@ GST_NV_VIDEO_TEST_SRC_WALL_TIME
Definition: includes/gstnvvideotestsrc.h:45
GST_NV_VIDEO_TEST_SRC_FRAMES
@ GST_NV_VIDEO_TEST_SRC_FRAMES
Definition: includes/gstnvvideotestsrc.h:44
GST_NV_VIDEO_TEST_SRC_GRADIENT
@ GST_NV_VIDEO_TEST_SRC_GRADIENT
Definition: includes/gstnvvideotestsrc.h:40
_GstNvVideoTestSrc::parent
GstPushSrc parent
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:53
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:520
GstNvVideoTestSrcAnimationMode
GstNvVideoTestSrcAnimationMode
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:43
_GstNvVideoTestSrc
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:52
GST_NV_VIDEO_TEST_SRC_MANDELBROT
@ GST_NV_VIDEO_TEST_SRC_MANDELBROT
Definition: includes/gstnvvideotestsrc.h:39
_GstNvVideoTestSrc::info
GstVideoInfo info
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:64
_GstNvVideoTestSrc::caps
GstCaps * caps
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:63
_GstNvVideoTestSrc::p_fixed_jitter_list
void * p_fixed_jitter_list
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:85
_GstNvVideoTestSrc::filename
gchar * filename
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:76
_GstNvVideoTestSrc::file_handle
FILE * file_handle
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:77
_GstNvVideoTestSrc::filled_frames
guint filled_frames
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:68
_GstNvVideoTestSrc::file_read_surface
NvBufSurface * file_read_surface
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:79
_GstNvVideoTestSrc::max_jitter
guint max_jitter
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:83
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: nvbufsurface.h:487
_GstNvVideoTestSrc::cuda_block_size
unsigned int cuda_block_size
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:71
gst_nv_video_test_src_get_type
GType gst_nv_video_test_src_get_type(void)
_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:73
_GstNvVideoTestSrc::gpu_id
guint gpu_id
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:58
_GstNvVideoTestSrc::file_loop
gboolean file_loop
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:80
_GstNvVideoTestSrcClass
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:88
_GstNvVideoTestSrc::cuda_surf
NvBufSurfaceParams * cuda_surf
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:70
NvBufSurfaceMemType
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:312
_GstNvVideoTestSrc::running_time
GstClockTime running_time
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:67
_GstNvVideoTestSrc::last_buffer_start_timestamp
GstClockTime last_buffer_start_timestamp
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:84
_GstNvVideoTestSrcClass::parent_class
GstPushSrcClass parent_class
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:89
_GstNvVideoTestSrc::cuda_num_blocks
unsigned int cuda_num_blocks
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:72
GstNvVideoTestSrcPattern
GstNvVideoTestSrcPattern
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:37
_GstNvVideoTestSrc::enable_rdma
gboolean enable_rdma
Definition: gst-plugins/gst-nvvideotestsrc/gstnvvideotestsrc.h:60
GstNvVideoTestSrcAnimationMode
GstNvVideoTestSrcAnimationMode
Definition: includes/gstnvvideotestsrc.h:43
GST_NV_VIDEO_TEST_SRC_SMPTE
@ GST_NV_VIDEO_TEST_SRC_SMPTE
Definition: includes/gstnvvideotestsrc.h:38
_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:78
GstNvVideoTestSrcPattern
GstNvVideoTestSrcPattern
Definition: includes/gstnvvideotestsrc.h:37
nvbufsurface.h