Commit e9de36e3 authored by Wim Taymans's avatar Wim Taymans

Ported tcp plugins to 0.9.

Original commit message from CVS:
* configure.ac:
* gst/tcp/Makefile.am:
* gst/tcp/README:
* gst/tcp/gstmultifdsink.c: (gst_multifdsink_get_type),
(gst_multifdsink_base_init), (gst_multifdsink_class_init),
(gst_multifdsink_init), (gst_multifdsink_remove_client_link),
(is_sync_frame), (gst_multifdsink_handle_client_write),
(gst_multifdsink_render), (gst_multifdsink_start),
(gst_multifdsink_stop), (gst_multifdsink_change_state):
* gst/tcp/gstmultifdsink.h:
* gst/tcp/gsttcp.c: (gst_tcp_host_to_ip),
(gst_tcp_gdp_read_buffer), (gst_tcp_gdp_read_caps),
(gst_tcp_gdp_write_buffer), (gst_tcp_gdp_write_caps):
* gst/tcp/gsttcp.h:
* gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_class_init),
(gst_tcpclientsink_init), (gst_tcpclientsink_setcaps),
(gst_tcpclientsink_render), (gst_tcpclientsink_start),
(gst_tcpclientsink_stop), (gst_tcpclientsink_change_state):
* gst/tcp/gsttcpclientsink.h:
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_get_type),
(gst_tcpclientsrc_base_init), (gst_tcpclientsrc_class_init),
(gst_tcpclientsrc_init), (gst_tcpclientsrc_getcaps),
(gst_tcpclientsrc_create), (gst_tcpclientsrc_start),
(gst_tcpclientsrc_stop), (gst_tcpclientsrc_unlock):
* gst/tcp/gsttcpclientsrc.h:
* gst/tcp/gsttcpplugin.c: (plugin_init):
* gst/tcp/gsttcpserversink.c: (gst_tcpserversink_class_init):
* gst/tcp/gsttcpserversink.h:
* gst/tcp/gsttcpserversrc.c: (gst_tcpserversrc_get_type),
(gst_tcpserversrc_base_init), (gst_tcpserversrc_class_init),
(gst_tcpserversrc_init), (gst_tcpserversrc_finalize),
(gst_tcpserversrc_create), (gst_tcpserversrc_start),
(gst_tcpserversrc_stop):
* gst/tcp/gsttcpserversrc.h:
* gst/tcp/gsttcpsink.c:
* gst/tcp/gsttcpsink.h:
* gst/tcp/gsttcpsrc.c:
* gst/tcp/gsttcpsrc.h:
Ported tcp plugins to 0.9.
parent 207c8ee7
2005-07-05 Wim Taymans <wim@fluendo.com>
* configure.ac:
* gst/tcp/Makefile.am:
* gst/tcp/README:
* gst/tcp/gstmultifdsink.c: (gst_multifdsink_get_type),
(gst_multifdsink_base_init), (gst_multifdsink_class_init),
(gst_multifdsink_init), (gst_multifdsink_remove_client_link),
(is_sync_frame), (gst_multifdsink_handle_client_write),
(gst_multifdsink_render), (gst_multifdsink_start),
(gst_multifdsink_stop), (gst_multifdsink_change_state):
* gst/tcp/gstmultifdsink.h:
* gst/tcp/gsttcp.c: (gst_tcp_host_to_ip),
(gst_tcp_gdp_read_buffer), (gst_tcp_gdp_read_caps),
(gst_tcp_gdp_write_buffer), (gst_tcp_gdp_write_caps):
* gst/tcp/gsttcp.h:
* gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_class_init),
(gst_tcpclientsink_init), (gst_tcpclientsink_setcaps),
(gst_tcpclientsink_render), (gst_tcpclientsink_start),
(gst_tcpclientsink_stop), (gst_tcpclientsink_change_state):
* gst/tcp/gsttcpclientsink.h:
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_get_type),
(gst_tcpclientsrc_base_init), (gst_tcpclientsrc_class_init),
(gst_tcpclientsrc_init), (gst_tcpclientsrc_getcaps),
(gst_tcpclientsrc_create), (gst_tcpclientsrc_start),
(gst_tcpclientsrc_stop), (gst_tcpclientsrc_unlock):
* gst/tcp/gsttcpclientsrc.h:
* gst/tcp/gsttcpplugin.c: (plugin_init):
* gst/tcp/gsttcpserversink.c: (gst_tcpserversink_class_init):
* gst/tcp/gsttcpserversink.h:
* gst/tcp/gsttcpserversrc.c: (gst_tcpserversrc_get_type),
(gst_tcpserversrc_base_init), (gst_tcpserversrc_class_init),
(gst_tcpserversrc_init), (gst_tcpserversrc_finalize),
(gst_tcpserversrc_create), (gst_tcpserversrc_start),
(gst_tcpserversrc_stop):
* gst/tcp/gsttcpserversrc.h:
* gst/tcp/gsttcpsink.c:
* gst/tcp/gsttcpsink.h:
* gst/tcp/gsttcpsrc.c:
* gst/tcp/gsttcpsrc.h:
Ported tcp plugins to 0.9.
2005-07-05 Andy Wingo <wingo@pobox.com>
* gst/playback/gstplaybasebin.c (fill_buffer):
......
......@@ -237,6 +237,16 @@ fi
AC_SUBST(GST_CONTROL_LIBS)
dnl check for gstreamer-dataprotocol; uninstalled is selected preferentially
PKG_CHECK_MODULES(GST_GDP, gstreamer-dataprotocol-$GST_MAJORMINOR >= $GST_REQ,
HAVE_GST_GDP="yes", HAVE_GST_GDP="no")
if test "x$HAVE_GST_GDP" = "xno"; then
AC_MSG_ERROR(no GStreamer Dataprotocol Libs found)
fi
AC_SUBST(GST_GDP_LIBS)
PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
HAVE_GST_BASE="yes", HAVE_GST_BASE="no")
......@@ -375,6 +385,7 @@ GST_PLUGINS_ALL="\
playback \
sine \
subparse \
tcp \
typefind \
videotestsrc \
videorate \
......@@ -883,6 +894,7 @@ gst/ffmpegcolorspace/Makefile
gst/playback/Makefile
gst/sine/Makefile
gst/subparse/Makefile
gst/tcp/Makefile
gst/typefind/Makefile
gst/videotestsrc/Makefile
gst/videorate/Makefile
......
......@@ -14,7 +14,6 @@ BUILT_SOURCES = $(built_sources) $(built_headers)
libgsttcp_la_SOURCES = \
gsttcpplugin.c \
gsttcpsrc.c gsttcpsink.c \
gsttcp.c \
gstfdset.c \
gstmultifdsink.c \
......@@ -27,11 +26,10 @@ nodist_libgsttcp_la_SOURCES = \
# remove ENABLE_NEW when dataprotocol is stable
libgsttcp_la_CFLAGS = $(GST_CFLAGS) -DGST_ENABLE_NEW
libgsttcp_la_LIBADD =
libgsttcp_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgsttcp_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_BASE_LIBS) $(GST_GDP_LIBS)
noinst_HEADERS = \
gsttcpplugin.h \
gsttcpsrc.h gsttcpsink.h \
gsttcp.h \
gstfdset.h \
gstmultifdsink.h \
......
......@@ -4,8 +4,6 @@ This part of the documentation is for the new tcp elements:
- tcpserversrc
- tcpserversink
which are created to replace the old tcpsrc/tcpsink
TESTS
-----
Use these tests to test functionality of the various tcp plugins
......@@ -31,33 +29,3 @@ TODO
----
- implement DNS resolution
--------
This is the old documentation for the original tcpsrc/tcpsink elements.
* What is TCP src/sink?
solution, like icecast or realaudio or whatever.
But the future RTP plugins shall not do the actual transmission/reception
of packets on the network themselve but the Application developer would be
encouraged to use either the TCP or the UDP plugins for that. UDP would be
used mostly but there could be situations where TCP would be the only
available choice. For example streaming accross firewalls that do not
allow UDP.
* Shortcomings
Even given our modest ambitions, the current code doesn't handle
caps negotiation robustly.
* Todo
The caps nego should do bi-directional negotiation.
Perhaps this plugin can be the example of how to do caps negotiation
via a point-to-point protocol.
12 Sep 2001
Wim Taymans <wim.taymans@chello.be>
Joshua N Pritikin <vishnu@pobox.com>
Zeeshan Ali <zak147@yahoo.com>
This diff is collapsed.
......@@ -22,12 +22,10 @@
#ifndef __GST_MULTIFDSINK_H__
#define __GST_MULTIFDSINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
G_BEGIN_DECLS
#include "gsttcp.h"
#include "gstfdset.h"
......@@ -119,10 +117,7 @@ typedef struct {
} GstTCPClient;
struct _GstMultiFdSink {
GstElement element;
/* pad */
GstPad *sinkpad;
GstBaseSink element;
guint64 bytes_to_serve; /* how much bytes we must serve */
guint64 bytes_served; /* how much bytes have we served */
......@@ -161,7 +156,7 @@ struct _GstMultiFdSink {
};
struct _GstMultiFdSinkClass {
GstElementClass parent_class;
GstBaseSinkClass parent_class;
/* element methods */
void (*add) (GstMultiFdSink *sink, int fd);
......@@ -187,10 +182,6 @@ void gst_multifdsink_remove (GstMultiFdSink *sink, int fd);
void gst_multifdsink_clear (GstMultiFdSink *sink);
GValueArray* gst_multifdsink_get_stats (GstMultiFdSink *sink, int fd);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GST_MULTIFDSINK_H__ */
This diff is collapsed.
......@@ -46,11 +46,13 @@ gint gst_tcp_socket_read (int socket, void *buf, size_t count);
void gst_tcp_socket_close (int *socket);
GstData * gst_tcp_gdp_read_header (GstElement *this, int socket);
GstCaps * gst_tcp_gdp_read_caps (GstElement *this, int socket);
GstBuffer * gst_tcp_gdp_read_buffer (GstElement *elem, int socket);
GstEvent * gst_tcp_gdp_read_event (GstElement *elem, int socket);
GstCaps * gst_tcp_gdp_read_caps (GstElement *elem, int socket);
gboolean gst_tcp_gdp_write_header (GstElement *this, int socket, GstBuffer *buffer, gboolean fatal, const gchar *host, int port);
gboolean gst_tcp_gdp_write_caps (GstElement *this, int socket, const GstCaps *caps, gboolean fatal, const gchar *host, int port);
gboolean gst_tcp_gdp_write_buffer (GstElement *elem, int socket, GstBuffer *buffer, gboolean fatal, const gchar *host, int port);
gboolean gst_tcp_gdp_write_event (GstElement *elem, int socket, GstEvent *event, gboolean fatal, const gchar *host, int port);
gboolean gst_tcp_gdp_write_caps (GstElement *elem, int socket, const GstCaps *caps, gboolean fatal, const gchar *host, int port);
G_END_DECLS
......
......@@ -58,10 +58,9 @@ static void gst_tcpclientsink_class_init (GstTCPClientSink * klass);
static void gst_tcpclientsink_init (GstTCPClientSink * tcpclientsink);
static void gst_tcpclientsink_finalize (GObject * gobject);
static void gst_tcpclientsink_set_clock (GstElement * element,
GstClock * clock);
static void gst_tcpclientsink_chain (GstPad * pad, GstData * _data);
static gboolean gst_tcpclientsink_setcaps (GstBaseSink * bsink, GstCaps * caps);
static GstFlowReturn gst_tcpclientsink_render (GstBaseSink * bsink,
GstBuffer * buf);
static GstElementStateReturn gst_tcpclientsink_change_state (GstElement *
element);
......@@ -115,11 +114,17 @@ gst_tcpclientsink_class_init (GstTCPClientSink * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_BASESINK);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gobject_class->set_property = gst_tcpclientsink_set_property;
gobject_class->get_property = gst_tcpclientsink_get_property;
gobject_class->finalize = gst_tcpclientsink_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HOST,
g_param_spec_string ("host", "Host", "The host/IP to send the packets to",
......@@ -131,44 +136,24 @@ gst_tcpclientsink_class_init (GstTCPClientSink * klass)
g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in",
GST_TYPE_TCP_PROTOCOL_TYPE, GST_TCP_PROTOCOL_TYPE_NONE,
G_PARAM_READWRITE));
gobject_class->set_property = gst_tcpclientsink_set_property;
gobject_class->get_property = gst_tcpclientsink_get_property;
gobject_class->finalize = gst_tcpclientsink_finalize;
gstelement_class->change_state = gst_tcpclientsink_change_state;
gstelement_class->set_clock = gst_tcpclientsink_set_clock;
GST_DEBUG_CATEGORY_INIT (tcpclientsink_debug, "tcpclientsink", 0, "TCP sink");
}
static void
gst_tcpclientsink_set_clock (GstElement * element, GstClock * clock)
{
GstTCPClientSink *tcpclientsink;
tcpclientsink = GST_TCPCLIENTSINK (element);
gstbasesink_class->set_caps = gst_tcpclientsink_setcaps;
gstbasesink_class->render = gst_tcpclientsink_render;
tcpclientsink->clock = clock;
GST_DEBUG_CATEGORY_INIT (tcpclientsink_debug, "tcpclientsink", 0, "TCP sink");
}
static void
gst_tcpclientsink_init (GstTCPClientSink * this)
{
/* create the sink pad */
this->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (this), this->sinkpad);
gst_pad_set_chain_function (this->sinkpad, gst_tcpclientsink_chain);
this->host = g_strdup (TCP_DEFAULT_HOST);
this->port = TCP_DEFAULT_PORT;
/* should support as minimum 576 for IPV4 and 1500 for IPV6 */
/* this->mtu = 1500; */
this->sock_fd = -1;
this->protocol = GST_TCP_PROTOCOL_TYPE_NONE;
GST_FLAG_UNSET (this, GST_TCPCLIENTSINK_OPEN);
this->clock = NULL;
}
static void
......@@ -179,24 +164,12 @@ gst_tcpclientsink_finalize (GObject * gobject)
g_free (this->host);
}
static void
gst_tcpclientsink_chain (GstPad * pad, GstData * _data)
static gboolean
gst_tcpclientsink_setcaps (GstBaseSink * bsink, GstCaps * caps)
{
size_t wrote = 0;
GstBuffer *buf = GST_BUFFER (_data);
GstTCPClientSink *sink;
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (buf != NULL);
sink = GST_TCPCLIENTSINK (GST_OBJECT_PARENT (pad));
g_return_if_fail (GST_FLAG_IS_SET (sink, GST_TCPCLIENTSINK_OPEN));
if (GST_IS_EVENT (buf)) {
g_warning ("FIXME: handl events");
return;
}
sink = GST_TCPCLIENTSINK (bsink);
/* write the buffer header if we have one */
switch (sink->protocol) {
......@@ -209,44 +182,85 @@ gst_tcpclientsink_chain (GstPad * pad, GstData * _data)
const GstCaps *caps;
gchar *string;
caps = GST_PAD_CAPS (GST_PAD_PEER (pad));
caps = GST_PAD_CAPS (GST_PAD_PEER (GST_BASESINK_PAD (bsink)));
string = gst_caps_to_string (caps);
GST_DEBUG_OBJECT (sink, "Sending caps %s through GDP", string);
if (!gst_tcp_gdp_write_caps (GST_ELEMENT (sink), sink->sock_fd, caps,
TRUE, sink->host, sink->port)) {
g_free (string);
return;
}
g_free (string);
if (!gst_tcp_gdp_write_caps (GST_ELEMENT (sink), sink->sock_fd, caps,
TRUE, sink->host, sink->port))
goto gdp_write_error;
sink->caps_sent = TRUE;
}
break;
default:
g_warning ("Unhandled protocol type");
break;
}
return TRUE;
/* ERRORS */
gdp_write_error:
{
return FALSE;
}
}
static GstFlowReturn
gst_tcpclientsink_render (GstBaseSink * bsink, GstBuffer * buf)
{
size_t wrote = 0;
GstTCPClientSink *sink;
gint size;
sink = GST_TCPCLIENTSINK (bsink);
g_return_val_if_fail (GST_FLAG_IS_SET (sink, GST_TCPCLIENTSINK_OPEN),
GST_FLOW_WRONG_STATE);
size = GST_BUFFER_SIZE (buf);
GST_LOG_OBJECT (sink, "writing %d bytes for buffer data", size);
/* write the buffer header if we have one */
switch (sink->protocol) {
case GST_TCP_PROTOCOL_TYPE_NONE:
break;
case GST_TCP_PROTOCOL_TYPE_GDP:
GST_LOG_OBJECT (sink, "Sending buffer header through GDP");
if (!gst_tcp_gdp_write_header (GST_ELEMENT (sink), sink->sock_fd, buf,
if (!gst_tcp_gdp_write_buffer (GST_ELEMENT (sink), sink->sock_fd, buf,
TRUE, sink->host, sink->port))
return;
goto gdp_write_error;
break;
default:
g_warning ("Unhandled protocol type");
break;
}
GST_LOG_OBJECT (sink, "writing %d bytes for buffer data",
GST_BUFFER_SIZE (buf));
wrote =
gst_tcp_socket_write (sink->sock_fd, GST_BUFFER_DATA (buf),
GST_BUFFER_SIZE (buf));
/* write buffer data */
wrote = gst_tcp_socket_write (sink->sock_fd, GST_BUFFER_DATA (buf), size);
if (wrote < size)
goto write_error;
if (wrote < GST_BUFFER_SIZE (buf)) {
sink->data_written += wrote;
return GST_FLOW_OK;
/* ERRORS */
gdp_write_error:
{
return FALSE;
}
write_error:
{
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE,
(_("Error while sending data to \"%s:%d\"."), sink->host, sink->port),
("Only %d of %d bytes written: %s",
wrote, GST_BUFFER_SIZE (buf), g_strerror (errno)));
return GST_FLOW_ERROR;
}
sink->data_written += wrote;
gst_buffer_unref (buf);
/* FIXME: emit signal ? */
}
static void
......@@ -311,11 +325,14 @@ gst_tcpclientsink_get_property (GObject * object, guint prop_id, GValue * value,
/* create a socket for sending to remote machine */
static gboolean
gst_tcpclientsink_init_send (GstTCPClientSink * this)
gst_tcpclientsink_start (GstTCPClientSink * this)
{
int ret;
gchar *ip;
if (GST_FLAG_IS_SET (this, GST_TCPCLIENTSINK_OPEN))
return TRUE;
/* reset caps_sent flag */
this->caps_sent = FALSE;
......@@ -373,34 +390,53 @@ gst_tcpclientsink_init_send (GstTCPClientSink * this)
return TRUE;
}
static void
gst_tcpclientsink_close (GstTCPClientSink * this)
static gboolean
gst_tcpclientsink_stop (GstTCPClientSink * this)
{
if (!GST_FLAG_IS_SET (this, GST_TCPCLIENTSINK_OPEN))
return TRUE;
if (this->sock_fd != -1) {
close (this->sock_fd);
this->sock_fd = -1;
}
GST_FLAG_UNSET (this, GST_TCPCLIENTSINK_OPEN);
return TRUE;
}
static GstElementStateReturn
gst_tcpclientsink_change_state (GstElement * element)
{
g_return_val_if_fail (GST_IS_TCPCLIENTSINK (element), GST_STATE_FAILURE);
if (GST_STATE_PENDING (element) == GST_STATE_NULL) {
if (GST_FLAG_IS_SET (element, GST_TCPCLIENTSINK_OPEN))
gst_tcpclientsink_close (GST_TCPCLIENTSINK (element));
} else {
if (!GST_FLAG_IS_SET (element, GST_TCPCLIENTSINK_OPEN)) {
if (!gst_tcpclientsink_init_send (GST_TCPCLIENTSINK (element)))
return GST_STATE_FAILURE;
}
GstTCPClientSink *sink;
gint transition;
GstElementStateReturn res;
sink = GST_TCPCLIENTSINK (element);
transition = GST_STATE_TRANSITION (element);
switch (transition) {
case GST_STATE_NULL_TO_READY:
case GST_STATE_READY_TO_PAUSED:
if (!gst_tcpclientsink_start (GST_TCPCLIENTSINK (element)))
goto start_failure;
break;
default:
break;
}
res = GST_ELEMENT_CLASS (parent_class)->change_state (element);
if (GST_ELEMENT_CLASS (parent_class)->change_state)
return GST_ELEMENT_CLASS (parent_class)->change_state (element);
switch (transition) {
case GST_STATE_READY_TO_NULL:
gst_tcpclientsink_stop (GST_TCPCLIENTSINK (element));
default:
break;
}
return res;
return GST_STATE_SUCCESS;
start_failure:
{
return GST_STATE_FAILURE;
}
}
......@@ -23,11 +23,11 @@
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
#include "gsttcp.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
G_BEGIN_DECLS
#include <stdio.h>
#include <stdlib.h>
......@@ -65,10 +65,7 @@ typedef enum {
} GstTCPClientSinkFlags;
struct _GstTCPClientSink {
GstElement element;
/* pad */
GstPad *sinkpad;
GstBaseSink element;
/* server information */
int port;
......@@ -81,21 +78,14 @@ struct _GstTCPClientSink {
size_t data_written; /* how much bytes have we written ? */
GstTCPProtocolType protocol; /* used with the protocol enum */
gboolean caps_sent; /* whether or not we sent caps already */
guint mtu;
GstClock *clock;
};
struct _GstTCPClientSinkClass {
GstElementClass parent_class;
GstBaseSinkClass parent_class;
};
GType gst_tcpclientsink_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GST_TCPCLIENTSINK_H__ */
This diff is collapsed.
......@@ -23,16 +23,16 @@
#define __GST_TCPCLIENTSRC_H__
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
G_BEGIN_DECLS
#include <netdb.h> /* sockaddr_in */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h> /* sockaddr_in */
#include <unistd.h>
#include "gsttcp.h"
#define GST_TYPE_TCPCLIENTSRC \
......@@ -56,10 +56,7 @@ typedef enum {
} GstTCPClientSrcFlags;
struct _GstTCPClientSrc {
GstElement element;
/* pad */
GstPad *srcpad;
GstPushSrc element;
/* server information */
int port;
......@@ -75,21 +72,14 @@ struct _GstTCPClientSrc {
GstTCPProtocolType protocol; /* protocol used for reading data */
gboolean caps_received; /* if we have received caps yet */
GstCaps *caps;
GstClock *clock;
gboolean send_discont; /* TRUE when we need to send a discont */
GstBuffer *buffer_after_discont; /* temporary storage for buffer */
};
struct _GstTCPClientSrcClass {
GstElementClass parent_class;
GstPushSrcClass parent_class;
};
GType gst_tcpclientsrc_get_type (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GST_TCPCLIENTSRC_H__ */
......@@ -21,8 +21,7 @@
#include "config.h"
#endif
#include "gsttcpsrc.h"
#include "gsttcpsink.h"
#include <gst/dataprotocol/dataprotocol.h>
#include "gsttcpclientsrc.h"
#include "gsttcpclientsink.h"
#include "gsttcpserversrc.h"
......@@ -34,12 +33,7 @@ GST_DEBUG_CATEGORY (tcp_debug);
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "tcpsink", GST_RANK_NONE,
GST_TYPE_TCPSINK))
return FALSE;
if (!gst_element_register (plugin, "tcpsrc", GST_RANK_NONE, GST_TYPE_TCPSRC))
return FALSE;
gst_dp_init ();
if (!gst_element_register (plugin, "tcpclientsink", GST_RANK_NONE,
GST_TYPE_TCPCLIENTSINK))
......
......@@ -119,6 +119,10 @@ gst_tcpserversink_class_init (GstTCPServerSink * klass)
parent_class = g_type_class_ref (GST_TYPE_MULTIFDSINK);
gobject_class->set_property = gst_tcpserversink_set_property;
gobject_class->get_property = gst_tcpserversink_get_property;
gobject_class->finalize = gst_tcpserversink_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HOST,
g_param_spec_string ("host", "host", "The host/IP to send the packets to",
TCP_DEFAULT_HOST, G_PARAM_READWRITE));
......@@ -126,10 +130,6 @@ gst_tcpserversink_class_init (GstTCPServerSink * klass)
g_param_spec_int ("port", "port", "The port to send the packets to",
0, TCP_HIGHEST_PORT, TCP_DEFAULT_PORT, G_PARAM_READWRITE));
gobject_class->set_property = gst_tcpserversink_set_property;