Skip to content

Commit

Permalink
Fixed port type to integer for transport file creation
Browse files Browse the repository at this point in the history
  • Loading branch information
LufeBisect committed Jan 13, 2025
1 parent 407b575 commit 791ae8e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions cpp/libs/gst_nmos_sender_plugin/gst_nmos_sender_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ static void gst_nmossender_set_property(GObject* object, guint property_id, cons

case PropertyId::DestinationAddress:
self->config.network.destination_address = g_value_dup_string(value);
g_print("\n\n\n\n\n%s", self->config.network.destination_address.c_str());
g_object_set(G_OBJECT(self->udpsink), "host", self->config.network.destination_address.c_str(), NULL);
break;

case PropertyId::DestinationPort:
self->config.network.destination_port = g_value_dup_string(value);
g_object_set(G_OBJECT(self->udpsink), "port", atoi(self->config.network.destination_port.c_str()), NULL);
self->config.network.destination_port = atoi(g_value_get_string(value));
g_object_set(G_OBJECT(self->udpsink), "port", self->config.network.destination_port, NULL);
break;

default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break;
Expand Down Expand Up @@ -148,7 +147,7 @@ static void gst_nmossender_get_property(GObject* object, guint property_id, GVal
case PropertyId::DestinationAddress:
g_value_set_string(value, self->config.network.destination_address.c_str());
break;
case PropertyId::DestinationPort: g_value_set_string(value, self->config.network.destination_port.c_str()); break;
case PropertyId::DestinationPort: g_value_set_int(value, self->config.network.destination_port); break;

default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec); break;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/libs/gst_nmos_sender_plugin/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void create_default_config_fields(config_fields_t* config)
config->network.source_address = "192.168.1.120";
config->network.interface_name = "wlp1s0";
config->network.destination_address = "192.168.1.120";
config->network.destination_port = "9999";
config->network.destination_port = 9999;

// Initialize config_fields_t
config->sender_id = "1c920570-e0b4-4637-b02c-26c9d4275c71";
Expand Down
2 changes: 1 addition & 1 deletion cpp/libs/gst_nmos_sender_plugin/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef struct network_fields_t
std::string source_address;
std::string interface_name;
std::string destination_address;
std::string destination_port;
gint destination_port;
} network_fields_t;

typedef struct config_fields_t
Expand Down

0 comments on commit 791ae8e

Please sign in to comment.