Doxygen Book
mqttsink.c File Reference

Register sub-plugins included in libgstmqtt. More...

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <gst/base/gstbasesink.h>
#include <MQTTAsync.h>
#include <nnstreamer_util.h>
#include "mqttsink.h"
#include "ntputil.h"
Include dependency graph for mqttsink.c:

Go to the source code of this file.

Macros

#define gst_mqtt_sink_parent_class   parent_class
 
#define GST_CAT_DEFAULT   gst_mqtt_sink_debug
 

Enumerations

enum  {
  PROP_0, PROP_DEBUG, PROP_MQTT_CLIENT_ID, PROP_MQTT_HOST_ADDRESS,
  PROP_MQTT_HOST_PORT, PROP_MQTT_PUB_TOPIC, PROP_MQTT_PUB_WAIT_TIMEOUT, PROP_MQTT_OPT_CLEANSESSION,
  PROP_MQTT_OPT_KEEP_ALIVE_INTERVAL, PROP_NUM_BUFFERS, PROP_MAX_MSG_BUF_SIZE, PROP_MQTT_QOS,
  PROP_MQTT_NTP_SYNC, PROP_MQTT_NTP_SRVS, PROP_LAST
}
 
enum  {
  DEFAULT_DEBUG = FALSE, DEFAULT_NUM_BUFFERS = -1, DEFAULT_QOS = TRUE, DEFAULT_SYNC = FALSE,
  DEFAULT_MQTT_OPT_CLEANSESSION = TRUE, DEFAULT_MQTT_OPT_KEEP_ALIVE_INTERVAL = 60, DEFAULT_MQTT_DISCONNECT_TIMEOUT = G_TIME_SPAN_SECOND * 3, DEFAULT_MQTT_PUB_WAIT_TIMEOUT = 1,
  DEFAULT_MAX_MSG_BUF_SIZE = 0, DEFAULT_MQTT_QOS = 0, DEFAULT_MQTT_NTP_SYNC = FALSE, MAX_LEN_PROP_NTP_SRVS = 4096
}
 

Functions

 G_DEFINE_TYPE (GstMqttSink, gst_mqtt_sink, GST_TYPE_BASE_SINK)
 
 GST_DEBUG_CATEGORY_STATIC (gst_mqtt_sink_debug)
 
static void gst_mqtt_sink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 The setter for the mqttsink's properties. More...
 
static void gst_mqtt_sink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 The getter for the mqttsink's properties. More...
 
static void gst_mqtt_sink_class_finalize (GObject *object)
 Finalize GstMqttSinkClass object. More...
 
static GstStateChangeReturn gst_mqtt_sink_change_state (GstElement *element, GstStateChange transition)
 Handle mqttsink's state change. More...
 
static gboolean gst_mqtt_sink_start (GstBaseSink *basesink)
 Start mqttsink, called when state changed null to ready. More...
 
static gboolean gst_mqtt_sink_stop (GstBaseSink *basesink)
 Stop mqttsink, called when state changed ready to null. More...
 
static gboolean gst_mqtt_sink_query (GstBaseSink *basesink, GstQuery *query)
 Perform queries on the element. More...
 
static GstFlowReturn gst_mqtt_sink_render (GstBaseSink *basesink, GstBuffer *in_buf)
 The callback to process each buffer receiving on the sink pad. More...
 
static GstFlowReturn gst_mqtt_sink_render_list (GstBaseSink *basesink, GstBufferList *list)
 The callback to process GstBufferList (instead of a single buffer) on the sink pad. More...
 
static gboolean gst_mqtt_sink_event (GstBaseSink *basesink, GstEvent *event)
 Handle events arriving on the sink pad. More...
 
static gboolean gst_mqtt_sink_set_caps (GstBaseSink *basesink, GstCaps *caps)
 An implementation of the set_caps vmethod in GstBaseSinkClass. More...
 
static gboolean gst_mqtt_sink_get_debug (GstMqttSink *self)
 Getter for the 'debug' property. More...
 
static void gst_mqtt_sink_set_debug (GstMqttSink *self, const gboolean flag)
 Setter for the 'debug' property. More...
 
static gchar * gst_mqtt_sink_get_client_id (GstMqttSink *self)
 Getter for the 'client-id' property. More...
 
static void gst_mqtt_sink_set_client_id (GstMqttSink *self, const gchar *id)
 Setter for the 'client-id' property. More...
 
static gchar * gst_mqtt_sink_get_host_address (GstMqttSink *self)
 Getter for the 'host' property. More...
 
static void gst_mqtt_sink_set_host_address (GstMqttSink *self, const gchar *addr)
 Setter for the 'host' property. More...
 
static gchar * gst_mqtt_sink_get_host_port (GstMqttSink *self)
 Getter for the 'port' property. More...
 
static void gst_mqtt_sink_set_host_port (GstMqttSink *self, const gchar *port)
 Setter for the 'port' property. More...
 
static gchar * gst_mqtt_sink_get_pub_topic (GstMqttSink *self)
 Getter for the 'pub-topic' property. More...
 
static void gst_mqtt_sink_set_pub_topic (GstMqttSink *self, const gchar *topic)
 Setter for the 'pub-topic' property. More...
 
static gulong gst_mqtt_sink_get_pub_wait_timeout (GstMqttSink *self)
 Getter for the 'pub-wait-timeout' property. More...
 
static void gst_mqtt_sink_set_pub_wait_timeout (GstMqttSink *self, const gulong to)
 Setter for the 'pub-wait-timeout' property. More...
 
static gboolean gst_mqtt_sink_get_opt_cleansession (GstMqttSink *self)
 Getter for the 'cleansession' property. More...
 
static void gst_mqtt_sink_set_opt_cleansession (GstMqttSink *self, const gboolean val)
 Setter for the 'cleansession' property. More...
 
static gint gst_mqtt_sink_get_opt_keep_alive_interval (GstMqttSink *self)
 Getter for the 'keep-alive-interval' property. More...
 
static void gst_mqtt_sink_set_opt_keep_alive_interval (GstMqttSink *self, const gint num)
 Setter for the 'keep-alive-interval' property. More...
 
static gsize gst_mqtt_sink_get_max_msg_buf_size (GstMqttSink *self)
 Getter for the 'max-buffer-size' property. More...
 
static void gst_mqtt_sink_set_max_msg_buf_size (GstMqttSink *self, const gsize size)
 Setter for the 'max-buffer-size' property. More...
 
static gint gst_mqtt_sink_get_num_buffers (GstMqttSink *self)
 Getter for the 'num-buffers' property. More...
 
static void gst_mqtt_sink_set_num_buffers (GstMqttSink *self, const gint num)
 Setter for the 'num-buffers' property. More...
 
static gint gst_mqtt_sink_get_mqtt_qos (GstMqttSink *self)
 Getter for the 'mqtt-qos' property. More...
 
static void gst_mqtt_sink_set_mqtt_qos (GstMqttSink *self, const gint qos)
 Setter for the 'mqtt-qos' property. More...
 
static gboolean gst_mqtt_sink_get_mqtt_ntp_sync (GstMqttSink *self)
 Getter for the 'ntp-sync' property. More...
 
static void gst_mqtt_sink_set_mqtt_ntp_sync (GstMqttSink *self, const gboolean flag)
 Setter for the 'ntp-sync' property. More...
 
static gchar * gst_mqtt_sink_get_mqtt_ntp_srvs (GstMqttSink *self)
 Getter for the 'ntp-srvs' property. More...
 
static void gst_mqtt_sink_set_mqtt_ntp_srvs (GstMqttSink *self, const gchar *pairs)
 Setter for the 'ntp-srvs' property. More...
 
static void cb_mqtt_on_connect (void *context, MQTTAsync_successData *response)
 A callback function corresponding to MQTTAsync_connectOptions's onSuccess. This callback is invoked when the connection between this element and the broker is properly established. More...
 
static void cb_mqtt_on_connect_failure (void *context, MQTTAsync_failureData *response)
 A callback function corresponding to MQTTAsync_connectOptions's onFailure. This callback is invoked when it is failed to connect to the broker. More...
 
static void cb_mqtt_on_disconnect (void *context, MQTTAsync_successData *response)
 A callback function corresponding to MQTTAsync_disconnectOptions's onSuccess. Regardless of the MQTTAsync_disconnect function's result, the pipeline should be stopped after this callback. More...
 
static void cb_mqtt_on_disconnect_failure (void *context, MQTTAsync_failureData *response)
 A callback function corresponding to MQTTAsync_disconnectOptions's onFailure. Regardless of the MQTTAsync_disconnect function's result, the pipeline should be stopped after this callback. More...
 
static void cb_mqtt_on_delivery_complete (void *context, MQTTAsync_token token)
 A callback function to be given to the MQTTAsync_setCallbacks function. This callback is activated when mqtt-qos is higher then 0. More...
 
static void cb_mqtt_on_connection_lost (void *context, char *cause)
 A callback function to be given to the MQTTAsync_setCallbacks function. When the connection between this element and the broker is broken, this callback will be invoked. More...
 
static int cb_mqtt_on_message_arrived (void *context, char *topicName, int topicLen, MQTTAsync_message *message)
 A callback function to be given to the MQTTAsync_setCallbacks function. In the case of the publisher, this callback is not used. More...
 
static void cb_mqtt_on_send_success (void *context, MQTTAsync_successData *response)
 A callback function corresponding to MQTTAsync_responseOptions's onSuccess. More...
 
static void cb_mqtt_on_send_failure (void *context, MQTTAsync_failureData *response)
 A callback function corresponding to MQTTAsync_responseOptions's onFailure. More...
 
static void gst_mqtt_sink_init (GstMqttSink *self)
 Initialize GstMqttSink object. More...
 
static void gst_mqtt_sink_class_init (GstMqttSinkClass *klass)
 Initialize GstMqttSinkClass object. More...
 
static void _put_timestamp_to_msg_buf_hdr (GstMqttSink *self, GstBuffer *gst_buf, GstMQTTMessageHdr *hdr)
 A utility function to set the timestamp information onto the given buffer. More...
 
static gboolean _mqtt_set_msg_buf_hdr (GstBuffer *gst_buf, GstMQTTMessageHdr *hdr)
 A utility function to set the message header. More...
 

Variables

static GstStaticPadTemplate sink_pad_template
 
static guint8 sink_client_id = 0
 
static const gchar DEFAULT_MQTT_HOST_ADDRESS [] = "127.0.0.1"
 
static const gchar DEFAULT_MQTT_HOST_PORT [] = "1883"
 
static const gchar TAG_ERR_MQTTSINK [] = "ERROR: MQTTSink"
 
static const gchar DEFAULT_MQTT_CLIENT_ID [] = "$HOST_$PID_^[0-9][0-9]?$|^255$"
 
static const gchar DEFAULT_MQTT_CLIENT_ID_FORMAT [] = "%s_%u_sink%u"
 
static const gchar DEFAULT_MQTT_PUB_TOPIC [] = "$client-id/topic"
 
static const gchar DEFAULT_MQTT_PUB_TOPIC_FORMAT [] = "%s/topic"
 
static const gchar DEFAULT_MQTT_NTP_SERVERS [] = "pool.ntp.org:123"
 

Detailed Description

Register sub-plugins included in libgstmqtt.

Publish incoming data streams as a MQTT topic.

Copyright (C) 2021 Wook Song wook1.nosp@m.6.so.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com

Date
09 Mar 2021
See also
https://github.com/nnstreamer/nnstreamer
Author
Wook Song wook1.nosp@m.6.so.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com
Bug:
No known bugs except for NYI items

Copyright (C) 2021 Wook Song wook1.nosp@m.6.so.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com

Date
01 Apr 2021
See also
https://github.com/nnstreamer/nnstreamer
Author
Wook Song wook1.nosp@m.6.so.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com
Bug:
No known bugs except for NYI items

Definition in file mqttsink.c.

Macro Definition Documentation

◆ GST_CAT_DEFAULT

#define GST_CAT_DEFAULT   gst_mqtt_sink_debug

Definition at line 42 of file mqttsink.c.

◆ gst_mqtt_sink_parent_class

#define gst_mqtt_sink_parent_class   parent_class

Definition at line 38 of file mqttsink.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT_DEBUG 
DEFAULT_NUM_BUFFERS 
DEFAULT_QOS 
DEFAULT_SYNC 
DEFAULT_MQTT_OPT_CLEANSESSION 
DEFAULT_MQTT_OPT_KEEP_ALIVE_INTERVAL 
DEFAULT_MQTT_DISCONNECT_TIMEOUT 
DEFAULT_MQTT_PUB_WAIT_TIMEOUT 
DEFAULT_MAX_MSG_BUF_SIZE 
DEFAULT_MQTT_QOS 
DEFAULT_MQTT_NTP_SYNC 
MAX_LEN_PROP_NTP_SRVS 

Definition at line 65 of file mqttsink.c.

◆ anonymous enum

anonymous enum
Enumerator
PROP_0 
PROP_DEBUG 
PROP_MQTT_CLIENT_ID 
PROP_MQTT_HOST_ADDRESS 
PROP_MQTT_HOST_PORT 
PROP_MQTT_PUB_TOPIC 
PROP_MQTT_PUB_WAIT_TIMEOUT 
PROP_MQTT_OPT_CLEANSESSION 
PROP_MQTT_OPT_KEEP_ALIVE_INTERVAL 
PROP_NUM_BUFFERS 
PROP_MAX_MSG_BUF_SIZE 
PROP_MQTT_QOS 
PROP_MQTT_NTP_SYNC 
PROP_MQTT_NTP_SRVS 
PROP_LAST 

Definition at line 44 of file mqttsink.c.

Function Documentation

◆ _mqtt_set_msg_buf_hdr()

static gboolean _mqtt_set_msg_buf_hdr ( GstBuffer *  gst_buf,
GstMQTTMessageHdr hdr 
)
static

A utility function to set the message header.

Definition at line 725 of file mqttsink.c.

Here is the caller graph for this function:

◆ _put_timestamp_to_msg_buf_hdr()

static void _put_timestamp_to_msg_buf_hdr ( GstMqttSink self,
GstBuffer *  gst_buf,
GstMQTTMessageHdr hdr 
)
static

A utility function to set the timestamp information onto the given buffer.

Definition at line 688 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_connect()

static void cb_mqtt_on_connect ( void *  context,
MQTTAsync_successData *  response 
)
static

A callback function corresponding to MQTTAsync_connectOptions's onSuccess. This callback is invoked when the connection between this element and the broker is properly established.

Callback function definitions

Definition at line 1267 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_connect_failure()

static void cb_mqtt_on_connect_failure ( void *  context,
MQTTAsync_failureData *  response 
)
static

A callback function corresponding to MQTTAsync_connectOptions's onFailure. This callback is invoked when it is failed to connect to the broker.

Definition at line 1285 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_connection_lost()

static void cb_mqtt_on_connection_lost ( void *  context,
char *  cause 
)
static

A callback function to be given to the MQTTAsync_setCallbacks function. When the connection between this element and the broker is broken, this callback will be invoked.

Definition at line 1351 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_delivery_complete()

static void cb_mqtt_on_delivery_complete ( void *  context,
MQTTAsync_token  token 
)
static

A callback function to be given to the MQTTAsync_setCallbacks function. This callback is activated when mqtt-qos is higher then 0.

Definition at line 1336 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_disconnect()

static void cb_mqtt_on_disconnect ( void *  context,
MQTTAsync_successData *  response 
)
static

A callback function corresponding to MQTTAsync_disconnectOptions's onSuccess. Regardless of the MQTTAsync_disconnect function's result, the pipeline should be stopped after this callback.

Definition at line 1303 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_disconnect_failure()

static void cb_mqtt_on_disconnect_failure ( void *  context,
MQTTAsync_failureData *  response 
)
static

A callback function corresponding to MQTTAsync_disconnectOptions's onFailure. Regardless of the MQTTAsync_disconnect function's result, the pipeline should be stopped after this callback.

Definition at line 1320 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_message_arrived()

static int cb_mqtt_on_message_arrived ( void *  context,
char *  topicName,
int  topicLen,
MQTTAsync_message *  message 
)
static

A callback function to be given to the MQTTAsync_setCallbacks function. In the case of the publisher, this callback is not used.

Definition at line 1368 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_send_failure()

static void cb_mqtt_on_send_failure ( void *  context,
MQTTAsync_failureData *  response 
)
static

A callback function corresponding to MQTTAsync_responseOptions's onFailure.

Definition at line 1404 of file mqttsink.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_send_success()

static void cb_mqtt_on_send_success ( void *  context,
MQTTAsync_successData *  response 
)
static

A callback function corresponding to MQTTAsync_responseOptions's onSuccess.

Definition at line 1384 of file mqttsink.c.

Here is the caller graph for this function:

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstMqttSink  ,
gst_mqtt_sink  ,
GST_TYPE_BASE_SINK   
)

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( gst_mqtt_sink_debug  )

◆ gst_mqtt_sink_change_state()

static GstStateChangeReturn gst_mqtt_sink_change_state ( GstElement *  element,
GstStateChange  transition 
)
static

Handle mqttsink's state change.

Definition at line 491 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_class_finalize()

static void gst_mqtt_sink_class_finalize ( GObject *  object)
static

Finalize GstMqttSinkClass object.

Definition at line 454 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_class_init()

static void gst_mqtt_sink_class_init ( GstMqttSinkClass klass)
static

Initialize GstMqttSinkClass object.

Definition at line 229 of file mqttsink.c.

Here is the call graph for this function:

◆ gst_mqtt_sink_event()

static gboolean gst_mqtt_sink_event ( GstBaseSink *  basesink,
GstEvent *  event 
)
static

Handle events arriving on the sink pad.

Definition at line 898 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_client_id()

static gchar * gst_mqtt_sink_get_client_id ( GstMqttSink self)
static

Getter for the 'client-id' property.

Definition at line 976 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_debug()

static gboolean gst_mqtt_sink_get_debug ( GstMqttSink self)
static

Getter for the 'debug' property.

Definition at line 958 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_host_address()

static gchar * gst_mqtt_sink_get_host_address ( GstMqttSink self)
static

Getter for the 'host' property.

Definition at line 995 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_host_port()

static gchar * gst_mqtt_sink_get_host_port ( GstMqttSink self)
static

Getter for the 'port' property.

Definition at line 1017 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_max_msg_buf_size()

static gsize gst_mqtt_sink_get_max_msg_buf_size ( GstMqttSink self)
static

Getter for the 'max-buffer-size' property.

Definition at line 1109 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_mqtt_ntp_srvs()

static gchar * gst_mqtt_sink_get_mqtt_ntp_srvs ( GstMqttSink self)
static

Getter for the 'ntp-srvs' property.

Definition at line 1185 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_mqtt_ntp_sync()

static gboolean gst_mqtt_sink_get_mqtt_ntp_sync ( GstMqttSink self)
static

Getter for the 'ntp-sync' property.

Definition at line 1167 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_mqtt_qos()

static gint gst_mqtt_sink_get_mqtt_qos ( GstMqttSink self)
static

Getter for the 'mqtt-qos' property.

Definition at line 1149 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_num_buffers()

static gint gst_mqtt_sink_get_num_buffers ( GstMqttSink self)
static

Getter for the 'num-buffers' property.

Definition at line 1127 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_opt_cleansession()

static gboolean gst_mqtt_sink_get_opt_cleansession ( GstMqttSink self)
static

Getter for the 'cleansession' property.

Definition at line 1055 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_opt_keep_alive_interval()

static gint gst_mqtt_sink_get_opt_keep_alive_interval ( GstMqttSink self)
static

Getter for the 'keep-alive-interval' property.

Definition at line 1091 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_property()

static void gst_mqtt_sink_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  pspec 
)
static

The getter for the mqttsink's properties.

Definition at line 399 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_get_pub_topic()

static gchar * gst_mqtt_sink_get_pub_topic ( GstMqttSink self)
static

Getter for the 'pub-topic' property.

Definition at line 1036 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_get_pub_wait_timeout()

static gulong gst_mqtt_sink_get_pub_wait_timeout ( GstMqttSink self)
static

Getter for the 'pub-wait-timeout' property.

Definition at line 1073 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_init()

static void gst_mqtt_sink_init ( GstMqttSink self)
static

Initialize GstMqttSink object.

init MQTT related variables

init private variables

init mqttsink properties

init basesink properties

Definition at line 171 of file mqttsink.c.

Here is the call graph for this function:

◆ gst_mqtt_sink_query()

static gboolean gst_mqtt_sink_query ( GstBaseSink *  basesink,
GstQuery *  query 
)
static

Perform queries on the element.

Definition at line 661 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_render()

static GstFlowReturn gst_mqtt_sink_render ( GstBaseSink *  basesink,
GstBuffer *  buffer 
)
static

The callback to process each buffer receiving on the sink pad.

Allocate a message buffer

Definition at line 751 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_render_list()

static GstFlowReturn gst_mqtt_sink_render_list ( GstBaseSink *  basesink,
GstBufferList *  list 
)
static

The callback to process GstBufferList (instead of a single buffer) on the sink pad.

Definition at line 877 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_caps()

static gboolean gst_mqtt_sink_set_caps ( GstBaseSink *  basesink,
GstCaps *  caps 
)
static

An implementation of the set_caps vmethod in GstBaseSinkClass.

Definition at line 924 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_client_id()

static void gst_mqtt_sink_set_client_id ( GstMqttSink self,
const gchar *  id 
)
static

Setter for the 'client-id' property.

Definition at line 985 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_debug()

static void gst_mqtt_sink_set_debug ( GstMqttSink self,
const gboolean  flag 
)
static

Setter for the 'debug' property.

Definition at line 967 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_set_host_address()

static void gst_mqtt_sink_set_host_address ( GstMqttSink self,
const gchar *  addr 
)
static

Setter for the 'host' property.

Todo:
Handle the case where the addr is changed at runtime

Definition at line 1004 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_host_port()

static void gst_mqtt_sink_set_host_port ( GstMqttSink self,
const gchar *  port 
)
static

Setter for the 'port' property.

Definition at line 1026 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_max_msg_buf_size()

static void gst_mqtt_sink_set_max_msg_buf_size ( GstMqttSink self,
const gsize  size 
)
static

Setter for the 'max-buffer-size' property.

Definition at line 1118 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_set_mqtt_ntp_srvs()

static void gst_mqtt_sink_set_mqtt_ntp_srvs ( GstMqttSink self,
const gchar *  pairs 
)
static

Setter for the 'ntp-srvs' property.

Definition at line 1194 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_mqtt_ntp_sync()

static void gst_mqtt_sink_set_mqtt_ntp_sync ( GstMqttSink self,
const gboolean  flag 
)
static

Setter for the 'ntp-sync' property.

Definition at line 1176 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_set_mqtt_qos()

static void gst_mqtt_sink_set_mqtt_qos ( GstMqttSink self,
const gint  qos 
)
static

Setter for the 'mqtt-qos' property.

Definition at line 1158 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_set_num_buffers()

static void gst_mqtt_sink_set_num_buffers ( GstMqttSink self,
const gint  num 
)
static

Setter for the 'num-buffers' property.

Definition at line 1140 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_set_opt_cleansession()

static void gst_mqtt_sink_set_opt_cleansession ( GstMqttSink self,
const gboolean  val 
)
static

Setter for the 'cleansession' property.

Definition at line 1064 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_set_opt_keep_alive_interval()

static void gst_mqtt_sink_set_opt_keep_alive_interval ( GstMqttSink self,
const gint  num 
)
static

Setter for the 'keep-alive-interval' property.

Definition at line 1100 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_set_property()

static void gst_mqtt_sink_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

The setter for the mqttsink's properties.

Function prototype declarations

Definition at line 344 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_pub_topic()

static void gst_mqtt_sink_set_pub_topic ( GstMqttSink self,
const gchar *  topic 
)
static

Setter for the 'pub-topic' property.

Definition at line 1045 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_set_pub_wait_timeout()

static void gst_mqtt_sink_set_pub_wait_timeout ( GstMqttSink self,
const gulong  to 
)
static

Setter for the 'pub-wait-timeout' property.

Definition at line 1082 of file mqttsink.c.

Here is the caller graph for this function:

◆ gst_mqtt_sink_start()

static gboolean gst_mqtt_sink_start ( GstBaseSink *  basesink)
static

Start mqttsink, called when state changed null to ready.

Todo:
Support other persistence mechanisms MQTTCLIENT_PERSISTENCE_NONE: A memory-based persistence mechanism MQTTCLIENT_PERSISTENCE_DEFAULT: The default file system-based persistence mechanism MQTTCLIENT_PERSISTENCE_USER: An application-specific persistence mechanism

Definition at line 554 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_mqtt_sink_stop()

static gboolean gst_mqtt_sink_stop ( GstBaseSink *  basesink)
static

Stop mqttsink, called when state changed ready to null.

Definition at line 623 of file mqttsink.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ DEFAULT_MQTT_CLIENT_ID

const gchar DEFAULT_MQTT_CLIENT_ID[] = "$HOST_$PID_^[0-9][0-9]?$|^255$"
static

Definition at line 85 of file mqttsink.c.

◆ DEFAULT_MQTT_CLIENT_ID_FORMAT

const gchar DEFAULT_MQTT_CLIENT_ID_FORMAT[] = "%s_%u_sink%u"
static

Definition at line 86 of file mqttsink.c.

◆ DEFAULT_MQTT_HOST_ADDRESS

const gchar DEFAULT_MQTT_HOST_ADDRESS[] = "127.0.0.1"
static

Definition at line 82 of file mqttsink.c.

◆ DEFAULT_MQTT_HOST_PORT

const gchar DEFAULT_MQTT_HOST_PORT[] = "1883"
static

Definition at line 83 of file mqttsink.c.

◆ DEFAULT_MQTT_NTP_SERVERS

const gchar DEFAULT_MQTT_NTP_SERVERS[] = "pool.ntp.org:123"
static

Definition at line 89 of file mqttsink.c.

◆ DEFAULT_MQTT_PUB_TOPIC

const gchar DEFAULT_MQTT_PUB_TOPIC[] = "$client-id/topic"
static

Definition at line 87 of file mqttsink.c.

◆ DEFAULT_MQTT_PUB_TOPIC_FORMAT

const gchar DEFAULT_MQTT_PUB_TOPIC_FORMAT[] = "%s/topic"
static

Definition at line 88 of file mqttsink.c.

◆ sink_client_id

guint8 sink_client_id = 0
static

Definition at line 81 of file mqttsink.c.

◆ sink_pad_template

GstStaticPadTemplate sink_pad_template
static
Initial value:
= GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY)

Definition at line 35 of file mqttsink.c.

◆ TAG_ERR_MQTTSINK

const gchar TAG_ERR_MQTTSINK[] = "ERROR: MQTTSink"
static

Definition at line 84 of file mqttsink.c.