145 gobject_class->get_property = gst_net_time_provider_get_property; |
145 gobject_class->get_property = gst_net_time_provider_get_property; |
146 |
146 |
147 g_object_class_install_property (gobject_class, PROP_PORT, |
147 g_object_class_install_property (gobject_class, PROP_PORT, |
148 g_param_spec_int ("port", "port", |
148 g_param_spec_int ("port", "port", |
149 "The port to receive the packets from, 0=allocate", 0, G_MAXUINT16, |
149 "The port to receive the packets from, 0=allocate", 0, G_MAXUINT16, |
150 DEFAULT_PORT, G_PARAM_READWRITE)); |
150 DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
151 g_object_class_install_property (gobject_class, PROP_ADDRESS, |
151 g_object_class_install_property (gobject_class, PROP_ADDRESS, |
152 g_param_spec_string ("address", "address", |
152 g_param_spec_string ("address", "address", |
153 "The address to bind on, as a dotted quad (x.x.x.x)", |
153 "The address to bind on, as a dotted quad (x.x.x.x)", |
154 DEFAULT_ADDRESS, G_PARAM_READWRITE)); |
154 DEFAULT_ADDRESS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
155 g_object_class_install_property (gobject_class, PROP_CLOCK, |
155 g_object_class_install_property (gobject_class, PROP_CLOCK, |
156 g_param_spec_object ("clock", "Clock", |
156 g_param_spec_object ("clock", "Clock", |
157 "The clock to export over the network", GST_TYPE_CLOCK, |
157 "The clock to export over the network", GST_TYPE_CLOCK, |
158 G_PARAM_READWRITE)); |
158 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
159 g_object_class_install_property (gobject_class, PROP_ACTIVE, |
159 g_object_class_install_property (gobject_class, PROP_ACTIVE, |
160 g_param_spec_boolean ("active", "Active", |
160 g_param_spec_boolean ("active", "Active", |
161 "TRUE if the clock will respond to queries over the network", TRUE, |
161 "TRUE if the clock will respond to queries over the network", TRUE, |
162 G_PARAM_READWRITE)); |
162 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
163 } |
163 } |
164 |
164 |
165 static void |
165 static void |
166 gst_net_time_provider_init (GstNetTimeProvider * self, |
166 gst_net_time_provider_init (GstNetTimeProvider * self, |
167 GstNetTimeProviderClass * g_class) |
167 GstNetTimeProviderClass * g_class) |
382 sizeof (my_addr)); |
382 sizeof (my_addr)); |
383 if (ret < 0) |
383 if (ret < 0) |
384 goto bind_error; |
384 goto bind_error; |
385 |
385 |
386 len = sizeof (my_addr); |
386 len = sizeof (my_addr); |
|
387 #ifdef G_OS_WIN32 |
|
388 ret = |
|
389 getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr, |
|
390 (gint *) & len); |
|
391 #else |
387 ret = getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr, &len); |
392 ret = getsockname (self->priv->sock.fd, (struct sockaddr *) &my_addr, &len); |
|
393 #endif |
388 if (ret < 0) |
394 if (ret < 0) |
389 goto getsockname_error; |
395 goto getsockname_error; |
390 |
396 |
391 port = ntohs (my_addr.sin_port); |
397 port = ntohs (my_addr.sin_port); |
392 GST_DEBUG_OBJECT (self, "bound, on port %d", port); |
398 GST_DEBUG_OBJECT (self, "bound, on port %d", port); |