NVIDIA DeepStream SDK API Reference
7.0 Release
nvds_audio_meta.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: Copyright (c) 2020 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
28
#ifndef _NVDS_AUDIO_META_H_
29
#define _NVDS_AUDIO_META_H_
30
31
#include "glib.h"
32
#include "gmodule.h"
33
34
#include <
nvdsmeta.h
>
35
#include <
nvbufaudio.h
>
36
37
#ifdef __cplusplus
38
extern
"C"
39
{
40
#endif
41
45
typedef
struct
_NvDsAudioFrameMeta
{
47
NvDsBaseMeta
base_meta
;
50
guint
pad_index
;
52
guint
batch_id
;
54
gint
frame_num
;
56
guint64
buf_pts
;
58
guint64
ntp_timestamp
;
61
guint
source_id
;
63
gint
num_samples_per_frame
;
64
/* Holds the sample rate for audio stream */
65
guint
sample_rate
;
66
/* Holds the number of channels in audio stream. */
67
guint
num_channels
;
68
/* Holds the audio format type. */
69
NvBufAudioFormat
format
;
70
/* Holds layout information indicating whether audio channels are interleaved
71
* or non-interleaved */
72
NvBufAudioLayout
layout
;
74
gboolean
bInferDone
;
77
gint
class_id
;
79
gfloat
confidence
;
81
gchar
class_label
[
MAX_LABEL_SIZE
];
84
NvDsClassifierMetaList
*
classifier_meta_list
;
87
NvDsUserMetaList
*
frame_user_meta_list
;
89
gint64
misc_frame_info
[
MAX_USER_FIELDS
];
91
gint64
reserved
[
MAX_RESERVED_FIELDS
];
92
}
NvDsAudioFrameMeta
;
93
100
NvDsBatchMeta
*
nvds_create_audio_batch_meta
(guint max_batch_size);
101
109
gboolean
nvds_destroy_audio_batch_meta
(
NvDsBatchMeta
*batch_meta);
110
121
NvDsAudioFrameMeta
*
nvds_acquire_audio_frame_meta_from_pool
(
NvDsBatchMeta
*batch_meta);
122
131
void
nvds_add_audio_frame_meta_to_audio_batch
(
NvDsBatchMeta
* batch_meta,
132
NvDsAudioFrameMeta
* frame_meta);
133
142
void
nvds_remove_audio_frame_meta_from_audio_batch
(
NvDsBatchMeta
*batch_meta,
143
NvDsAudioFrameMeta
* frame_meta);
144
157
void
nvds_add_classifier_meta_to_audio_frame
(
NvDsAudioFrameMeta
*frame_meta,
158
NvDsClassifierMeta
* classifier_meta);
159
168
void
nvds_remove_classifier_meta_from_audio_frame
(
NvDsAudioFrameMeta
* frame_meta,
169
NvDsClassifierMeta
*classifier_meta);
170
179
void
nvds_add_user_meta_to_audio_batch
(
NvDsBatchMeta
* batch_meta,
180
NvDsUserMeta
* user_meta);
181
190
void
nvds_add_user_meta_to_audio_frame
(
NvDsAudioFrameMeta
* frame_meta,
191
NvDsUserMeta
* user_meta);
192
203
void
nvds_remove_user_meta_from_audio_batch
(
NvDsBatchMeta
* batch_meta,
204
NvDsUserMeta
* user_meta);
205
214
void
nvds_remove_user_meta_from_audio_frame
(
NvDsAudioFrameMeta
* frame_meta,
215
NvDsUserMeta
* user_meta);
216
226
gpointer
nvds_audio_batch_meta_copy_func
(gpointer data, gpointer user_data);
227
235
void
nvds_audio_batch_meta_release_func
(gpointer data, gpointer user_data);
236
245
NvDsAudioFrameMeta
*
nvds_get_nth_audio_frame_meta
(
NvDsFrameMetaList
*frame_meta_list,
246
guint index);
247
255
void
nvds_clear_audio_frame_meta_list
(
NvDsBatchMeta
*batch_meta,
256
NvDsFrameMetaList
*meta_list);
257
266
void
nvds_clear_audio_classifier_meta_list
(
NvDsAudioFrameMeta
*frame_meta,
267
NvDsClassifierMetaList
*meta_list);
268
277
void
nvds_clear_audio_batch_user_meta_list
(
NvDsBatchMeta
*batch_meta,
278
NvDsUserMetaList
*meta_list);
279
287
void
nvds_clear_audio_frame_user_meta_list
(
NvDsAudioFrameMeta
*frame_meta,
288
NvDsUserMetaList
*meta_list);
289
297
void
nvds_copy_audio_batch_user_meta_list
(
NvDsUserMetaList
*src_user_meta_list,
298
NvDsBatchMeta
*dst_batch_meta);
299
306
void
nvds_copy_audio_frame_meta
(
NvDsAudioFrameMeta
*src_frame_meta,
307
NvDsAudioFrameMeta
*dst_frame_meta);
308
316
void
nvds_copy_audio_frame_user_meta_list
(
NvDsUserMetaList
*src_user_meta_list,
317
NvDsAudioFrameMeta
*dst_frame_meta);
318
326
void
nvds_copy_audio_frame_meta_list
(
NvDsFrameMetaList
*src_frame_meta_list,
327
NvDsBatchMeta
*dst_batch_meta);
328
338
void
nvds_copy_audio_classification_list
(
NvDsClassifierMetaList
*src_classifier_meta_list,
339
NvDsAudioFrameMeta
*dst_frame_meta);
340
341
#ifdef __cplusplus
342
}
343
#endif
344
#endif
345
_NvDsAudioFrameMeta::class_label
gchar class_label[MAX_LABEL_SIZE]
Holds a string describing the class of the detected event.
Definition:
nvds_audio_meta.h:81
nvds_add_user_meta_to_audio_frame
void nvds_add_user_meta_to_audio_frame(NvDsAudioFrameMeta *frame_meta, NvDsUserMeta *user_meta)
Add a user meta to a audio frame meta.
_NvDsAudioFrameMeta::misc_frame_info
gint64 misc_frame_info[MAX_USER_FIELDS]
Holds additional user-defined frame information.
Definition:
nvds_audio_meta.h:89
_NvDsAudioFrameMeta::classifier_meta_list
NvDsClassifierMetaList * classifier_meta_list
Holds a pointer to a list of pointers of type NvDsClassifierMeta in use for the frame.
Definition:
nvds_audio_meta.h:84
_NvDsAudioFrameMeta::pad_index
guint pad_index
Holds the pad or port index of the Gst-streammux plugin for the frame in the batch.
Definition:
nvds_audio_meta.h:50
nvds_acquire_audio_frame_meta_from_pool
NvDsAudioFrameMeta * nvds_acquire_audio_frame_meta_from_pool(NvDsBatchMeta *batch_meta)
Acquires a audio frame meta from a batch's audio frame meta pool.
_NvDsAudioFrameMeta::format
NvBufAudioFormat format
Definition:
nvds_audio_meta.h:69
_NvDsAudioFrameMeta::sample_rate
guint sample_rate
Definition:
nvds_audio_meta.h:65
_NvDsAudioFrameMeta::confidence
gfloat confidence
Hold confidence for last event detected (last NvDsClassifierMeta)
Definition:
nvds_audio_meta.h:79
_NvDsAudioFrameMeta
Holds metadata for a audio frame in a batch.
Definition:
nvds_audio_meta.h:45
nvds_copy_audio_classification_list
void nvds_copy_audio_classification_list(NvDsClassifierMetaList *src_classifier_meta_list, NvDsAudioFrameMeta *dst_frame_meta)
Makes a deep copy of a source classifier meta list to the classifier meta list in a specified object ...
nvds_remove_classifier_meta_from_audio_frame
void nvds_remove_classifier_meta_from_audio_frame(NvDsAudioFrameMeta *frame_meta, NvDsClassifierMeta *classifier_meta)
Removes a classifier meta from the audio frame meta to which it is attached.
nvds_clear_audio_batch_user_meta_list
void nvds_clear_audio_batch_user_meta_list(NvDsBatchMeta *batch_meta, NvDsUserMetaList *meta_list)
Removes all of the user metadata attached to the audio batch meta.
nvds_remove_user_meta_from_audio_batch
void nvds_remove_user_meta_from_audio_batch(NvDsBatchMeta *batch_meta, NvDsUserMeta *user_meta)
Removes a user meta from a audio batch meta to which it is attached.
MAX_USER_FIELDS
#define MAX_USER_FIELDS
Defines the number of additional fields available to the user in the metadata structure.
Definition:
nvdsmeta.h:45
nvds_remove_user_meta_from_audio_frame
void nvds_remove_user_meta_from_audio_frame(NvDsAudioFrameMeta *frame_meta, NvDsUserMeta *user_meta)
Removes a user meta from a audio frame meta to which it is attached.
_NvDsBaseMeta
Holds information about base metadata of a given metadata type.
Definition:
nvdsmeta.h:215
_NvDsAudioFrameMeta::num_channels
guint num_channels
Definition:
nvds_audio_meta.h:67
nvds_add_user_meta_to_audio_batch
void nvds_add_user_meta_to_audio_batch(NvDsBatchMeta *batch_meta, NvDsUserMeta *user_meta)
Add a user meta to a audio batch meta.
_NvDsAudioFrameMeta::class_id
gint class_id
Holds the index of the last object class inferred by the primary detector/classifier.
Definition:
nvds_audio_meta.h:77
_NvDsUserMeta
Holds user metadata.
Definition:
nvdsmeta.h:472
_NvDsAudioFrameMeta::frame_num
gint frame_num
Holds the current frame number of the source.
Definition:
nvds_audio_meta.h:54
nvds_clear_audio_frame_meta_list
void nvds_clear_audio_frame_meta_list(NvDsBatchMeta *batch_meta, NvDsFrameMetaList *meta_list)
Removes all of the frame metadata attached to a batch meta.
nvds_add_audio_frame_meta_to_audio_batch
void nvds_add_audio_frame_meta_to_audio_batch(NvDsBatchMeta *batch_meta, NvDsAudioFrameMeta *frame_meta)
Adds a audio frame meta to a batch meta.
_NvDsBatchMeta
Holds information about a formed batch containing frames from different sources.
Definition:
nvdsmeta.h:241
nvds_copy_audio_batch_user_meta_list
void nvds_copy_audio_batch_user_meta_list(NvDsUserMetaList *src_user_meta_list, NvDsBatchMeta *dst_batch_meta)
Makes a deep copy of a user meta list to the user meta list in a specified audio batch meta.
_NvDsAudioFrameMeta::num_samples_per_frame
gint num_samples_per_frame
Holds the number of samples in the frame.
Definition:
nvds_audio_meta.h:63
_NvDsAudioFrameMeta::bInferDone
gboolean bInferDone
Holds a Boolean indicating whether inference is performed on the frame.
Definition:
nvds_audio_meta.h:74
nvds_create_audio_batch_meta
NvDsBatchMeta * nvds_create_audio_batch_meta(guint max_batch_size)
Creates a batch metadata structure for a audio batch of specified size.
nvds_get_nth_audio_frame_meta
NvDsAudioFrameMeta * nvds_get_nth_audio_frame_meta(NvDsFrameMetaList *frame_meta_list, guint index)
Returns a pointer to a specified frame meta in the frame meta list.
_NvDsAudioFrameMeta::reserved
gint64 reserved[MAX_RESERVED_FIELDS]
For internal use.
Definition:
nvds_audio_meta.h:91
NvDsUserMetaList
GList NvDsUserMetaList
Definition:
nvdsmeta.h:57
nvbufaudio.h
nvds_add_classifier_meta_to_audio_frame
void nvds_add_classifier_meta_to_audio_frame(NvDsAudioFrameMeta *frame_meta, NvDsClassifierMeta *classifier_meta)
Adds a classifier meta the audio frame meta.
NvBufAudioFormat
NvBufAudioFormat
Specifies audio formats.
Definition:
nvbufaudio.h:39
nvds_destroy_audio_batch_meta
gboolean nvds_destroy_audio_batch_meta(NvDsBatchMeta *batch_meta)
Destroys a batch metadata structure.
nvds_audio_batch_meta_release_func
void nvds_audio_batch_meta_release_func(gpointer data, gpointer user_data)
Releases metadata from a batch meta.
_NvDsClassifierMeta
Holds classifier metadata for an object.
Definition:
nvdsmeta.h:401
NvDsFrameMetaList
GList NvDsFrameMetaList
Definition:
nvdsmeta.h:56
MAX_LABEL_SIZE
#define MAX_LABEL_SIZE
Definition:
dsexample_lib.h:16
_NvDsAudioFrameMeta::base_meta
NvDsBaseMeta base_meta
Holds the base metadata for the frame.
Definition:
nvds_audio_meta.h:47
_NvDsAudioFrameMeta::batch_id
guint batch_id
Holds the location of the frame in the batch.
Definition:
nvds_audio_meta.h:52
_NvDsAudioFrameMeta::source_id
guint source_id
Holds the source IDof the frame in the batch, e.g.
Definition:
nvds_audio_meta.h:61
NvDsAudioFrameMeta
struct _NvDsAudioFrameMeta NvDsAudioFrameMeta
Holds metadata for a audio frame in a batch.
_NvDsAudioFrameMeta::buf_pts
guint64 buf_pts
Holds the presentation timestamp (PTS) of the frame.
Definition:
nvds_audio_meta.h:56
_NvDsAudioFrameMeta::frame_user_meta_list
NvDsUserMetaList * frame_user_meta_list
Holds a pointer to a list of pointers of type NvDsUserMeta in use for the frame.
Definition:
nvds_audio_meta.h:87
nvds_clear_audio_classifier_meta_list
void nvds_clear_audio_classifier_meta_list(NvDsAudioFrameMeta *frame_meta, NvDsClassifierMetaList *meta_list)
Removes all of the classifier metadata attached to an audio frame meta.
nvds_copy_audio_frame_user_meta_list
void nvds_copy_audio_frame_user_meta_list(NvDsUserMetaList *src_user_meta_list, NvDsAudioFrameMeta *dst_frame_meta)
Makes a deep copy of a source user meta list to the user meta list in a specified audio frame meta.
_NvDsAudioFrameMeta::ntp_timestamp
guint64 ntp_timestamp
Holds the ntp timestamp.
Definition:
nvds_audio_meta.h:58
NvBufAudioLayout
NvBufAudioLayout
Specifies audio data layout in memory.
Definition:
nvbufaudio.h:75
nvds_clear_audio_frame_user_meta_list
void nvds_clear_audio_frame_user_meta_list(NvDsAudioFrameMeta *frame_meta, NvDsUserMetaList *meta_list)
Removes all of the user metadata attached to the audio frame meta.
_NvDsAudioFrameMeta::layout
NvBufAudioLayout layout
Definition:
nvds_audio_meta.h:72
nvds_copy_audio_frame_meta_list
void nvds_copy_audio_frame_meta_list(NvDsFrameMetaList *src_frame_meta_list, NvDsBatchMeta *dst_batch_meta)
Makes a deep copy of a source frame meta list to the frame meta list in a specified batch meta.
nvdsmeta.h
nvds_copy_audio_frame_meta
void nvds_copy_audio_frame_meta(NvDsAudioFrameMeta *src_frame_meta, NvDsAudioFrameMeta *dst_frame_meta)
Makes a deep copy of a frame meta to another frame meta.
nvds_audio_batch_meta_copy_func
gpointer nvds_audio_batch_meta_copy_func(gpointer data, gpointer user_data)
Copies or transforms meta data from one buffer to another.
MAX_RESERVED_FIELDS
#define MAX_RESERVED_FIELDS
Definition:
nvdsmeta.h:47
nvds_remove_audio_frame_meta_from_audio_batch
void nvds_remove_audio_frame_meta_from_audio_batch(NvDsBatchMeta *batch_meta, NvDsAudioFrameMeta *frame_meta)
Removes a audio frame meta from a batch meta.
NvDsClassifierMetaList
GList NvDsClassifierMetaList
Definition:
nvdsmeta.h:60
Advance Information | Subject to Change | Generated by NVIDIA | Thu May 2 2024 13:33:37 | PR-09318-R32