Doxygen Book
mqttsink.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
14 #ifndef __GST_MQTT_SINK_H__
15 #define __GST_MQTT_SINK_H__
16 #include <gst/base/gstbasesink.h>
17 #include <gst/gst.h>
18 #include <MQTTAsync.h>
19 
20 #include "mqttcommon.h"
21 
22 G_BEGIN_DECLS
23 
24 #define GST_TYPE_MQTT_SINK \
25  (gst_mqtt_sink_get_type())
26 #define GST_MQTT_SINK(obj) \
27  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MQTT_SINK, GstMqttSink))
28 #define GST_IS_MQTT_SINK(obj) \
29  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MQTT_SINK))
30 #define GST_MQTT_SINK_CAST(obj) \
31  ((GstMqttSink *) obj)
32 #define GST_MQTT_SINK_CLASS(klass) \
33  (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MQTT_SINK, GstMqttSinkClass))
34 #define GST_IS_MQTT_SINK_CLASS(klass) \
35  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MQTT_SINK))
36 
37 typedef struct _GstMqttSink GstMqttSink;
39 
43 typedef enum _mqtt_sink_state_t {
54 
60 struct _GstMqttSink {
61  GstBaseSink parent;
62  GstCaps *in_caps;
66  GError *err;
71  gchar *mqtt_topic;
76  gboolean debug;
77  gint mqtt_qos;
78  gboolean mqtt_ntp_sync;
80  gchar *mqtt_ntp_srvs;
81  gchar **mqtt_ntp_hnames;
82  guint16 *mqtt_ntp_ports;
83  gboolean is_connected;
84 
86 
88  gpointer mqtt_msg_buf;
90 
91  MQTTAsync mqtt_client_handle;
92  MQTTAsync_connectOptions mqtt_conn_opts;
93  MQTTAsync_responseOptions mqtt_respn_opts;
94 };
95 
102  GstBaseSinkClass parent_class;
103 };
104 
105 GType gst_mqtt_sink_get_type (void);
106 
107 G_END_DECLS
108 #endif /* !__GST_MQTT_SINK_H__ */
_GstMqttSink::max_msg_buf_size
gsize max_msg_buf_size
Definition: mqttsink.h:64
MQTT_CONNECT_FAILURE
@ MQTT_CONNECT_FAILURE
Definition: mqttsink.h:45
_GstMqttSink::mqtt_host_address
gchar * mqtt_host_address
Definition: mqttsink.h:69
SINK_RENDER_STOPPED
@ SINK_RENDER_STOPPED
Definition: mqttsink.h:47
MQTT_DISCONNECTED
@ MQTT_DISCONNECTED
Definition: mqttsink.h:51
gst_mqtt_sink_get_type
GType gst_mqtt_sink_get_type(void)
_GstMqttSinkClass
GstMqttSinkClass data structure.
Definition: mqttsink.h:101
_GstMqttSink::debug
gboolean debug
Definition: mqttsink.h:76
SINK_RENDER_EOS
@ SINK_RENDER_EOS
Definition: mqttsink.h:48
MQTT_CONNECTED
@ MQTT_CONNECTED
Definition: mqttsink.h:50
_GstMqttSink::mqtt_pub_wait_timeout
gulong mqtt_pub_wait_timeout
Definition: mqttsink.h:72
_GstMqttSink::mqtt_ntp_num_srvs
guint mqtt_ntp_num_srvs
Definition: mqttsink.h:79
_GstMqttSink::mqtt_sink_state
mqtt_sink_state_t mqtt_sink_state
Definition: mqttsink.h:75
MQTT_CONNECTION_LOST
@ MQTT_CONNECTION_LOST
Definition: mqttsink.h:44
_GstMqttSink::num_buffers
gint num_buffers
Definition: mqttsink.h:63
_GstMqttSink::mqtt_msg_buf
gpointer mqtt_msg_buf
Definition: mqttsink.h:88
_GstMqttSink::mqtt_respn_opts
MQTTAsync_responseOptions mqtt_respn_opts
Definition: mqttsink.h:93
mqtt_get_unix_epoch
int64_t(* mqtt_get_unix_epoch)(uint32_t, char **, uint16_t *)
Definition: mqttcommon.h:65
_GstMqttSinkClass::parent_class
GstBaseSinkClass parent_class
Definition: mqttsink.h:102
_GstMqttSink::mqtt_qos
gint mqtt_qos
Definition: mqttsink.h:77
_GstMqttSink::mqtt_client_handle
MQTTAsync mqtt_client_handle
Definition: mqttsink.h:91
MQTT_DISCONNECT_FAILED
@ MQTT_DISCONNECT_FAILED
Definition: mqttsink.h:52
_GstMqttSink::mqtt_conn_opts
MQTTAsync_connectOptions mqtt_conn_opts
Definition: mqttsink.h:92
_GstMqttSink::mqtt_msg_buf_size
gsize mqtt_msg_buf_size
Definition: mqttsink.h:89
_GstMQTTMessageHdr
Defined a custom data type, GstMQTTMessageHdr.
Definition: mqttcommon.h:49
_GstMqttSink
GstMqttSink data structure.
Definition: mqttsink.h:60
_GstMqttSink::mqtt_ntp_hnames
gchar ** mqtt_ntp_hnames
Definition: mqttsink.h:81
_GstMqttSink::err
GError * err
Definition: mqttsink.h:66
_GstMqttSink::base_time_epoch
gint64 base_time_epoch
Definition: mqttsink.h:67
mqttcommon.h
Common macros and utility functions for GStreamer MQTT plugins.
SINK_INITIALIZING
@ SINK_INITIALIZING
Definition: mqttsink.h:46
_GstMqttSink::mqtt_client_id
gchar * mqtt_client_id
Definition: mqttsink.h:68
_GstMqttSink::mqtt_ntp_sync
gboolean mqtt_ntp_sync
Definition: mqttsink.h:78
_mqtt_sink_state_t
_mqtt_sink_state_t
A type definition to indicate the state of this element.
Definition: mqttsink.h:43
_GstMqttSink::parent
GstBaseSink parent
Definition: mqttsink.h:61
_GstMqttSink::mqtt_sink_gcond
GCond mqtt_sink_gcond
Definition: mqttsink.h:74
_GstMqttSink::mqtt_topic
gchar * mqtt_topic
Definition: mqttsink.h:71
_GstMqttSink::mqtt_host_port
gchar * mqtt_host_port
Definition: mqttsink.h:70
_GstMqttSink::in_caps
GstCaps * in_caps
Definition: mqttsink.h:62
_GstMqttSink::gquark_err_tag
GQuark gquark_err_tag
Definition: mqttsink.h:65
_GstMqttSink::is_connected
gboolean is_connected
Definition: mqttsink.h:83
SINK_RENDER_ERROR
@ SINK_RENDER_ERROR
Definition: mqttsink.h:49
mqtt_sink_state_t
enum _mqtt_sink_state_t mqtt_sink_state_t
A type definition to indicate the state of this element.
_GstMqttSink::mqtt_ntp_srvs
gchar * mqtt_ntp_srvs
Definition: mqttsink.h:80
_GstMqttSink::mqtt_ntp_ports
guint16 * mqtt_ntp_ports
Definition: mqttsink.h:82
_GstMqttSink::mqtt_sink_mutex
GMutex mqtt_sink_mutex
Definition: mqttsink.h:73
_GstMqttSink::mqtt_msg_hdr
GstMQTTMessageHdr mqtt_msg_hdr
Definition: mqttsink.h:87
_GstMqttSink::get_epoch_func
mqtt_get_unix_epoch get_epoch_func
Definition: mqttsink.h:85