NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2018-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 _GST_NVMSGBROKER_H_
19 #define _GST_NVMSGBROKER_H_
20 
21 #include <gst/base/gstbasesink.h>
22 #include "nvds_msgapi.h"
23 #include "nvmsgbroker.h"
24 
25 G_BEGIN_DECLS
26 
27 #define GST_TYPE_NVMSGBROKER (gst_nvmsgbroker_get_type())
28 #define GST_NVMSGBROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVMSGBROKER,GstNvMsgBroker))
29 #define GST_NVMSGBROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVMSGBROKER,GstNvMsgBrokerClass))
30 #define GST_IS_NVMSGBROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVMSGBROKER))
31 #define GST_IS_NVMSGBROKER_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVMSGBROKER))
32 
35 
36 typedef NvDsMsgApiHandle (*nvds_msgapi_connect_ptr)(const char *connection_str,
37  nvds_msgapi_connect_cb_t connect_cb, const char *config_path);
38 
39 typedef NvDsMsgApiErrorType (*nvds_msgapi_send_ptr)(NvDsMsgApiHandle conn, const char *topic,
40  const uint8_t *payload, size_t nbuf);
41 
43  char *topic, const uint8_t *payload, size_t nbuf,
44  nvds_msgapi_send_cb_t send_callback, void *user_ptr);
45 
46 typedef void (*nvds_msgapi_do_work_ptr) (NvDsMsgApiHandle h_ptr);
47 
49 
50 struct _GstNvMsgBroker
51 {
52  GstBaseSink parent;
53 
54  GQuark dsMetaQuark;
55 
56  // Classic support via NvDsMsgApi
57  gpointer libHandle;
58  gchar *configFile;
59  gchar *protoLib;
60  gchar *connStr;
61  gchar *topic;
62  guint compId;
63  guint sleepTime;
67  gboolean is_video;
68  GMutex flowLock;
69  GCond flowCond;
70  GThread *doWorkThread;
71  gboolean isRunning;
72  gboolean asyncSend;
73  gint pendingCbCount;
80 
81  // New experimental support via NvMsgBroker lib
82  gboolean newAPI;
85 };
86 
88 {
89  GstBaseSinkClass parent_class;
90 };
91 
92 GType gst_nvmsgbroker_get_type (void);
93 
94 G_END_DECLS
95 
96 #endif
_GstNvMsgBroker
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:50
nvds_msgapi_send_ptr
NvDsMsgApiErrorType(* nvds_msgapi_send_ptr)(NvDsMsgApiHandle conn, const char *topic, const uint8_t *payload, size_t nbuf)
Definition: 9.1/sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:39
nvds_msgapi_connect_cb_t
void(* nvds_msgapi_connect_cb_t)(NvDsMsgApiHandle h_ptr, NvDsMsgApiEventType ds_evt)
Type definition for a "handle" callback.
Definition: sources/includes/nvds_msgapi.h:103
gst_nvmsgbroker_get_type
GType gst_nvmsgbroker_get_type(void)
nvds_msgapi_connect_ptr
NvDsMsgApiHandle(* nvds_msgapi_connect_ptr)(const char *connection_str, nvds_msgapi_connect_cb_t connect_cb, const char *config_path)
Definition: 9.1/sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:36
NvMsgBrokerClientHandle
void * NvMsgBrokerClientHandle
Definition: sources/includes/nvmsgbroker.h:59
NvDsMsgApiErrorType
NvDsMsgApiErrorType
Defines completion codes for operations in the messaging API.
Definition: sources/includes/nvds_msgapi.h:62
_GstNvMsgBroker::lastError
NvDsMsgApiErrorType lastError
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:74
_GstNvMsgBroker::pendingCbCount
gint pendingCbCount
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:73
_GstNvMsgBroker::parent
GstBaseSink parent
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:52
_GstNvMsgBroker::asyncSend
gboolean asyncSend
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:72
_GstNvMsgBroker::newConnHandle
NvMsgBrokerClientHandle newConnHandle
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:83
_GstNvMsgBroker::is_video
gboolean is_video
Identifies from input cap capability if the incoming data is video/audio.
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:67
_GstNvMsgBroker::flowCond
GCond flowCond
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:69
_GstNvMsgBroker::newAPI
gboolean newAPI
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:82
NvDsMsgApiHandle
void * NvDsMsgApiHandle
Defines the handle used by messaging API functions.
Definition: sources/includes/nvds_msgapi.h:45
nvds_msgapi_send_async_ptr
NvDsMsgApiErrorType(* nvds_msgapi_send_async_ptr)(NvDsMsgApiHandle h_ptr, char *topic, const uint8_t *payload, size_t nbuf, nvds_msgapi_send_cb_t send_callback, void *user_ptr)
Definition: 9.1/sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:42
_GstNvMsgBroker::doWorkThread
GThread * doWorkThread
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:70
_GstNvMsgBroker::flowLock
GMutex flowLock
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:68
nvds_msgapi_do_work_ptr
void(* nvds_msgapi_do_work_ptr)(NvDsMsgApiHandle h_ptr)
Definition: 9.1/sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:46
_GstNvMsgBroker::compId
guint compId
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:62
_GstNvMsgBroker::nvds_msgapi_disconnect
nvds_msgapi_disconnect_ptr nvds_msgapi_disconnect
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:79
_GstNvMsgBroker::newLastError
NvMsgBrokerErrorType newLastError
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:84
_GstNvMsgBroker::nvds_msgapi_connect
nvds_msgapi_connect_ptr nvds_msgapi_connect
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:75
NvMsgBrokerErrorType
NvMsgBrokerErrorType
Definition: sources/includes/nvmsgbroker.h:39
_GstNvMsgBroker::nvds_msgapi_send_async
nvds_msgapi_send_async_ptr nvds_msgapi_send_async
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:77
_GstNvMsgBroker::sleepTime
guint sleepTime
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:63
_GstNvMsgBroker::connStr
gchar * connStr
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:60
_GstNvMsgBroker::nvds_msgapi_do_work
nvds_msgapi_do_work_ptr nvds_msgapi_do_work
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:78
_GstNvMsgBroker::dsMetaQuark
GQuark dsMetaQuark
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:54
_GstNvMsgBrokerClass
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:87
nvds_msgapi_disconnect_ptr
NvDsMsgApiErrorType(* nvds_msgapi_disconnect_ptr)(NvDsMsgApiHandle conn)
Definition: 9.1/sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:48
_GstNvMsgBroker::protoLib
gchar * protoLib
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:59
nvds_msgapi_send_cb_t
void(* nvds_msgapi_send_cb_t)(void *user_ptr, NvDsMsgApiErrorType completion_flag)
Type definition for a "send" callback.
Definition: sources/includes/nvds_msgapi.h:76
_GstNvMsgBroker::nvds_msgapi_send
nvds_msgapi_send_ptr nvds_msgapi_send
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:76
_GstNvMsgBroker::connHandle
NvMsgBrokerClientHandle connHandle
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:64
_GstNvMsgBroker::isRunning
gboolean isRunning
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:71
_GstNvMsgBrokerClass::parent_class
GstBaseSinkClass parent_class
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:89
_GstNvMsgBroker::libHandle
gpointer libHandle
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:57
_GstNvMsgBroker::configFile
gchar * configFile
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:58
_GstNvMsgBroker::topic
gchar * topic
Definition: sources/gst-plugins/gst-nvmsgbroker/gstnvmsgbroker.h:61