From ecbc5c1a2e68960ca124f5a213c3abe82049974d Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 5 Nov 2004 17:38:20 +0000 Subject: [PATCH] ports can go up to 65535. Move common defines to gsttcp.h Original commit message from CVS: ports can go up to 65535. Move common defines to gsttcp.h --- ChangeLog | 9 +++++++++ gst/tcp/gsttcp.h | 4 ++++ gst/tcp/gsttcpclientsink.c | 5 +---- gst/tcp/gsttcpclientsrc.c | 4 +--- gst/tcp/gsttcpserversink.c | 5 ++--- gst/tcp/gsttcpserversrc.c | 9 ++++----- 6 files changed, 21 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a9d6892c7..6bf413fa4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-11-05 Thomas Vander Stichele + + * gst/tcp/gsttcp.h: + * gst/tcp/gsttcpclientsink.c: + * gst/tcp/gsttcpclientsrc.c: + * gst/tcp/gsttcpserversink.c: + * gst/tcp/gsttcpserversrc.c: + ports can go up to 65535. Move common defines to gsttcp.h + 2004-11-05 Wim Taymans * gst/videotestsrc/videotestsrc.c: (paint_setup_Y41B), diff --git a/gst/tcp/gsttcp.h b/gst/tcp/gsttcp.h index 67cee58a4d..84b7d32e6e 100644 --- a/gst/tcp/gsttcp.h +++ b/gst/tcp/gsttcp.h @@ -27,6 +27,10 @@ #include #include +#define TCP_HIGHEST_PORT 65535 +#define TCP_DEFAULT_HOST "localhost" +#define TCP_DEFAULT_PORT 4953 + G_BEGIN_DECLS typedef enum diff --git a/gst/tcp/gsttcpclientsink.c b/gst/tcp/gsttcpclientsink.c index 7d7d552d66..ac0b76c3b7 100644 --- a/gst/tcp/gsttcpclientsink.c +++ b/gst/tcp/gsttcpclientsink.c @@ -26,9 +26,6 @@ #include "gsttcp.h" #include "gsttcpclientsink.h" -#define TCP_DEFAULT_HOST "localhost" -#define TCP_DEFAULT_PORT 4953 - /* elementfactory information */ static GstElementDetails gst_tcpclientsink_details = GST_ELEMENT_DETAILS ("TCP Client sink", @@ -128,7 +125,7 @@ gst_tcpclientsink_class_init (GstTCPClientSink * klass) TCP_DEFAULT_HOST, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "Port", "The port to send the packets to", - 0, 32768, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); + 0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_PROTOCOL, g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in", GST_TYPE_TCP_PROTOCOL_TYPE, GST_TCP_PROTOCOL_TYPE_NONE, diff --git a/gst/tcp/gsttcpclientsrc.c b/gst/tcp/gsttcpclientsrc.c index 85f30edcd2..446c437622 100644 --- a/gst/tcp/gsttcpclientsrc.c +++ b/gst/tcp/gsttcpclientsrc.c @@ -41,8 +41,6 @@ GST_DEBUG_CATEGORY (tcpclientsrc_debug); #define GST_CAT_DEFAULT tcpclientsrc_debug -#define TCP_DEFAULT_PORT 4953 -#define TCP_DEFAULT_HOST "localhost" #define MAX_READ_SIZE 4 * 1024 /* elementfactory information */ @@ -138,7 +136,7 @@ gst_tcpclientsrc_class_init (GstTCPClientSrc * klass) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "Port", "The port to receive packets from", 0, - 32768, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); + TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_PROTOCOL, g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in", GST_TYPE_TCP_PROTOCOL_TYPE, GST_TCP_PROTOCOL_TYPE_NONE, diff --git a/gst/tcp/gsttcpserversink.c b/gst/tcp/gsttcpserversink.c index 5e4e972289..e6a038c063 100644 --- a/gst/tcp/gsttcpserversink.c +++ b/gst/tcp/gsttcpserversink.c @@ -29,11 +29,10 @@ #include #endif +#include "gsttcp.h" #include "gsttcpserversink.h" #include "gsttcp-marshal.h" -#define TCP_DEFAULT_HOST "127.0.0.1" -#define TCP_DEFAULT_PORT 4953 #define TCP_BACKLOG 5 /* elementfactory information */ @@ -124,7 +123,7 @@ gst_tcpserversink_class_init (GstTCPServerSink * klass) TCP_DEFAULT_HOST, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "port", "The port to send the packets to", - 0, 32768, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); + 0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); gobject_class->set_property = gst_tcpserversink_set_property; gobject_class->get_property = gst_tcpserversink_get_property; diff --git a/gst/tcp/gsttcpserversrc.c b/gst/tcp/gsttcpserversrc.c index 115a330d4c..5735558203 100644 --- a/gst/tcp/gsttcpserversrc.c +++ b/gst/tcp/gsttcpserversrc.c @@ -36,8 +36,7 @@ GST_DEBUG_CATEGORY (tcpserversrc_debug); #define GST_CAT_DEFAULT tcpserversrc_debug -#define TCP_DEFAULT_PORT 4953 -#define TCP_DEFAULT_HOST NULL /* listen on all interfaces */ +#define TCP_DEFAULT_LISTEN_HOST NULL /* listen on all interfaces */ #define TCP_BACKLOG 1 /* client connection queue */ /* elementfactory information */ @@ -126,11 +125,11 @@ gst_tcpserversrc_class_init (GstTCPServerSrc * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HOST, - g_param_spec_string ("host", "Host", "The hostname to listen", - TCP_DEFAULT_HOST, G_PARAM_READWRITE)); + g_param_spec_string ("host", "Host", "The hostname to listen as", + TCP_DEFAULT_LISTEN_HOST, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "Port", "The port to listen to", - 0, 32768, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); + 0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, ARG_PROTOCOL, g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in", GST_TYPE_TCP_PROTOCOL_TYPE, GST_TCP_PROTOCOL_TYPE_NONE,