NVIDIA DeepStream SDK API Reference

7.0 Release
gstnvstreammux_ntp.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 __GSTNVSTREAMMUX_NTP__
14 #define __GSTNVSTREAMMUX_NTP__
15 
16 #include <glib.h>
17 #include <gst/gst.h>
18 
19 G_BEGIN_DECLS
20 
21 #define NVDS_RFC3339_STR_BUF_LEN 32
22 
23 void generate_rfc3339_str_from_ts (gchar *buf, GstClockTime ts);
24 
25 typedef enum
26 {
30 
31 /* Modes of NTP timestamp correction based on frame rate */
32 typedef enum
33 {
34  /* Frame rate based correction disabled */
36  /* Use the average frame rate provided in the NTP query to correct
37  * NTP timestamp. (PTS based frame rate calculation at rtpjitterbuffer.) */
39  /* Use the frame rate provided by application to correct NTP timestamp.
40  * This mode is required frame rate is different at rtpjitterbuffer and
41  * nvstreammux. Bug 3620472, 3626628 */
44 
45 typedef struct _GstNvDsNtpCalculator GstNvDsNtpCalculator;
46 
48  GstClockTime frame_duration, GstElement *elem, guint source_id);
49 
51  GstClockTime ntp_time_epoch_ns, GstClockTime ntp_frame_timestamp,
52  GstClockTime avg_frame_time);
53 
55 
57  GstClockTime *ntp_time_epoch_ns, GstClockTime *ntp_frame_timestamp,
58  GstClockTime *avg_frame_time, GstClockTime *ntp_time_epoch_ns_next,
59  GstClockTime *ntp_frame_timestamp_next);
60 
62  GstClockTime buf_pts);
63 
65 
67 
68 G_END_DECLS
69 
70 #endif
gst_nvds_ntp_calculator_add_ntp_sync_values
void gst_nvds_ntp_calculator_add_ntp_sync_values(GstNvDsNtpCalculator *calc, GstClockTime ntp_time_epoch_ns, GstClockTime ntp_frame_timestamp, GstClockTime avg_frame_time)
GST_NVDS_NTP_CALC_MODE_RTCP
@ GST_NVDS_NTP_CALC_MODE_RTCP
Definition: gstnvstreammux_ntp.h:28
gst_nvds_ntp_calculator_get_ntp_sync_values
void gst_nvds_ntp_calculator_get_ntp_sync_values(GstNvDsNtpCalculator *calc, GstClockTime *ntp_time_epoch_ns, GstClockTime *ntp_frame_timestamp, GstClockTime *avg_frame_time, GstClockTime *ntp_time_epoch_ns_next, GstClockTime *ntp_frame_timestamp_next)
generate_rfc3339_str_from_ts
void generate_rfc3339_str_from_ts(gchar *buf, GstClockTime ts)
GST_NVDS_NTP_CALC_MODE_SYSTEM_TIME
@ GST_NVDS_NTP_CALC_MODE_SYSTEM_TIME
Definition: gstnvstreammux_ntp.h:27
GST_NVDS_NTP_CORRECTION_USER_FRAME_RATE
@ GST_NVDS_NTP_CORRECTION_USER_FRAME_RATE
Definition: gstnvstreammux_ntp.h:42
GstNvDsNtpCorrectionMode
GstNvDsNtpCorrectionMode
Definition: gstnvstreammux_ntp.h:32
GstNvDsNtpCalculatorMode
GstNvDsNtpCalculatorMode
Definition: gstnvstreammux_ntp.h:25
gst_nvds_ntp_calculator_have_ntp_sync_values
gboolean gst_nvds_ntp_calculator_have_ntp_sync_values(GstNvDsNtpCalculator *calc)
gst_nvds_ntp_calculator_reset
void gst_nvds_ntp_calculator_reset(GstNvDsNtpCalculator *calc)
GST_NVDS_NTP_CORRECTION_DISABLED
@ GST_NVDS_NTP_CORRECTION_DISABLED
Definition: gstnvstreammux_ntp.h:35
gst_nvds_ntp_calculator_new
GstNvDsNtpCalculator * gst_nvds_ntp_calculator_new(GstNvDsNtpCalculatorMode mode, GstClockTime frame_duration, GstElement *elem, guint source_id)
gst_nvds_ntp_calculator_get_buffer_ntp
GstClockTime gst_nvds_ntp_calculator_get_buffer_ntp(GstNvDsNtpCalculator *calc, GstClockTime buf_pts)
GST_NVDS_NTP_CORRECTION_AUTOMATIC
@ GST_NVDS_NTP_CORRECTION_AUTOMATIC
Definition: gstnvstreammux_ntp.h:38
GstNvDsNtpCalculator
struct _GstNvDsNtpCalculator GstNvDsNtpCalculator
Definition: gstnvstreammux_ntp.h:45
gst_nvds_ntp_calculator_free
void gst_nvds_ntp_calculator_free(GstNvDsNtpCalculator *calc)