Doxygen Book
mqttsrc.c File Reference

Subscribe a MQTT topic and push incoming data to the GStreamer pipeline. More...

#include <sys/types.h>
#include <unistd.h>
#include <gst/base/gstbasesrc.h>
#include <MQTTAsync.h>
#include <nnstreamer_util.h>
#include "mqttsrc.h"
Include dependency graph for mqttsrc.c:

Go to the source code of this file.

Macros

#define gst_mqtt_src_parent_class   parent_class
 
#define GST_CAT_DEFAULT   gst_mqtt_src_debug
 

Enumerations

enum  {
  PROP_0, PROP_DEBUG, PROP_IS_LIVE, PROP_MQTT_CLIENT_ID,
  PROP_MQTT_HOST_ADDRESS, PROP_MQTT_HOST_PORT, PROP_MQTT_SUB_TOPIC, PROP_MQTT_SUB_TIMEOUT,
  PROP_MQTT_OPT_CLEANSESSION, PROP_MQTT_OPT_KEEP_ALIVE_INTERVAL, PROP_MQTT_QOS, PROP_LAST
}
 
enum  {
  DEFAULT_DEBUG = FALSE, DEFAULT_IS_LIVE = TRUE, DEFAULT_MQTT_OPT_CLEANSESSION = TRUE, DEFAULT_MQTT_OPT_KEEP_ALIVE_INTERVAL = 60,
  DEFAULT_MQTT_SUB_TIMEOUT = 10000000, DEFAULT_MQTT_SUB_TIMEOUT_MIN = 1000000, DEFAULT_MQTT_QOS = 2
}
 

Functions

 G_DEFINE_TYPE (GstMqttSrc, gst_mqtt_src, GST_TYPE_BASE_SRC)
 
 GST_DEBUG_CATEGORY_STATIC (gst_mqtt_src_debug)
 
static void gst_mqtt_src_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 The setter for the mqttsrc's properties. More...
 
static void gst_mqtt_src_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 The getter for the mqttsrc's properties. More...
 
static void gst_mqtt_src_class_finalize (GObject *object)
 Finalize GstMqttSrcClass object. More...
 
static GstStateChangeReturn gst_mqtt_src_change_state (GstElement *element, GstStateChange transition)
 Handle mqttsrc's state change. More...
 
static gboolean gst_mqtt_src_start (GstBaseSrc *basesrc)
 Start mqttsrc, called when state changed null to ready. More...
 
static gboolean gst_mqtt_src_stop (GstBaseSrc *basesrc)
 Stop mqttsrc, called when state changed ready to null. More...
 
static GstCaps * gst_mqtt_src_get_caps (GstBaseSrc *basesrc, GstCaps *filter)
 Get caps of subclass. More...
 
static gboolean gst_mqtt_src_renegotiate (GstBaseSrc *basesrc)
 Do negotiation procedure again if it needed. More...
 
static void gst_mqtt_src_get_times (GstBaseSrc *basesrc, GstBuffer *buffer, GstClockTime *start, GstClockTime *end)
 Return the time information of the given buffer. More...
 
static gboolean gst_mqtt_src_is_seekable (GstBaseSrc *basesrc)
 Check if source supports seeking. More...
 
static GstFlowReturn gst_mqtt_src_create (GstBaseSrc *basesrc, guint64 offset, guint size, GstBuffer **buf)
 Create a buffer containing the subscribed data. More...
 
static gboolean gst_mqtt_src_query (GstBaseSrc *basesrc, GstQuery *query)
 An implementation of the GstBaseSrc vmethod that handles queries. More...
 
static gboolean gst_mqtt_src_get_debug (GstMqttSrc *self)
 Getter for the 'debug' property. More...
 
static void gst_mqtt_src_set_debug (GstMqttSrc *self, const gboolean flag)
 Setter for the 'debug' property. More...
 
static gboolean gst_mqtt_src_get_is_live (GstMqttSrc *self)
 Getter for the 'is-live' property. More...
 
static void gst_mqtt_src_set_is_live (GstMqttSrc *self, const gboolean flag)
 Setter for the 'is-live' property. More...
 
static gchar * gst_mqtt_src_get_client_id (GstMqttSrc *self)
 Getter for the 'client-id' property. More...
 
static void gst_mqtt_src_set_client_id (GstMqttSrc *self, const gchar *id)
 Setter for the 'client-id' property. More...
 
static gchar * gst_mqtt_src_get_host_address (GstMqttSrc *self)
 Getter for the 'host' property. More...
 
static void gst_mqtt_src_set_host_address (GstMqttSrc *self, const gchar *addr)
 Setter for the 'host' property. More...
 
static gchar * gst_mqtt_src_get_host_port (GstMqttSrc *self)
 Getter for the 'port' property. More...
 
static void gst_mqtt_src_set_host_port (GstMqttSrc *self, const gchar *port)
 Setter for the 'port' property. More...
 
static gint64 gst_mqtt_src_get_sub_timeout (GstMqttSrc *self)
 Getter for the 'sub-timeout' property. More...
 
static void gst_mqtt_src_set_sub_timeout (GstMqttSrc *self, const gint64 t)
 Setter for the 'sub-timeout' property. More...
 
static gchar * gst_mqtt_src_get_sub_topic (GstMqttSrc *self)
 Getter for the 'sub-topic' property. More...
 
static void gst_mqtt_src_set_sub_topic (GstMqttSrc *self, const gchar *topic)
 Setter for the 'sub-topic' property. More...
 
static gboolean gst_mqtt_src_get_opt_cleansession (GstMqttSrc *self)
 Getter for the 'cleansession' property. More...
 
static void gst_mqtt_src_set_opt_cleansession (GstMqttSrc *self, const gboolean val)
 Setter for the 'cleansession' property. More...
 
static gint gst_mqtt_src_get_opt_keep_alive_interval (GstMqttSrc *self)
 Getter for the 'keep-alive-interval' property. More...
 
static void gst_mqtt_src_set_opt_keep_alive_interval (GstMqttSrc *self, const gint num)
 Setter for the 'keep-alive-interval' property. More...
 
static gint gst_mqtt_src_get_mqtt_qos (GstMqttSrc *self)
 Getter for the 'mqtt-qos' property. More...
 
static void gst_mqtt_src_set_mqtt_qos (GstMqttSrc *self, const gint qos)
 Setter for the 'mqtt-qos' property. More...
 
static void cb_mqtt_on_connection_lost (void *context, char *cause)
 A callback to handle the connection lost to the broker. More...
 
static int cb_mqtt_on_message_arrived (void *context, char *topic_name, int topic_len, MQTTAsync_message *message)
 A callback to handle the arrived message. More...
 
static void cb_mqtt_on_connect (void *context, MQTTAsync_successData *response)
 A callback invoked when the connection is established. More...
 
static void cb_mqtt_on_connect_failure (void *context, MQTTAsync_failureData *response)
 A callback invoked when it is failed to connect to the broker. More...
 
static void cb_mqtt_on_subscribe (void *context, MQTTAsync_successData *response)
 MQTTAsync_responseOptions's onSuccess callback for MQTTAsync_subscribe () More...
 
static void cb_mqtt_on_subscribe_failure (void *context, MQTTAsync_failureData *response)
 MQTTAsync_responseOptions's onFailure callback for MQTTAsync_subscribe () More...
 
static void cb_mqtt_on_unsubscribe (void *context, MQTTAsync_successData *response)
 MQTTAsync_responseOptions's onSuccess callback for MQTTAsync_unsubscribe () More...
 
static void cb_mqtt_on_unsubscribe_failure (void *context, MQTTAsync_failureData *response)
 MQTTAsync_responseOptions's onFailure callback for MQTTAsync_unsubscribe () More...
 
static void cb_memory_wrapped_destroy (void *p)
 A callback invoked when destroying the GstMemory which wrapped the arrived message. More...
 
static GstMQTTMessageHdr_extract_mqtt_msg_hdr_from (GstMemory *mem, GstMemory **hdr_mem, GstMapInfo *hdr_map_info)
 A utility function to extract header information from a received message. More...
 
static void _put_timestamp_on_gst_buf (GstMqttSrc *self, GstMQTTMessageHdr *hdr, GstBuffer *buf)
 A utility function to put the timestamp information onto a GstBuffer-typed buffer using the given packet header. More...
 
static gboolean _subscribe (GstMqttSrc *self)
 A helper function to properly invoke MQTTAsync_subscribe () More...
 
static gboolean _unsubscribe (GstMqttSrc *self)
 A wrapper function that calls MQTTAsync_unsubscribe () More...
 
static gboolean _is_gst_buffer_timestamp_valid (GstBuffer *buf)
 A utility function to check whether the timestamp marked by _put_timestamp_on_gst_buf () is valid or not. More...
 
static void gst_mqtt_src_init (GstMqttSrc *self)
 Initialize GstMqttSrc object. More...
 
static void gst_mqtt_src_class_init (GstMqttSrcClass *klass)
 Initialize GstMqttSrcClass object. More...
 

Variables

static GstStaticPadTemplate src_pad_template
 
static guint8 src_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_MQTTSRC [] = "ERROR: MQTTSrc"
 
static const gchar DEFAULT_MQTT_CLIENT_ID []
 
static const gchar DEFAULT_MQTT_CLIENT_ID_FORMAT [] = "%s_%u_src%u"
 

Detailed Description

Subscribe a MQTT topic and push incoming data to the GStreamer pipeline.

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

Date
08 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

Definition in file mqttsrc.c.

Macro Definition Documentation

◆ GST_CAT_DEFAULT

#define GST_CAT_DEFAULT   gst_mqtt_src_debug

Definition at line 38 of file mqttsrc.c.

◆ gst_mqtt_src_parent_class

#define gst_mqtt_src_parent_class   parent_class

Definition at line 34 of file mqttsrc.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PROP_0 
PROP_DEBUG 
PROP_IS_LIVE 
PROP_MQTT_CLIENT_ID 
PROP_MQTT_HOST_ADDRESS 
PROP_MQTT_HOST_PORT 
PROP_MQTT_SUB_TOPIC 
PROP_MQTT_SUB_TIMEOUT 
PROP_MQTT_OPT_CLEANSESSION 
PROP_MQTT_OPT_KEEP_ALIVE_INTERVAL 
PROP_MQTT_QOS 
PROP_LAST 

Definition at line 40 of file mqttsrc.c.

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT_DEBUG 
DEFAULT_IS_LIVE 
DEFAULT_MQTT_OPT_CLEANSESSION 
DEFAULT_MQTT_OPT_KEEP_ALIVE_INTERVAL 
DEFAULT_MQTT_SUB_TIMEOUT 
DEFAULT_MQTT_SUB_TIMEOUT_MIN 
DEFAULT_MQTT_QOS 

Definition at line 58 of file mqttsrc.c.

Function Documentation

◆ _extract_mqtt_msg_hdr_from()

static GstMQTTMessageHdr * _extract_mqtt_msg_hdr_from ( GstMemory *  mem,
GstMemory **  hdr_mem,
GstMapInfo *  hdr_map_info 
)
static

A utility function to extract header information from a received message.

Definition at line 1347 of file mqttsrc.c.

Here is the caller graph for this function:

◆ _is_gst_buffer_timestamp_valid()

static gboolean _is_gst_buffer_timestamp_valid ( GstBuffer *  buf)
inlinestatic

A utility function to check whether the timestamp marked by _put_timestamp_on_gst_buf () is valid or not.

Definition at line 156 of file mqttsrc.c.

Here is the caller graph for this function:

◆ _put_timestamp_on_gst_buf()

static void _put_timestamp_on_gst_buf ( GstMqttSrc self,
GstMQTTMessageHdr hdr,
GstBuffer *  buf 
)
static

A utility function to put the timestamp information onto a GstBuffer-typed buffer using the given packet header.

Definition at line 1366 of file mqttsrc.c.

Here is the caller graph for this function:

◆ _subscribe()

static gboolean _subscribe ( GstMqttSrc self)
static

A helper function to properly invoke MQTTAsync_subscribe ()

Definition at line 1308 of file mqttsrc.c.

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

◆ _unsubscribe()

static gboolean _unsubscribe ( GstMqttSrc self)
static

A wrapper function that calls MQTTAsync_unsubscribe ()

Definition at line 1328 of file mqttsrc.c.

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

◆ cb_memory_wrapped_destroy()

static void cb_memory_wrapped_destroy ( void *  p)
static

A callback invoked when destroying the GstMemory which wrapped the arrived message.

Definition at line 1179 of file mqttsrc.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 invoked when the connection is established.

GstFlowReturn is an enum type. It is possible to use int here

Definition at line 1190 of file mqttsrc.c.

Here is the call graph for this function:
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 invoked when it is failed to connect to the broker.

Definition at line 1223 of file mqttsrc.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 to handle the connection lost to the broker.

Definition at line 1053 of file mqttsrc.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_message_arrived()

static int cb_mqtt_on_message_arrived ( void *  context,
char *  topic_name,
int  topic_len,
MQTTAsync_message *  message 
)
static

A callback to handle the arrived message.

Timestamp synchronization

Definition at line 1075 of file mqttsrc.c.

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

◆ cb_mqtt_on_subscribe()

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

MQTTAsync_responseOptions's onSuccess callback for MQTTAsync_subscribe ()

Definition at line 1242 of file mqttsrc.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_subscribe_failure()

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

MQTTAsync_responseOptions's onFailure callback for MQTTAsync_subscribe ()

Definition at line 1257 of file mqttsrc.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_unsubscribe()

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

MQTTAsync_responseOptions's onSuccess callback for MQTTAsync_unsubscribe ()

Definition at line 1275 of file mqttsrc.c.

Here is the caller graph for this function:

◆ cb_mqtt_on_unsubscribe_failure()

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

MQTTAsync_responseOptions's onFailure callback for MQTTAsync_unsubscribe ()

Definition at line 1290 of file mqttsrc.c.

Here is the caller graph for this function:

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstMqttSrc  ,
gst_mqtt_src  ,
GST_TYPE_BASE_SRC   
)

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( gst_mqtt_src_debug  )

◆ gst_mqtt_src_change_state()

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

Handle mqttsrc's state change.

This handles the case when the state is changed to PLAYING again

Definition at line 440 of file mqttsrc.c.

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

◆ gst_mqtt_src_class_finalize()

static void gst_mqtt_src_class_finalize ( GObject *  object)
static

Finalize GstMqttSrcClass object.

Definition at line 408 of file mqttsrc.c.

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

◆ gst_mqtt_src_class_init()

static void gst_mqtt_src_class_init ( GstMqttSrcClass klass)
static

Initialize GstMqttSrcClass object.

Definition at line 222 of file mqttsrc.c.

Here is the call graph for this function:

◆ gst_mqtt_src_create()

static GstFlowReturn gst_mqtt_src_create ( GstBaseSrc *  basesrc,
guint64  offset,
guint  size,
GstBuffer **  buf 
)
static

Create a buffer containing the subscribed data.

Todo:
DEFAULT_MQTT_SUB_TIMEOUT_MIN is too long

This buffer is coming from the past. Drop it.

Update latency

Todo:
If the difference between new latency and old latency, gst_element_post_message (GST_ELEMENT_CAST (self), gst_message_new_latency (GST_OBJECT_CAST (self))); is needed.
Todo:
: Send EoS here

Definition at line 710 of file mqttsrc.c.

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

◆ gst_mqtt_src_get_caps()

static GstCaps * gst_mqtt_src_get_caps ( GstBaseSrc *  basesrc,
GstCaps *  filter 
)
static

Get caps of subclass.

Definition at line 601 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_client_id()

static gchar * gst_mqtt_src_get_client_id ( GstMqttSrc self)
static

Getter for the 'client-id' property.

Definition at line 902 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_debug()

static gboolean gst_mqtt_src_get_debug ( GstMqttSrc self)
static

Getter for the 'debug' property.

Definition at line 865 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_host_address()

static gchar * gst_mqtt_src_get_host_address ( GstMqttSrc self)
static

Getter for the 'host' property.

Definition at line 921 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_host_port()

static gchar * gst_mqtt_src_get_host_port ( GstMqttSrc self)
static

Getter for the 'port' property.

Definition at line 943 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_is_live()

static gboolean gst_mqtt_src_get_is_live ( GstMqttSrc self)
static

Getter for the 'is-live' property.

Definition at line 883 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_mqtt_qos()

static gint gst_mqtt_src_get_mqtt_qos ( GstMqttSrc self)
static

Getter for the 'mqtt-qos' property.

Definition at line 1035 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_opt_cleansession()

static gboolean gst_mqtt_src_get_opt_cleansession ( GstMqttSrc self)
static

Getter for the 'cleansession' property.

Definition at line 999 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_opt_keep_alive_interval()

static gint gst_mqtt_src_get_opt_keep_alive_interval ( GstMqttSrc self)
static

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

Definition at line 1017 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_property()

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

The getter for the mqttsrc's properties.

Definition at line 362 of file mqttsrc.c.

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

◆ gst_mqtt_src_get_sub_timeout()

static gint64 gst_mqtt_src_get_sub_timeout ( GstMqttSrc self)
static

Getter for the 'sub-timeout' property.

Definition at line 962 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_sub_topic()

static gchar * gst_mqtt_src_get_sub_topic ( GstMqttSrc self)
static

Getter for the 'sub-topic' property.

Definition at line 980 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_get_times()

static void gst_mqtt_src_get_times ( GstBaseSrc *  basesrc,
GstBuffer *  buffer,
GstClockTime *  start,
GstClockTime *  end 
)
static

Return the time information of the given buffer.

Definition at line 674 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_init()

static void gst_mqtt_src_init ( GstMqttSrc self)
static

Initialize GstMqttSrc object.

Function definitions

init mqttsrc properties

init private member variables

Definition at line 169 of file mqttsrc.c.

Here is the call graph for this function:

◆ gst_mqtt_src_is_seekable()

static gboolean gst_mqtt_src_is_seekable ( GstBaseSrc *  basesrc)
static

Check if source supports seeking.

Note
Seeking is not supported since this element handles live subscription data.

Definition at line 700 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_query()

static gboolean gst_mqtt_src_query ( GstBaseSrc *  basesrc,
GstQuery *  query 
)
static

An implementation of the GstBaseSrc vmethod that handles queries.

The second argument of gst_query_set_latency should be always TRUE.

Definition at line 819 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_renegotiate()

static gboolean gst_mqtt_src_renegotiate ( GstBaseSrc *  basesrc)
static

Do negotiation procedure again if it needed.

Definition at line 624 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_set_client_id()

static void gst_mqtt_src_set_client_id ( GstMqttSrc self,
const gchar *  id 
)
static

Setter for the 'client-id' property.

Definition at line 911 of file mqttsrc.c.

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

◆ gst_mqtt_src_set_debug()

static void gst_mqtt_src_set_debug ( GstMqttSrc self,
const gboolean  flag 
)
static

Setter for the 'debug' property.

Definition at line 874 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_set_host_address()

static void gst_mqtt_src_set_host_address ( GstMqttSrc self,
const gchar *  addr 
)
static

Setter for the 'host' property.

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

Definition at line 930 of file mqttsrc.c.

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

◆ gst_mqtt_src_set_host_port()

static void gst_mqtt_src_set_host_port ( GstMqttSrc self,
const gchar *  port 
)
static

Setter for the 'port' property.

Definition at line 952 of file mqttsrc.c.

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

◆ gst_mqtt_src_set_is_live()

static void gst_mqtt_src_set_is_live ( GstMqttSrc self,
const gboolean  flag 
)
static

Setter for the 'is-live' property.

Definition at line 892 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_set_mqtt_qos()

static void gst_mqtt_src_set_mqtt_qos ( GstMqttSrc self,
const gint  qos 
)
static

Setter for the 'mqtt-qos' property.

Definition at line 1044 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_set_opt_cleansession()

static void gst_mqtt_src_set_opt_cleansession ( GstMqttSrc self,
const gboolean  val 
)
static

Setter for the 'cleansession' property.

Definition at line 1008 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_set_opt_keep_alive_interval()

static void gst_mqtt_src_set_opt_keep_alive_interval ( GstMqttSrc self,
const gint  num 
)
static

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

Definition at line 1026 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_set_property()

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

The setter for the mqttsrc's properties.

Function prototype declarations

Definition at line 316 of file mqttsrc.c.

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

◆ gst_mqtt_src_set_sub_timeout()

static void gst_mqtt_src_set_sub_timeout ( GstMqttSrc self,
const gint64  t 
)
static

Setter for the 'sub-timeout' property.

Definition at line 971 of file mqttsrc.c.

Here is the caller graph for this function:

◆ gst_mqtt_src_set_sub_topic()

static void gst_mqtt_src_set_sub_topic ( GstMqttSrc self,
const gchar *  topic 
)
static

Setter for the 'sub-topic' property.

Definition at line 989 of file mqttsrc.c.

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

◆ gst_mqtt_src_start()

static gboolean gst_mqtt_src_start ( GstBaseSrc *  basesrc)
static

Start mqttsrc, 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 522 of file mqttsrc.c.

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

◆ gst_mqtt_src_stop()

static gboolean gst_mqtt_src_stop ( GstBaseSrc *  basesrc)
static

Stop mqttsrc, called when state changed ready to null.

Definition at line 583 of file mqttsrc.c.

Here is the caller graph for this function:

Variable Documentation

◆ DEFAULT_MQTT_CLIENT_ID

const gchar DEFAULT_MQTT_CLIENT_ID[]
static
Initial value:
=
"$HOSTNAME_$PID_^[0-9][0-9]?$|^255$"

Definition at line 73 of file mqttsrc.c.

◆ DEFAULT_MQTT_CLIENT_ID_FORMAT

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

Definition at line 75 of file mqttsrc.c.

◆ DEFAULT_MQTT_HOST_ADDRESS

const gchar DEFAULT_MQTT_HOST_ADDRESS[] = "127.0.0.1"
static

Definition at line 70 of file mqttsrc.c.

◆ DEFAULT_MQTT_HOST_PORT

const gchar DEFAULT_MQTT_HOST_PORT[] = "1883"
static

Definition at line 71 of file mqttsrc.c.

◆ src_client_id

guint8 src_client_id = 0
static

Definition at line 69 of file mqttsrc.c.

◆ src_pad_template

GstStaticPadTemplate src_pad_template
static
Initial value:
= GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY)

Definition at line 31 of file mqttsrc.c.

◆ TAG_ERR_MQTTSRC

const gchar TAG_ERR_MQTTSRC[] = "ERROR: MQTTSrc"
static

Definition at line 72 of file mqttsrc.c.