NVIDIA DeepStream SDK API Reference

9.1 Release
sources/includes/gstnvdsmeta.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 
45 #ifndef GST_NVDS_META_API_H
46 #define GST_NVDS_META_API_H
47 
48 #include <gst/gst.h>
49 #include <gst/video/video.h>
50 #include <gst/base/gstbasetransform.h>
51 
52 #include "nvdsmeta.h"
53 #include "nvds_audio_meta.h"
54 #include "nvds_latency_meta.h"
55 
56 #ifdef __cplusplus
57 extern "C"
58 {
59 #endif
60 GType nvds_meta_api_get_type (void);
61 #define NVDS_META_API_TYPE (nvds_meta_api_get_type())
62 
63 const GstMetaInfo *nvds_meta_get_info (void);
64 
65 #define NVDS_META_INFO (nvds_meta_get_info())
66 
67 #define NVDS_META_STRING "nvdsmeta"
68 
73 typedef enum {
75  /* Specifies information of a formed batch. */
78  /* Specifies information of dewarped surfaces. */
80  /* @ref NvDsMetaType for @ref NvDsUserMeta in @NvDsFrameMeta
81  * This metadata carries GstMeta objects of all input frames
82  * batched by nvstreammux2
83  * Note: Please refer to APIs @ref nvds_copy_gst_meta_to_frame_meta
84  * and @ref nvds_copy_gst_meta_to_audio_frame_meta for more information.
85  */
88  /* Specifies the first value that may be assigned to a user-defined type. */
89  NVDS_GST_META_FORCE32 = 0x7FFFFFFF
91 
95  typedef struct _NvDsMeta {
96  GstMeta meta;
97 
100  gpointer meta_data;
101 
103  gpointer user_data;
104 
106  gint meta_type;
107 
112 
116 
134 
142 
143 } NvDsMeta;
144 
165 NvDsMeta *gst_buffer_add_nvds_meta (GstBuffer *buffer, gpointer meta_data,
166  gpointer user_data, NvDsMetaCopyFunc copy_func,
167  NvDsMetaReleaseFunc release_func);
168 
178 
188 
214 void nvds_copy_gst_meta_to_frame_meta(GstBuffer* src_gst_buffer, NvDsBatchMeta* batch_meta, NvDsFrameMeta* frame_meta);
215 
241 void nvds_copy_gst_meta_to_audio_frame_meta(GstBuffer* src_gst_buffer, NvDsBatchMeta* batch_meta, NvDsAudioFrameMeta* frame_meta);
242 
244 #ifdef __cplusplus
245 }
246 #endif
247 #endif
gst_buffer_add_nvds_meta
NvDsMeta * gst_buffer_add_nvds_meta(GstBuffer *buffer, gpointer meta_data, gpointer user_data, NvDsMetaCopyFunc copy_func, NvDsMetaReleaseFunc release_func)
Adds GstMeta of type NvDsMeta to the GstBuffer and sets the meta_data member of NvDsMeta.
NvDsMetaCopyFunc
gpointer(* NvDsMetaCopyFunc)(gpointer data, gpointer user_data)
Defines the type of a callback to copy metadata.
Definition: sources/includes/nvdsmeta.h:84
_NvDsMeta::user_data
gpointer user_data
Holds a pointer to user-specific data .
Definition: sources/includes/gstnvdsmeta.h:103
_NvDsMeta::gst_to_nvds_meta_release_func
NvDsMetaReleaseFunc gst_to_nvds_meta_release_func
A callback to be called when meta_data transformed into NvDsUserMeta is to be destroyed.
Definition: sources/includes/gstnvdsmeta.h:141
_NvDsAudioFrameMeta
Holds metadata for a audio frame in a batch.
Definition: sources/includes/nvds_audio_meta.h:50
nvds_meta_get_info
const GstMetaInfo * nvds_meta_get_info(void)
NVDS_BUFFER_GST_AS_FRAME_USER_META
@ NVDS_BUFFER_GST_AS_FRAME_USER_META
Definition: sources/includes/gstnvdsmeta.h:86
NVDS_DECODER_GST_META
@ NVDS_DECODER_GST_META
Definition: sources/includes/gstnvdsmeta.h:77
nvds_latency_meta.h
gst_buffer_get_nvds_meta
NvDsMeta * gst_buffer_get_nvds_meta(GstBuffer *buffer)
Gets the NvDsMeta last added to a GstBuffer.
GstNvDsMetaType
GstNvDsMetaType
Defines the type of metadata.
Definition: sources/includes/gstnvdsmeta.h:73
NVDS_RESERVED_GST_META
@ NVDS_RESERVED_GST_META
Definition: sources/includes/gstnvdsmeta.h:87
NVDS_BATCH_GST_META
@ NVDS_BATCH_GST_META
Definition: sources/includes/gstnvdsmeta.h:76
_NvDsMeta::freefunc
NvDsMetaReleaseFunc freefunc
A callback to be called when meta_data is to be destroyed.
Definition: sources/includes/gstnvdsmeta.h:115
NVDS_GST_META_FORCE32
@ NVDS_GST_META_FORCE32
Definition: sources/includes/gstnvdsmeta.h:89
_NvDsBatchMeta
Holds information about a formed batch containing frames from different sources.
Definition: sources/includes/nvdsmeta.h:262
_NvDsMeta
Holds DeepSteam metadata.
Definition: sources/includes/gstnvdsmeta.h:95
_NvDsMeta::gst_to_nvds_meta_transform_func
NvDsMetaCopyFunc gst_to_nvds_meta_transform_func
A callback to be called when meta_data is transformed into NvDsUserMeta.
Definition: sources/includes/gstnvdsmeta.h:133
gst_buffer_get_nvds_batch_meta
NvDsBatchMeta * gst_buffer_get_nvds_batch_meta(GstBuffer *buffer)
Gets the NvDsBatchMeta added to a GstBuffer.
NVDS_GST_INVALID_META
@ NVDS_GST_INVALID_META
Definition: sources/includes/gstnvdsmeta.h:74
NVDS_DEWARPER_GST_META
@ NVDS_DEWARPER_GST_META
Definition: sources/includes/gstnvdsmeta.h:79
NVDS_GST_CUSTOM_META
@ NVDS_GST_CUSTOM_META
Specifies the start of a range of enum values that represent types of NVIDIA-defined Gst metas.
Definition: sources/includes/nvdsmeta.h:184
nvds_audio_meta.h
nvds_meta_api_get_type
GType nvds_meta_api_get_type(void)
nvds_copy_gst_meta_to_frame_meta
void nvds_copy_gst_meta_to_frame_meta(GstBuffer *src_gst_buffer, NvDsBatchMeta *batch_meta, NvDsFrameMeta *frame_meta)
Copies all GstMeta objects on src_gst_buffer to the batched buffer's NvDsBatchMeta The GstMeta object...
_NvDsMeta::meta_type
gint meta_type
Holds the type of metadata, one of values of enum GstNvDsMetaType.
Definition: sources/includes/gstnvdsmeta.h:106
_NvDsMeta::copyfunc
NvDsMetaCopyFunc copyfunc
A callback to be called when meta_data is to be copied or transformed from one buffer to other.
Definition: sources/includes/gstnvdsmeta.h:111
_NvDsFrameMeta
Holds metadata for a frame in a batch.
Definition: sources/includes/nvdsmeta.h:306
NvDsMeta
struct _NvDsMeta NvDsMeta
Holds DeepSteam metadata.
NvDsMetaReleaseFunc
void(* NvDsMetaReleaseFunc)(gpointer data, gpointer user_data)
Defines the type of a callback to free metadata.
Definition: sources/includes/nvdsmeta.h:96
nvds_copy_gst_meta_to_audio_frame_meta
void nvds_copy_gst_meta_to_audio_frame_meta(GstBuffer *src_gst_buffer, NvDsBatchMeta *batch_meta, NvDsAudioFrameMeta *frame_meta)
Copies all GstMeta objects on src_gst_buffer to the batched buffer's NvDsBatchMeta The GstMeta object...
nvdsmeta.h
_NvDsMeta::meta
GstMeta meta
Definition: sources/includes/gstnvdsmeta.h:96
_NvDsMeta::meta_data
gpointer meta_data
Holds a pointer to metadata.
Definition: sources/includes/gstnvdsmeta.h:100
GstBuffer
struct _GstBuffer GstBuffer
Definition: sources/includes/ds3d/common/idatatype.h:24