NVIDIA DeepStream SDK API Reference

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