Doxygen Book
mqttcommon.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
14 #ifndef __GST_MQTT_COMMON_H__
15 #define __GST_MQTT_COMMON_H__
16 #include <stdint.h>
17 
18 #ifndef UNUSED
19 #define UNUSED(expr) do { (void)(expr); } while (0)
20 #endif /* UNUSED */
21 
22 #ifndef GST_MQTT_PACKAGE
23 #define GST_MQTT_PACKAGE "GStreamer MQTT Plugins"
24 #endif /* GST_MQTT_PACKAGE */
25 
26 #define GST_MQTT_ELEM_NAME_SINK "mqttsink"
27 #define GST_MQTT_ELEM_NAME_SRC "mqttsrc"
28 
29 #define GST_MQTT_LEN_MSG_HDR 1024
30 #define GST_MQTT_MAX_LEN_GST_CAPS_STR 512
31 
36 #define GST_MQTT_MAX_NUM_MEMS 16
37 
38 #define GST_US_TO_NS_MULTIPLIER 1000
39 
40 #define DEFAULT_MQTT_CONN_TIMEOUT_SEC 5
41 
49 typedef struct _GstMQTTMessageHdr {
50  union {
51  struct {
52  guint num_mems;
56  GstClockTime duration;
57  GstClockTime dts;
58  GstClockTime pts;
60  };
62  };
64 
65 typedef int64_t (*mqtt_get_unix_epoch)(uint32_t, char **, uint16_t *);
66 
71 static inline int64_t default_mqtt_get_unix_epoch (uint32_t hnum, char **hnames,
72  uint16_t *hports)
73 {
74  UNUSED (hnum);
75  UNUSED (hnames);
76  UNUSED (hports);
77  return g_get_real_time ();
78 }
79 
80 #endif /* !__GST_MQTT_COMMON_H__ */
_GstMQTTMessageHdr::gst_caps_str
gchar gst_caps_str[GST_MQTT_MAX_LEN_GST_CAPS_STR]
Definition: mqttcommon.h:59
_GstMQTTMessageHdr::sent_time_epoch
gint64 sent_time_epoch
Definition: mqttcommon.h:55
GST_MQTT_LEN_MSG_HDR
#define GST_MQTT_LEN_MSG_HDR
Definition: mqttcommon.h:29
_GstMQTTMessageHdr::size_mems
gsize size_mems[GST_MQTT_MAX_NUM_MEMS]
Definition: mqttcommon.h:53
default_mqtt_get_unix_epoch
static int64_t default_mqtt_get_unix_epoch(uint32_t hnum, char **hnames, uint16_t *hports)
A wrapper function of g_get_real_time () to assign it to the function pointer, mqtt_get_unix_epoch.
Definition: mqttcommon.h:71
_GstMQTTMessageHdr::base_time_epoch
gint64 base_time_epoch
Definition: mqttcommon.h:54
UNUSED
#define UNUSED(expr)
Definition: mqttcommon.h:19
mqtt_get_unix_epoch
int64_t(* mqtt_get_unix_epoch)(uint32_t, char **, uint16_t *)
Definition: mqttcommon.h:65
GstMQTTMessageHdr
struct _GstMQTTMessageHdr GstMQTTMessageHdr
Defined a custom data type, GstMQTTMessageHdr.
GST_MQTT_MAX_LEN_GST_CAPS_STR
#define GST_MQTT_MAX_LEN_GST_CAPS_STR
Definition: mqttcommon.h:30
GST_MQTT_MAX_NUM_MEMS
#define GST_MQTT_MAX_NUM_MEMS
GST_BUFFER_MEM_MAX in gstreamer/gstbuffer.c is 16. To represent each size of the memory block that th...
Definition: mqttcommon.h:36
_GstMQTTMessageHdr
Defined a custom data type, GstMQTTMessageHdr.
Definition: mqttcommon.h:49
_GstMQTTMessageHdr::dts
GstClockTime dts
Definition: mqttcommon.h:57
_GstMQTTMessageHdr::pts
GstClockTime pts
Definition: mqttcommon.h:58
_GstMQTTMessageHdr::num_mems
guint num_mems
Definition: mqttcommon.h:52
_GstMQTTMessageHdr::duration
GstClockTime duration
Definition: mqttcommon.h:56
_GstMQTTMessageHdr::_reserved_hdr
guint8 _reserved_hdr[GST_MQTT_LEN_MSG_HDR]
Definition: mqttcommon.h:61