NVIDIA DeepStream SDK API Reference

8.0 Release
gstnvdsudpcommon.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_NVDSUDP_COMMON_H_
14 #define _GST_NVDSUDP_COMMON_H_
15 
16 #include <gst/gst.h>
17 #include <gio/gio.h>
18 #include <cuda.h>
19 #include <cuda_runtime.h>
20 
21 #define CHECK_CUDA(err, err_str) \
22  do { \
23  if ((err) != cudaSuccess) { \
24  GST_WARNING (err_str ", cuda err: %s", cudaGetErrorName (err)); \
25  return FALSE; \
26  } \
27  } while (0)
28 
29 #define INVALID_STREAM_ID ((rmax_stream_id)-1L)
30 #define MAX_ST2022_7_STREAMS 2
31 
32 #define round_up(num, round) \
33  ((((num) + (round) - 1) / (round)) * (round))
34 
35 typedef enum StreamType {
41 } StreamType;
42 
43 typedef enum VideoType {
46 } VideoType;
47 
48 typedef enum MemoryType {
53 } MemoryType;
54 
55 gboolean
56 gst_udp_parse_uri (const gchar * uristr, gchar ** host, guint16 * port);
57 
58 GInetAddress *
59 gst_udp_resolve_name (gpointer obj, const gchar * address);
60 
61 #define LEAP_SECONDS (37)
62 #define DEFAULT_PTP_SRC NULL
63 
64 // Define metadata structure
66 
68  GstMeta meta;
69  guint32 rtp_timestamp;
71 };
72 
73 // Declare functions
75 const GstMetaInfo *gst_rtp_timestamp_meta_get_info(void);
76 
77 // Helper functions for adding/getting metadata
80 
81 // GPU memory allocation related functions
82 void* gpu_allocate_memory (int gpuId, size_t size, size_t align);
83 size_t gpu_aligned_size (int gpuId, size_t allocSize);
84 gboolean cudaFreeMmap (uint64_t *ptr, size_t size);
85 
86 #endif
AUDIO_2110_30_31_STREAM
@ AUDIO_2110_30_31_STREAM
Definition: gstnvdsudpcommon.h:38
gpu_allocate_memory
void * gpu_allocate_memory(int gpuId, size_t size, size_t align)
VIDEO_2110_22_STREAM
@ VIDEO_2110_22_STREAM
Definition: gstnvdsudpcommon.h:37
INTERLACE
@ INTERLACE
Definition: gstnvdsudpcommon.h:45
MemoryType
MemoryType
Definition: gstnvdsudpcommon.h:48
gst_rtp_timestamp_meta_api_get_type
GType gst_rtp_timestamp_meta_api_get_type(void)
gpu_aligned_size
size_t gpu_aligned_size(int gpuId, size_t allocSize)
_GstRTPTimestampMeta::leap_seconds_adjusted
gboolean leap_seconds_adjusted
Definition: gstnvdsudpcommon.h:70
_GstRTPTimestampMeta::meta
GstMeta meta
Definition: gstnvdsudpcommon.h:68
gst_udp_resolve_name
GInetAddress * gst_udp_resolve_name(gpointer obj, const gchar *address)
MEM_TYPE_DEVICE
@ MEM_TYPE_DEVICE
Definition: gstnvdsudpcommon.h:50
gst_rtp_timestamp_meta_get_info
const GstMetaInfo * gst_rtp_timestamp_meta_get_info(void)
ANCILLARY_2110_40_STREAM
@ ANCILLARY_2110_40_STREAM
Definition: gstnvdsudpcommon.h:39
MEM_TYPE_SYSTEM
@ MEM_TYPE_SYSTEM
Definition: gstnvdsudpcommon.h:51
gst_udp_parse_uri
gboolean gst_udp_parse_uri(const gchar *uristr, gchar **host, guint16 *port)
PROGRESSIVE
@ PROGRESSIVE
Definition: gstnvdsudpcommon.h:44
gst_buffer_get_rtp_timestamp_meta
GstRTPTimestampMeta * gst_buffer_get_rtp_timestamp_meta(GstBuffer *buffer)
_GstRTPTimestampMeta::rtp_timestamp
guint32 rtp_timestamp
Definition: gstnvdsudpcommon.h:69
MEM_TYPE_UNKNOWN
@ MEM_TYPE_UNKNOWN
Definition: gstnvdsudpcommon.h:52
APPLICATION_CUSTOM_STREAM
@ APPLICATION_CUSTOM_STREAM
Definition: gstnvdsudpcommon.h:40
_GstRTPTimestampMeta
Definition: gstnvdsudpcommon.h:67
StreamType
StreamType
Definition: gstnvdsudpcommon.h:35
GstBuffer
struct _GstBuffer GstBuffer
Definition: idatatype.h:19
cudaFreeMmap
gboolean cudaFreeMmap(uint64_t *ptr, size_t size)
VideoType
VideoType
Definition: gstnvdsudpcommon.h:43
MEM_TYPE_HOST
@ MEM_TYPE_HOST
Definition: gstnvdsudpcommon.h:49
gst_buffer_add_rtp_timestamp_meta
GstRTPTimestampMeta * gst_buffer_add_rtp_timestamp_meta(GstBuffer *buffer, guint32 timestamp)
VIDEO_2110_20_STREAM
@ VIDEO_2110_20_STREAM
Definition: gstnvdsudpcommon.h:36