NVIDIA DeepStream SDK API Reference

9.1 Release
sources/includes/nvds_latency_meta.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-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 
32 #ifndef _NVDSMETA_LATENCY_H_
33 #define _NVDSMETA_LATENCY_H_
34 
35 #include "glib.h"
36 #include "gmodule.h"
37 #include "nvdsmeta.h"
38 
39 #define MAX_COMPONENT_LEN 64
40 
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #endif
45 
49 typedef struct _NvDsMetaSubCompLatency {
59 
63 typedef struct _NvDsMetaCompLatency {
73  guint source_id;
75  guint frame_num;
78  guint pad_index;
84 
88 typedef struct
89 {
91  guint source_id;
93  guint frame_num;
99  gdouble latency;
101 
114  gchar *element_name);
115 
129 gboolean nvds_set_output_system_timestamp(GstBuffer * buffer, gchar *element_name);
130 
145  NvDsFrameLatencyInfo *latency_info);
146 
154 
170  gchar *element_name, guint frame_id);
171 
179 
185 #define nvds_enable_latency_measurement (nvds_get_enable_latency_measurement())
186 
192 #define nvds_latency_measurement_silent (nvds_get_latency_measurement_silent())
193 
196 #ifdef __cplusplus
197 }
198 #endif
199 #endif
NvDsMetaSubCompLatency
struct _NvDsMetaSubCompLatency NvDsMetaSubCompLatency
Holds information about latency of the given subcomponent.
nvds_set_output_system_timestamp
gboolean nvds_set_output_system_timestamp(GstBuffer *buffer, gchar *element_name)
Sets the system timestamp when a Gst Buffer that is pushed to the downstream component.
_NvDsMetaSubCompLatency::sub_comp_name
gchar sub_comp_name[MAX_COMPONENT_LEN]
Holds the subcomponent names.
Definition: sources/includes/nvds_latency_meta.h:51
_NvDsMetaCompLatency::frame_num
guint frame_num
Holds the current frame number for which latency is measured.
Definition: sources/includes/nvds_latency_meta.h:75
NvDsFrameLatencyInfo::comp_in_timestamp
gdouble comp_in_timestamp
Holds the system timestamp of the buffer when it arrives at the input of the first component in the p...
Definition: sources/includes/nvds_latency_meta.h:97
_NvDsMetaCompLatency::source_id
guint source_id
Holds the source ID of the component, e.g.
Definition: sources/includes/nvds_latency_meta.h:73
_NvDsMetaCompLatency::component_name
gchar component_name[MAX_COMPONENT_LEN]
Holds the name of the component for which latency is measured.
Definition: sources/includes/nvds_latency_meta.h:65
NvDsFrameLatencyInfo
Holds information about the latency of a given frame.
Definition: sources/includes/nvds_latency_meta.h:88
_NvDsMetaCompLatency::out_system_timestamp
gdouble out_system_timestamp
Holds the system timestamp of buffer when it is sent to the downstream component.
Definition: sources/includes/nvds_latency_meta.h:71
_NvDsMetaCompLatency::num_sub_comps
guint num_sub_comps
Holds the number of subcomponents for the given component.
Definition: sources/includes/nvds_latency_meta.h:82
_NvDsMetaSubCompLatency::in_system_timestamp
gdouble in_system_timestamp
Holds the system timestamp of the buffer when it arrives at the input of the component.
Definition: sources/includes/nvds_latency_meta.h:54
_NvDsMetaCompLatency::in_system_timestamp
gdouble in_system_timestamp
Holds the system timestamp of the buffer when it arrives at the input of the component.
Definition: sources/includes/nvds_latency_meta.h:68
_NvDsMetaSubCompLatency::out_system_timestamp
gdouble out_system_timestamp
Holds the system timestamp of the buffer when it leaves at the output of the component.
Definition: sources/includes/nvds_latency_meta.h:57
_NvDsUserMeta
Holds user metadata.
Definition: sources/includes/nvdsmeta.h:494
_NvDsMetaCompLatency::sub_comp_latencies
NvDsMetaSubCompLatency sub_comp_latencies[16]
Holds latency information of subcomponent in an array.
Definition: sources/includes/nvds_latency_meta.h:80
NvDsFrameLatencyInfo::frame_num
guint frame_num
Holds the current frame number for which latency is measured.
Definition: sources/includes/nvds_latency_meta.h:93
_NvDsMetaSubCompLatency
Holds information about latency of the given subcomponent.
Definition: sources/includes/nvds_latency_meta.h:49
nvds_get_latency_measurement_silent
gboolean nvds_get_latency_measurement_silent(void)
Indicates whether silent mode for latency measurement is enabled.
NvDsFrameLatencyInfo::source_id
guint source_id
Holds the source ID of the component, e.g.
Definition: sources/includes/nvds_latency_meta.h:91
nvds_get_enable_latency_measurement
gboolean nvds_get_enable_latency_measurement(void)
Indicates whether the environment variable NVDS_ENABLE_LATENCY_MEASUREMENT is exported.
NvDsMetaCompLatency
struct _NvDsMetaCompLatency NvDsMetaCompLatency
Holds information about latency of the given component.
MAX_COMPONENT_LEN
#define MAX_COMPONENT_LEN
Definition: sources/includes/nvds_latency_meta.h:39
_NvDsMetaCompLatency::pad_index
guint pad_index
Holds the pad or port index of the stream muxer for the frame in the batch.
Definition: sources/includes/nvds_latency_meta.h:78
nvds_set_input_system_timestamp
NvDsUserMeta * nvds_set_input_system_timestamp(GstBuffer *buffer, gchar *element_name)
Sets the system timestamp when the Gst Buffer arrives as input at the component.
nvdsmeta.h
_NvDsMetaCompLatency
Holds information about latency of the given component.
Definition: sources/includes/nvds_latency_meta.h:63
nvds_measure_buffer_latency
guint nvds_measure_buffer_latency(GstBuffer *buf, NvDsFrameLatencyInfo *latency_info)
Measures the latency of all frames present in the current batch.
nvds_add_reference_timestamp_meta
void nvds_add_reference_timestamp_meta(GstBuffer *buffer, gchar *element_name, guint frame_id)
Adds the reference timestamp metadata for this buffer Note: element_name == "audiodecoder" and "nvv4l...
GstBuffer
struct _GstBuffer GstBuffer
Definition: sources/includes/ds3d/common/idatatype.h:24
NvDsFrameLatencyInfo::latency
gdouble latency
Holds the latency of the frame in milliseconds.
Definition: sources/includes/nvds_latency_meta.h:99