G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_PORT,
g_param_spec_uint ("port", "Port",
- "A self port address to accept connection from edgesrc.",
+ "A self port address to accept connection from edgesrc. "
+ "If the port is set to 0 then the available port is allocated. "
+ "If the connect-type is AITT then the port setting is not required.",
0, 65535, DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_CONNECT_TYPE,
g_param_spec_enum ("connect-type", "Connect Type",
g_object_class_install_property (gobject_class, PROP_HOST,
g_param_spec_string ("host", "Host",
- "A self host address", DEFAULT_HOST,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ "A self host address (DEPRECATED, has no effect).", DEFAULT_HOST,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class, PROP_PORT,
g_param_spec_uint ("port", "Port",
- "A self port number.",
- 0, 65535, DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ "A self port number (DEPRECATED, has no effect).",
+ 0, 65535, DEFAULT_PORT,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class, PROP_DEST_HOST,
g_param_spec_string ("dest-host", "Destination Host",
"A host address of edgesink to receive the packets from edgesink",
DEFAULT_HOST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_DEST_PORT,
g_param_spec_uint ("dest-port", "Destination Port",
- "A port of edgesink to receive the packets from edgesink",
- 0, 65535, DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ "A port of edgesink to receive the packets from edgesink", 0, 65535,
+ DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_CONNECT_TYPE,
g_param_spec_enum ("connect-type", "Connect Type",
"The connections type between edgesink and edgesrc.",
gst_base_src_set_format (basesrc, GST_FORMAT_TIME);
gst_base_src_set_async (basesrc, FALSE);
- self->host = g_strdup (DEFAULT_HOST);
- self->port = DEFAULT_PORT;
self->dest_host = g_strdup (DEFAULT_HOST);
self->dest_port = DEFAULT_PORT;
self->topic = NULL;
switch (prop_id) {
case PROP_HOST:
- if (!g_value_get_string (value)) {
- nns_logw ("host property cannot be NULL");
- break;
- }
- g_free (self->host);
- self->host = g_value_dup_string (value);
+ nns_logw ("host property is deprecated");
break;
case PROP_PORT:
- self->port = g_value_get_uint (value);
+ nns_logw ("port property is deprecated");
break;
case PROP_DEST_HOST:
gst_edgesrc_set_dest_host (self, g_value_get_string (value));
switch (prop_id) {
case PROP_HOST:
- g_value_set_string (value, self->host);
+ nns_logw ("host property is deprecated");
break;
case PROP_PORT:
- g_value_set_uint (value, self->port);
+ nns_logw ("port property is deprecated");
break;
case PROP_DEST_HOST:
g_value_set_string (value, gst_edgesrc_get_dest_host (self));
GstEdgeSrc *self = GST_EDGESRC (object);
nns_edge_data_h data_h;
- g_free (self->host);
- self->host = NULL;
-
g_free (self->dest_host);
self->dest_host = NULL;
return FALSE;
}
- if (self->host)
- nns_edge_set_info (self->edge_h, "HOST", self->host);
- if (self->port > 0) {
- port = g_strdup_printf ("%u", self->port);
- nns_edge_set_info (self->edge_h, "PORT", port);
- g_free (port);
- }
if (self->dest_host)
nns_edge_set_info (self->edge_h, "DEST_HOST", self->dest_host);
if (self->dest_port > 0) {
gchar *str_val;
/* Create a nnstreamer pipeline */
- pipeline = g_strdup_printf ("gst-launch-1.0 edgesrc port=0 name=srcx ! "
+ pipeline = g_strdup_printf ("gst-launch-1.0 edgesrc name=srcx ! "
"other/tensors,num_tensors=1,dimensions=3:320:240:1,types=uint8,format=static,framerate=30/1 ! "
"tensor_sink");
gstpipe = gst_parse_launch (pipeline, NULL);
EXPECT_NE (edge_handle, nullptr);
/* Set/Get properties of edgesrc */
- g_object_set (edge_handle, "host", "127.0.0.2", NULL);
- g_object_get (edge_handle, "host", &str_val, NULL);
- EXPECT_STREQ ("127.0.0.2", str_val);
- g_free (str_val);
-
- g_object_set (edge_handle, "port", 5001U, NULL);
- g_object_get (edge_handle, "port", &uint_val, NULL);
- EXPECT_EQ (5001U, uint_val);
-
g_object_set (edge_handle, "dest-host", "127.0.0.2", NULL);
g_object_get (edge_handle, "dest-host", &str_val, NULL);
EXPECT_STREQ ("127.0.0.2", str_val);