NVIDIA DeepStream SDK API Reference

8.0 Release
gstnvdsudpsrc.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-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_NVDSUDPSRC_H_
14 #define _GST_NVDSUDPSRC_H_
15 
16 #include <gst/base/gstpushsrc.h>
17 #include <gio/gio.h>
18 #include <rivermax_api.h>
19 
20 #include "gstnvdsudpcommon.h"
21 
22 G_BEGIN_DECLS
23 
24 #define GST_TYPE_NVDSUDPSRC (gst_nvdsudpsrc_get_type())
25 #define GST_NVDSUDPSRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVDSUDPSRC,GstNvDsUdpSrc))
26 #define GST_NVDSUDPSRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVDSUDPSRC,GstNvDsUdpSrcClass))
27 #define GST_IS_NVDSUDPSRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVDSUDPSRC))
28 #define GST_IS_NVDSUDPSRC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVDSUDPSRC))
29 
32 typedef struct DstStreamInfo {
33  char *ip;
34  uint16_t port;
36 
38 {
39  GstPushSrc parent;
40 
41  /* properties */
42  gchar *uri;
43  gchar *localIfaceIps;
44  gint port;
46  gchar *multi_iface;
47  gboolean auto_multicast;
48  GstCaps *caps;
49  gchar *address;
51  GSocket *used_socket;
52  guint64 timeout;
53  gboolean reuse;
54  gboolean loop;
55  guint headerSize;
56  guint payloadSize;
57  guint numPackets;
58  guint payMultiple;
59  gint gpuId;
62  gchar *ptpSrc;
63  gchar *st2022_7_streams; /* List of IP:port pairs for ST2022-7 redundant streams */
64  guint num_streams; /* Number of active streams (primary + redundant) */
65  guint num_source_addresses; /* Number of source addresses for filtering */
66  guint num_local_interfaces; /* Number of local interfaces */
67 
71  guint frameSize;
72  guint stride;
73  uint8_t *dataPtr1;
74  uint8_t *dataPtr2;
75  guint len1;
76  guint len2;
77  gboolean mBit;
78  gboolean ffFound;
80 
81  GstBufferPool *pool;
82  GThread *pThread;
83  GQueue *bufferQ;
84  GCond qCond;
85  GMutex qLock;
86  GCond flowCond;
87  GMutex flowLock;
88  gboolean isRunning;
89  gboolean isPlayingState;
90  gboolean flushing;
91  GInetSocketAddress *addr;
92  GCancellable *cancellable;
94  gint pollfd;
95  gint lastError;
96  gboolean isRtpOut;
97  /*For rtpticks based buffer pts/dts generation */
98  gboolean first_rtp_packet;
99  guint64 last_rtp_tick;
100  guint64 rtp_tick_base;
101  guint clock_rate;
102  gboolean is_nvmm;
103 
104  /* Rivermax specific */
105  guint flowId;
106  struct sockaddr_in localNicAddr;
108  struct rmax_in_flow_attr flowAttr[MAX_ST2022_7_STREAMS];
109  struct rmax_in_buffer_attr bufferAttr;
110  struct rmax_in_memblock data;
111  struct rmax_in_memblock hdr;
112  gboolean isGpuDirect;
113  gpointer dataPtr;
114  gpointer hdrPtr;
116 
120 };
121 
123 {
124  GstPushSrcClass parent_class;
125 };
126 
127 GType gst_nvdsudpsrc_get_type (void);
128 
129 G_END_DECLS
130 
131 #endif
_GstNvDsUdpSrc::dataPtr
gpointer dataPtr
Definition: gstnvdsudpsrc.h:113
MAX_ST2022_7_STREAMS
#define MAX_ST2022_7_STREAMS
Definition: gstnvdsudpcommon.h:30
_GstNvDsUdpSrc::port
gint port
Definition: gstnvdsudpsrc.h:44
_GstNvDsUdpSrc::dataPtr2
uint8_t * dataPtr2
Definition: gstnvdsudpsrc.h:74
_GstNvDsUdpSrc::stride
guint stride
Definition: gstnvdsudpsrc.h:72
_GstNvDsUdpSrc::isRtpOut
gboolean isRtpOut
Definition: gstnvdsudpsrc.h:96
_GstNvDsUdpSrc::caps
GstCaps * caps
Definition: gstnvdsudpsrc.h:48
_GstNvDsUdpSrc::st2022_7_streams
gchar * st2022_7_streams
Definition: gstnvdsudpsrc.h:63
_GstNvDsUdpSrc::localIfaceIps
gchar * localIfaceIps
Definition: gstnvdsudpsrc.h:43
_GstNvDsUdpSrc::clock_rate
guint clock_rate
Definition: gstnvdsudpsrc.h:101
_GstNvDsUdpSrc::parent
GstPushSrc parent
Definition: gstnvdsudpsrc.h:39
_GstNvDsUdpSrc::flowId
guint flowId
Definition: gstnvdsudpsrc.h:105
_GstNvDsUdpSrc::srcAddress
gchar * srcAddress[MAX_ST2022_7_STREAMS]
Definition: gstnvdsudpsrc.h:118
_GstNvDsUdpSrc::len2
guint len2
Definition: gstnvdsudpsrc.h:76
_GstNvDsUdpSrc::mBit
gboolean mBit
Definition: gstnvdsudpsrc.h:77
MemoryType
MemoryType
Definition: gstnvdsudpcommon.h:48
_GstNvDsUdpSrc::flowAttr
struct rmax_in_flow_attr flowAttr[MAX_ST2022_7_STREAMS]
Definition: gstnvdsudpsrc.h:108
DstStreamInfo::ip
char * ip
Definition: gstnvdsudpsrc.h:33
gstnvdsudpcommon.h
_GstNvDsUdpSrc
Definition: gstnvdsudpsrc.h:37
gst_nvdsudpsrc_get_type
GType gst_nvdsudpsrc_get_type(void)
_GstNvDsUdpSrc::localIfaceIp
gchar * localIfaceIp[MAX_ST2022_7_STREAMS]
Definition: gstnvdsudpsrc.h:119
_GstNvDsUdpSrc::hdr
struct rmax_in_memblock hdr
Definition: gstnvdsudpsrc.h:111
_GstNvDsUdpSrc::payMultiple
guint payMultiple
Definition: gstnvdsudpsrc.h:58
_GstNvDsUdpSrc::lastError
gint lastError
Definition: gstnvdsudpsrc.h:95
_GstNvDsUdpSrc::is_nvmm
gboolean is_nvmm
Definition: gstnvdsudpsrc.h:102
_GstNvDsUdpSrc::alignedMemSize
size_t alignedMemSize
Definition: gstnvdsudpsrc.h:115
_GstNvDsUdpSrc::dstStream
DstStreamInfo dstStream[MAX_ST2022_7_STREAMS]
Definition: gstnvdsudpsrc.h:117
_GstNvDsUdpSrc::data
struct rmax_in_memblock data
Definition: gstnvdsudpsrc.h:110
DstStreamInfo
struct DstStreamInfo DstStreamInfo
_GstNvDsUdpSrc::ptpSrc
gchar * ptpSrc
Definition: gstnvdsudpsrc.h:62
_GstNvDsUdpSrc::adjust_leap_seconds
gboolean adjust_leap_seconds
Definition: gstnvdsudpsrc.h:61
_GstNvDsUdpSrc::rtp_tick_base
guint64 rtp_tick_base
Definition: gstnvdsudpsrc.h:100
_GstNvDsUdpSrc::pool
GstBufferPool * pool
Definition: gstnvdsudpsrc.h:81
_GstNvDsUdpSrc::numPackets
guint numPackets
Definition: gstnvdsudpsrc.h:57
_GstNvDsUdpSrc::packetCounter
guint packetCounter
Definition: gstnvdsudpsrc.h:79
_GstNvDsUdpSrc::isRunning
gboolean isRunning
Definition: gstnvdsudpsrc.h:88
_GstNvDsUdpSrc::flushing
gboolean flushing
Definition: gstnvdsudpsrc.h:90
_GstNvDsUdpSrc::auto_multicast
gboolean auto_multicast
Definition: gstnvdsudpsrc.h:47
_GstNvDsUdpSrc::reuse
gboolean reuse
Definition: gstnvdsudpsrc.h:53
_GstNvDsUdpSrc::bufferQ
GQueue * bufferQ
Definition: gstnvdsudpsrc.h:83
DstStreamInfo
Definition: gstnvdsudpsrc.h:32
_GstNvDsUdpSrc::flowCond
GCond flowCond
Definition: gstnvdsudpsrc.h:86
_GstNvDsUdpSrc::sourceAddresses
gchar * sourceAddresses
Definition: gstnvdsudpsrc.h:50
_GstNvDsUdpSrc::address
gchar * address
Definition: gstnvdsudpsrc.h:49
_GstNvDsUdpSrc::pollfd
gint pollfd
Definition: gstnvdsudpsrc.h:94
_GstNvDsUdpSrc::dataPtr1
uint8_t * dataPtr1
Definition: gstnvdsudpsrc.h:73
_GstNvDsUdpSrc::qLock
GMutex qLock
Definition: gstnvdsudpsrc.h:85
_GstNvDsUdpSrcClass::parent_class
GstPushSrcClass parent_class
Definition: gstnvdsudpsrc.h:124
_GstNvDsUdpSrc::used_socket
GSocket * used_socket
Definition: gstnvdsudpsrc.h:51
_GstNvDsUdpSrc::bufferAttr
struct rmax_in_buffer_attr bufferAttr
Definition: gstnvdsudpsrc.h:109
_GstNvDsUdpSrc::streamId
rmax_stream_id streamId[MAX_ST2022_7_STREAMS]
Definition: gstnvdsudpsrc.h:107
_GstNvDsUdpSrc::use_rtp_timestamp
gboolean use_rtp_timestamp
Definition: gstnvdsudpsrc.h:60
_GstNvDsUdpSrc::num_local_interfaces
guint num_local_interfaces
Definition: gstnvdsudpsrc.h:66
_GstNvDsUdpSrc::uri
gchar * uri
Definition: gstnvdsudpsrc.h:42
_GstNvDsUdpSrc::loop
gboolean loop
Definition: gstnvdsudpsrc.h:54
_GstNvDsUdpSrc::num_streams
guint num_streams
Definition: gstnvdsudpsrc.h:64
_GstNvDsUdpSrc::addr
GInetSocketAddress * addr
Definition: gstnvdsudpsrc.h:91
DstStreamInfo::port
uint16_t port
Definition: gstnvdsudpsrc.h:34
_GstNvDsUdpSrc::first_rtp_packet
gboolean first_rtp_packet
Definition: gstnvdsudpsrc.h:98
_GstNvDsUdpSrc::buffer_size
gint buffer_size
Definition: gstnvdsudpsrc.h:45
_GstNvDsUdpSrc::flowLock
GMutex flowLock
Definition: gstnvdsudpsrc.h:87
_GstNvDsUdpSrc::len1
guint len1
Definition: gstnvdsudpsrc.h:75
_GstNvDsUdpSrc::pThread
GThread * pThread
Definition: gstnvdsudpsrc.h:82
_GstNvDsUdpSrcClass
Definition: gstnvdsudpsrc.h:122
_GstNvDsUdpSrc::isGpuDirect
gboolean isGpuDirect
Definition: gstnvdsudpsrc.h:112
_GstNvDsUdpSrc::localNicAddr
struct sockaddr_in localNicAddr
Definition: gstnvdsudpsrc.h:106
_GstNvDsUdpSrc::last_rtp_tick
guint64 last_rtp_tick
Definition: gstnvdsudpsrc.h:99
_GstNvDsUdpSrc::multi_iface
gchar * multi_iface
Definition: gstnvdsudpsrc.h:46
_GstNvDsUdpSrc::timeout
guint64 timeout
Definition: gstnvdsudpsrc.h:52
_GstNvDsUdpSrc::frameSize
guint frameSize
Definition: gstnvdsudpsrc.h:71
StreamType
StreamType
Definition: gstnvdsudpcommon.h:35
_GstNvDsUdpSrc::qCond
GCond qCond
Definition: gstnvdsudpsrc.h:84
_GstNvDsUdpSrc::hdrPtr
gpointer hdrPtr
Definition: gstnvdsudpsrc.h:114
_GstNvDsUdpSrc::headerSize
guint headerSize
Definition: gstnvdsudpsrc.h:55
_GstNvDsUdpSrc::num_source_addresses
guint num_source_addresses
Definition: gstnvdsudpsrc.h:65
_GstNvDsUdpSrc::isPlayingState
gboolean isPlayingState
Definition: gstnvdsudpsrc.h:89
_GstNvDsUdpSrc::gpuId
gint gpuId
Definition: gstnvdsudpsrc.h:59
_GstNvDsUdpSrc::payloadSize
guint payloadSize
Definition: gstnvdsudpsrc.h:56
_GstNvDsUdpSrc::streamType
StreamType streamType
Definition: gstnvdsudpsrc.h:68
VideoType
VideoType
Definition: gstnvdsudpcommon.h:43
_GstNvDsUdpSrc::cancellableFd
gint cancellableFd
Definition: gstnvdsudpsrc.h:93
_GstNvDsUdpSrc::outputMemType
MemoryType outputMemType
Definition: gstnvdsudpsrc.h:70
_GstNvDsUdpSrc::videoType
VideoType videoType
Definition: gstnvdsudpsrc.h:69
_GstNvDsUdpSrc::cancellable
GCancellable * cancellable
Definition: gstnvdsudpsrc.h:92
_GstNvDsUdpSrc::ffFound
gboolean ffFound
Definition: gstnvdsudpsrc.h:78