From ef2c9147a69fa2963c12c04a710ff133877200aa Mon Sep 17 00:00:00 2001 From: gichan Date: Tue, 25 Oct 2022 14:05:53 +0900 Subject: [PATCH] [Edge] Change localhost address for mqtt Change localhost address for mqtt from tcp://localhost to 127.0.0.1. * mosquitto lib cannot parse the previous form. Signed-off-by: gichan --- gst/edge/edge_sink.c | 2 +- gst/mqtt/README.md | 2 +- gst/mqtt/mqttsink.c | 2 +- gst/mqtt/mqttsrc.c | 2 +- gst/nnstreamer/tensor_query/README.md | 2 +- gst/nnstreamer/tensor_query/tensor_query_serversrc.c | 2 +- tests/nnstreamer_edge/query/runTest.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gst/edge/edge_sink.c b/gst/edge/edge_sink.c index 83d7d27..c597bec 100644 --- a/gst/edge/edge_sink.c +++ b/gst/edge/edge_sink.c @@ -43,7 +43,7 @@ enum PROP_LAST }; -#define DEFAULT_MQTT_HOST "tcp://localhost" +#define DEFAULT_MQTT_HOST "127.0.0.1" #define DEFAULT_MQTT_PORT 1883 #define gst_edgesink_parent_class parent_class diff --git a/gst/mqtt/README.md b/gst/mqtt/README.md index ec767f1..072cd71 100644 --- a/gst/mqtt/README.md +++ b/gst/mqtt/README.md @@ -19,7 +19,7 @@ The specifics will evolve as the corresponding developers' understangins of MQTT ## Usage Example Before using the GstMQTT elements, make sure that the MQTT broker runs on the local/remote machine. -In the following example, the broker's URL is ```tcp://localhost:1883```, the GstMQTT elements' default value. +In the following example, the broker's URL is ```127.0.0.1:1883```, the GstMQTT elements' default value. To specify it according to your environment, use ```host``` and ```port``` properties. ```bash diff --git a/gst/mqtt/mqttsink.c b/gst/mqtt/mqttsink.c index 740cb58..996922a 100644 --- a/gst/mqtt/mqttsink.c +++ b/gst/mqtt/mqttsink.c @@ -79,7 +79,7 @@ enum }; static guint8 sink_client_id = 0; -static const gchar DEFAULT_MQTT_HOST_ADDRESS[] = "tcp://localhost"; +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$"; diff --git a/gst/mqtt/mqttsrc.c b/gst/mqtt/mqttsrc.c index 1bb1e85..fa84f9d 100644 --- a/gst/mqtt/mqttsrc.c +++ b/gst/mqtt/mqttsrc.c @@ -67,7 +67,7 @@ enum }; static guint8 src_client_id = 0; -static const gchar DEFAULT_MQTT_HOST_ADDRESS[] = "tcp://localhost"; +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[] = diff --git a/gst/nnstreamer/tensor_query/README.md b/gst/nnstreamer/tensor_query/README.md index 078acb2..abbac97 100644 --- a/gst/nnstreamer/tensor_query/README.md +++ b/gst/nnstreamer/tensor_query/README.md @@ -105,7 +105,7 @@ $ gst-launch-1.0 \ $ gst-launch-1.0 \ compositor name=mix sink_0::zorder=2 sink_1::zorder=1 ! videoconvert ! ximagesink \ v4l2src ! videoconvert ! videoscale ! video/x-raw,width=640,height=480,format=RGB,framerate=10/1 ! tee name=t \ - t. ! queue ! tensor_query_client port=0 connect-type=HYBRID dest-host=tcp://localhost dest-port=1883 topic=passthrough ! videoconvert ! mix.sink_0 \ + t. ! queue ! tensor_query_client port=0 connect-type=HYBRID dest-host=127.0.0.1 dest-port=1883 topic=passthrough ! videoconvert ! mix.sink_0 \ t. ! queue ! mix.sink_1 ``` diff --git a/gst/nnstreamer/tensor_query/tensor_query_serversrc.c b/gst/nnstreamer/tensor_query/tensor_query_serversrc.c index eccdd05..3d4c703 100644 --- a/gst/nnstreamer/tensor_query/tensor_query_serversrc.c +++ b/gst/nnstreamer/tensor_query/tensor_query_serversrc.c @@ -25,7 +25,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_tensor_query_serversrc_debug); #define DEFAULT_PORT_SRC 3000 #define DEFAULT_IS_LIVE TRUE -#define DEFAULT_MQTT_HOST "tcp://localhost" +#define DEFAULT_MQTT_HOST "127.0.0.1" #define DEFAULT_MQTT_PORT 1883 /** diff --git a/tests/nnstreamer_edge/query/runTest.sh b/tests/nnstreamer_edge/query/runTest.sh index 0e4ced0..12aae68 100644 --- a/tests/nnstreamer_edge/query/runTest.sh +++ b/tests/nnstreamer_edge/query/runTest.sh @@ -161,7 +161,7 @@ mospid=$! # Test Query-hybrid. Get server info from broker. gstTestBackground "--gst-plugin-path=${PATH_TO_PLUGIN} tensor_query_serversrc id=12345 port=0 dest-port=${PORT} topic=passthrough connect-type=HYBRID ! other/tensors,format=flexible,framerate=0/1 ! tee name = t t. ! queue ! multifilesink location=server1_%1d.log t. ! queue ! tensor_query_serversink id=12345 connect-type=HYBRID async=false" 9-1 0 0 5 pid=$! -gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=10 is-live=true ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! other/tensors,format=flexible ! tee name = t t. ! queue ! multifilesink location= raw4_%1d.log t. ! queue ! tensor_query_client connect-type=HYBRID port=0 dest-host=tcp://localhost dest-port=${PORT} topic=passthrough ! multifilesink location=result4_%1d.log" 9-3 0 0 $PERFORMANCE $TIMEOUT_SEC +gstTest "--gst-plugin-path=${PATH_TO_PLUGIN} videotestsrc num-buffers=10 is-live=true ! videoconvert ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! other/tensors,format=flexible ! tee name = t t. ! queue ! multifilesink location= raw4_%1d.log t. ! queue ! tensor_query_client connect-type=HYBRID port=0 dest-host=127.0.0.1 dest-port=${PORT} topic=passthrough ! multifilesink location=result4_%1d.log" 9-3 0 0 $PERFORMANCE $TIMEOUT_SEC _callCompareTest raw4_0.log result4_0.log 9-4 "Compare the raw file and client received file 9-4" 1 0 _callCompareTest raw4_1.log result4_1.log 9-5 "Compare the raw file and client received file 9-5" 1 0 _callCompareTest raw4_2.log result4_2.log 9-6 "Compare the raw file and client received file 9-6" 1 0 -- 2.7.4