more borgifying

Original commit message from CVS:
more borgifying
parent f39b4773
2005-12-01 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/tcp/gstmultifdsink.c: (gst_multi_fd_sink_base_init),
(gst_multi_fd_sink_class_init), (gst_multi_fd_sink_init),
(gst_multi_fd_sink_finalize), (gst_multi_fd_sink_add),
(gst_multi_fd_sink_remove), (gst_multi_fd_sink_clear),
(gst_multi_fd_sink_get_stats),
(gst_multi_fd_sink_remove_client_link),
(gst_multi_fd_sink_handle_client_read),
(gst_multi_fd_sink_client_queue_data),
(gst_multi_fd_sink_client_queue_caps),
(gst_multi_fd_sink_client_queue_buffer),
(gst_multi_fd_sink_new_client),
(gst_multi_fd_sink_handle_client_write),
(gst_multi_fd_sink_recover_client),
(gst_multi_fd_sink_queue_buffer),
(gst_multi_fd_sink_handle_clients), (gst_multi_fd_sink_thread),
(gst_multi_fd_sink_render), (gst_multi_fd_sink_set_property),
(gst_multi_fd_sink_get_property), (gst_multi_fd_sink_start),
(gst_multi_fd_sink_stop), (gst_multi_fd_sink_change_state):
* gst/tcp/gstmultifdsink.h:
* gst/tcp/gsttcpclientsink.c: (gst_tcp_client_sink_get_type),
(gst_tcp_client_sink_base_init), (gst_tcp_client_sink_class_init),
(gst_tcp_client_sink_init), (gst_tcp_client_sink_finalize),
(gst_tcp_client_sink_setcaps), (gst_tcp_client_sink_render),
(gst_tcp_client_sink_set_property),
(gst_tcp_client_sink_get_property), (gst_tcp_client_sink_start),
(gst_tcp_client_sink_stop), (gst_tcp_client_sink_change_state):
* gst/tcp/gsttcpclientsink.h:
* gst/tcp/gsttcpclientsrc.c: (gst_tcp_client_src_base_init),
(gst_tcp_client_src_class_init), (gst_tcp_client_src_init),
(gst_tcp_client_src_finalize), (gst_tcp_client_src_getcaps),
(gst_tcp_client_src_create), (gst_tcp_client_src_set_property),
(gst_tcp_client_src_get_property), (gst_tcp_client_src_start),
(gst_tcp_client_src_stop), (gst_tcp_client_src_unlock):
* gst/tcp/gsttcpclientsrc.h:
* gst/tcp/gsttcpplugin.c: (plugin_init):
* gst/tcp/gsttcpserversink.c: (gst_tcp_server_sink_base_init),
(gst_tcp_server_sink_class_init), (gst_tcp_server_sink_init),
(gst_tcp_server_sink_finalize),
(gst_tcp_server_sink_handle_server_read),
(gst_tcp_server_sink_removed), (gst_tcp_server_sink_handle_wait),
(gst_tcp_server_sink_set_property),
(gst_tcp_server_sink_get_property),
(gst_tcp_server_sink_init_send), (gst_tcp_server_sink_close):
* gst/tcp/gsttcpserversink.h:
* gst/tcp/gsttcpserversrc.c: (gst_tcp_server_src_base_init),
(gst_tcp_server_src_class_init), (gst_tcp_server_src_init),
(gst_tcp_server_src_finalize), (gst_tcp_server_src_create),
(gst_tcp_server_src_set_property),
(gst_tcp_server_src_get_property), (gst_tcp_server_src_start),
(gst_tcp_server_src_stop), (gst_tcp_server_src_unlock):
* gst/tcp/gsttcpserversrc.h:
more borgifying
2005-12-01 Thomas Vander Stichele <thomas at apestaart dot org> 2005-12-01 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/plugins/Makefile.am: * docs/plugins/Makefile.am:
......
...@@ -64,7 +64,7 @@ G_STMT_START { \ ...@@ -64,7 +64,7 @@ G_STMT_START { \
} G_STMT_END } G_STMT_END
/* elementfactory information */ /* elementfactory information */
static GstElementDetails gst_multifdsink_details = static GstElementDetails gst_multi_fd_sink_details =
GST_ELEMENT_DETAILS ("MultiFd sink", GST_ELEMENT_DETAILS ("MultiFd sink",
"Sink/Network", "Sink/Network",
"Send data to multiple filedescriptors", "Send data to multiple filedescriptors",
...@@ -218,42 +218,42 @@ gst_client_status_get_type (void) ...@@ -218,42 +218,42 @@ gst_client_status_get_type (void)
return client_status_type; return client_status_type;
} }
static void gst_multifdsink_finalize (GObject * object); static void gst_multi_fd_sink_finalize (GObject * object);
static void gst_multifdsink_remove_client_link (GstMultiFdSink * sink, static void gst_multi_fd_sink_remove_client_link (GstMultiFdSink * sink,
GList * link); GList * link);
static GstFlowReturn gst_multifdsink_render (GstBaseSink * bsink, static GstFlowReturn gst_multi_fd_sink_render (GstBaseSink * bsink,
GstBuffer * buf); GstBuffer * buf);
static GstStateChangeReturn gst_multifdsink_change_state (GstElement * static GstStateChangeReturn gst_multi_fd_sink_change_state (GstElement *
element, GstStateChange transition); element, GstStateChange transition);
static void gst_multifdsink_set_property (GObject * object, guint prop_id, static void gst_multi_fd_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_multifdsink_get_property (GObject * object, guint prop_id, static void gst_multi_fd_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstMultiFdSink, gst_multifdsink, GstBaseSink, GST_BOILERPLATE (GstMultiFdSink, gst_multi_fd_sink, GstBaseSink,
GST_TYPE_BASE_SINK); GST_TYPE_BASE_SINK);
static guint gst_multifdsink_signals[LAST_SIGNAL] = { 0 }; static guint gst_multi_fd_sink_signals[LAST_SIGNAL] = { 0 };
static void static void
gst_multifdsink_base_init (gpointer g_class) gst_multi_fd_sink_base_init (gpointer g_class)
{ {
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sinktemplate)); gst_static_pad_template_get (&sinktemplate));
gst_element_class_set_details (element_class, &gst_multifdsink_details); gst_element_class_set_details (element_class, &gst_multi_fd_sink_details);
} }
static void static void
gst_multifdsink_class_init (GstMultiFdSinkClass * klass) gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class;
GstElementClass *gstelement_class; GstElementClass *gstelement_class;
...@@ -263,9 +263,9 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass) ...@@ -263,9 +263,9 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass)
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstbasesink_class = (GstBaseSinkClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass;
gobject_class->set_property = gst_multifdsink_set_property; gobject_class->set_property = gst_multi_fd_sink_set_property;
gobject_class->get_property = gst_multifdsink_get_property; gobject_class->get_property = gst_multi_fd_sink_get_property;
gobject_class->finalize = gst_multifdsink_finalize; gobject_class->finalize = gst_multi_fd_sink_finalize;
g_object_class_install_property (gobject_class, ARG_PROTOCOL, g_object_class_install_property (gobject_class, ARG_PROTOCOL,
g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in", g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in",
...@@ -342,7 +342,7 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass) ...@@ -342,7 +342,7 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass)
* *
* Hand the given open file descriptor to multifdsink to write to. * Hand the given open file descriptor to multifdsink to write to.
*/ */
gst_multifdsink_signals[SIGNAL_ADD] = gst_multi_fd_sink_signals[SIGNAL_ADD] =
g_signal_new ("add", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("add", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiFdSinkClass, add), G_STRUCT_OFFSET (GstMultiFdSinkClass, add),
NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
...@@ -353,7 +353,7 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass) ...@@ -353,7 +353,7 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass)
* *
* Remove the given open file descriptor from multifdsink. * Remove the given open file descriptor from multifdsink.
*/ */
gst_multifdsink_signals[SIGNAL_REMOVE] = gst_multi_fd_sink_signals[SIGNAL_REMOVE] =
g_signal_new ("remove", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("remove", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiFdSinkClass, remove), G_STRUCT_OFFSET (GstMultiFdSinkClass, remove),
NULL, NULL, gst_tcp_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); NULL, NULL, gst_tcp_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
...@@ -363,11 +363,11 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass) ...@@ -363,11 +363,11 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass)
* *
* Clear all file descriptors from multifdsink. * Clear all file descriptors from multifdsink.
*/ */
gst_multifdsink_signals[SIGNAL_CLEAR] = gst_multi_fd_sink_signals[SIGNAL_CLEAR] =
g_signal_new ("clear", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("clear", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiFdSinkClass, clear), G_STRUCT_OFFSET (GstMultiFdSinkClass, clear),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
gst_multifdsink_signals[SIGNAL_GET_STATS] = gst_multi_fd_sink_signals[SIGNAL_GET_STATS] =
g_signal_new ("get-stats", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, g_signal_new ("get-stats", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GstMultiFdSinkClass, get_stats), G_STRUCT_OFFSET (GstMultiFdSinkClass, get_stats),
NULL, NULL, gst_tcp_marshal_BOXED__INT, G_TYPE_VALUE_ARRAY, 1, NULL, NULL, gst_tcp_marshal_BOXED__INT, G_TYPE_VALUE_ARRAY, 1,
...@@ -380,7 +380,7 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass) ...@@ -380,7 +380,7 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass)
* *
* The given file descriptor was added to multifdsink. * The given file descriptor was added to multifdsink.
*/ */
gst_multifdsink_signals[SIGNAL_CLIENT_ADDED] = gst_multi_fd_sink_signals[SIGNAL_CLIENT_ADDED] =
g_signal_new ("client-added", G_TYPE_FROM_CLASS (klass), g_signal_new ("client-added", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMultiFdSinkClass, client_added), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMultiFdSinkClass, client_added),
NULL, NULL, gst_tcp_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); NULL, NULL, gst_tcp_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
...@@ -391,29 +391,29 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass) ...@@ -391,29 +391,29 @@ gst_multifdsink_class_init (GstMultiFdSinkClass * klass)
* *
* The given file descriptor was removed from multifdsink. * The given file descriptor was removed from multifdsink.
*/ */
gst_multifdsink_signals[SIGNAL_CLIENT_REMOVED] = gst_multi_fd_sink_signals[SIGNAL_CLIENT_REMOVED] =
g_signal_new ("client-removed", G_TYPE_FROM_CLASS (klass), g_signal_new ("client-removed", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMultiFdSinkClass, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstMultiFdSinkClass,
client_removed), NULL, NULL, gst_tcp_marshal_VOID__INT_BOXED, client_removed), NULL, NULL, gst_tcp_marshal_VOID__INT_BOXED,
G_TYPE_NONE, 2, G_TYPE_INT, GST_TYPE_CLIENT_STATUS); G_TYPE_NONE, 2, G_TYPE_INT, GST_TYPE_CLIENT_STATUS);
gstelement_class->change_state = gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_multifdsink_change_state); GST_DEBUG_FUNCPTR (gst_multi_fd_sink_change_state);
gstbasesink_class->render = gst_multifdsink_render; gstbasesink_class->render = gst_multi_fd_sink_render;
klass->add = gst_multifdsink_add; klass->add = gst_multi_fd_sink_add;
klass->remove = gst_multifdsink_remove; klass->remove = gst_multi_fd_sink_remove;
klass->clear = gst_multifdsink_clear; klass->clear = gst_multi_fd_sink_clear;
klass->get_stats = gst_multifdsink_get_stats; klass->get_stats = gst_multi_fd_sink_get_stats;
GST_DEBUG_CATEGORY_INIT (multifdsink_debug, "multifdsink", 0, "FD sink"); GST_DEBUG_CATEGORY_INIT (multifdsink_debug, "multifdsink", 0, "FD sink");
} }
static void static void
gst_multifdsink_init (GstMultiFdSink * this, GstMultiFdSinkClass * klass) gst_multi_fd_sink_init (GstMultiFdSink * this, GstMultiFdSinkClass * klass)
{ {
GST_OBJECT_FLAG_UNSET (this, GST_MULTIFDSINK_OPEN); GST_OBJECT_FLAG_UNSET (this, GST_MULTI_FD_SINK_OPEN);
this->protocol = DEFAULT_PROTOCOL; this->protocol = DEFAULT_PROTOCOL;
this->mode = DEFAULT_MODE; this->mode = DEFAULT_MODE;
...@@ -433,11 +433,11 @@ gst_multifdsink_init (GstMultiFdSink * this, GstMultiFdSinkClass * klass) ...@@ -433,11 +433,11 @@ gst_multifdsink_init (GstMultiFdSink * this, GstMultiFdSinkClass * klass)
} }
static void static void
gst_multifdsink_finalize (GObject * object) gst_multi_fd_sink_finalize (GObject * object)
{ {
GstMultiFdSink *this; GstMultiFdSink *this;
this = GST_MULTIFDSINK (object); this = GST_MULTI_FD_SINK (object);
CLIENTS_LOCK_FREE (this); CLIENTS_LOCK_FREE (this);
g_hash_table_destroy (this->fd_hash); g_hash_table_destroy (this->fd_hash);
...@@ -447,7 +447,7 @@ gst_multifdsink_finalize (GObject * object) ...@@ -447,7 +447,7 @@ gst_multifdsink_finalize (GObject * object)
} }
void void
gst_multifdsink_add (GstMultiFdSink * sink, int fd) gst_multi_fd_sink_add (GstMultiFdSink * sink, int fd)
{ {
GstTCPClient *client; GstTCPClient *client;
GList *clink; GList *clink;
...@@ -485,7 +485,8 @@ gst_multifdsink_add (GstMultiFdSink * sink, int fd) ...@@ -485,7 +485,8 @@ gst_multifdsink_add (GstMultiFdSink * sink, int fd)
CLIENTS_UNLOCK (sink); CLIENTS_UNLOCK (sink);
GST_WARNING_OBJECT (sink, "[fd %5d] duplicate client found, refusing", fd); GST_WARNING_OBJECT (sink, "[fd %5d] duplicate client found, refusing", fd);
g_signal_emit (G_OBJECT (sink), g_signal_emit (G_OBJECT (sink),
gst_multifdsink_signals[SIGNAL_CLIENT_REMOVED], 0, fd, client->status); gst_multi_fd_sink_signals[SIGNAL_CLIENT_REMOVED], 0, fd,
client->status);
g_free (client); g_free (client);
return; return;
} }
...@@ -515,11 +516,11 @@ gst_multifdsink_add (GstMultiFdSink * sink, int fd) ...@@ -515,11 +516,11 @@ gst_multifdsink_add (GstMultiFdSink * sink, int fd)
CLIENTS_UNLOCK (sink); CLIENTS_UNLOCK (sink);
g_signal_emit (G_OBJECT (sink), g_signal_emit (G_OBJECT (sink),
gst_multifdsink_signals[SIGNAL_CLIENT_ADDED], 0, fd); gst_multi_fd_sink_signals[SIGNAL_CLIENT_ADDED], 0, fd);
} }
void void
gst_multifdsink_remove (GstMultiFdSink * sink, int fd) gst_multi_fd_sink_remove (GstMultiFdSink * sink, int fd)
{ {
GList *clink; GList *clink;
...@@ -531,7 +532,7 @@ gst_multifdsink_remove (GstMultiFdSink * sink, int fd) ...@@ -531,7 +532,7 @@ gst_multifdsink_remove (GstMultiFdSink * sink, int fd)
GstTCPClient *client = (GstTCPClient *) clink->data; GstTCPClient *client = (GstTCPClient *) clink->data;
client->status = GST_CLIENT_STATUS_REMOVED; client->status = GST_CLIENT_STATUS_REMOVED;
gst_multifdsink_remove_client_link (sink, clink); gst_multi_fd_sink_remove_client_link (sink, clink);
SEND_COMMAND (sink, CONTROL_RESTART); SEND_COMMAND (sink, CONTROL_RESTART);
} else { } else {
GST_WARNING_OBJECT (sink, "[fd %5d] no client with this fd found!", fd); GST_WARNING_OBJECT (sink, "[fd %5d] no client with this fd found!", fd);
...@@ -540,7 +541,7 @@ gst_multifdsink_remove (GstMultiFdSink * sink, int fd) ...@@ -540,7 +541,7 @@ gst_multifdsink_remove (GstMultiFdSink * sink, int fd)
} }
void void
gst_multifdsink_clear (GstMultiFdSink * sink) gst_multi_fd_sink_clear (GstMultiFdSink * sink)
{ {
GList *clients, *next; GList *clients, *next;
...@@ -554,14 +555,14 @@ gst_multifdsink_clear (GstMultiFdSink * sink) ...@@ -554,14 +555,14 @@ gst_multifdsink_clear (GstMultiFdSink * sink)
next = g_list_next (clients); next = g_list_next (clients);
client->status = GST_CLIENT_STATUS_REMOVED; client->status = GST_CLIENT_STATUS_REMOVED;
gst_multifdsink_remove_client_link (sink, clients); gst_multi_fd_sink_remove_client_link (sink, clients);
} }
SEND_COMMAND (sink, CONTROL_RESTART); SEND_COMMAND (sink, CONTROL_RESTART);
CLIENTS_UNLOCK (sink); CLIENTS_UNLOCK (sink);
} }
GValueArray * GValueArray *
gst_multifdsink_get_stats (GstMultiFdSink * sink, int fd) gst_multi_fd_sink_get_stats (GstMultiFdSink * sink, int fd)
{ {
GstTCPClient *client; GstTCPClient *client;
GValueArray *result = NULL; GValueArray *result = NULL;
...@@ -622,14 +623,14 @@ gst_multifdsink_get_stats (GstMultiFdSink * sink, int fd) ...@@ -622,14 +623,14 @@ gst_multifdsink_get_stats (GstMultiFdSink * sink, int fd)
* close the fd itself. * close the fd itself.
*/ */
static void static void
gst_multifdsink_remove_client_link (GstMultiFdSink * sink, GList * link) gst_multi_fd_sink_remove_client_link (GstMultiFdSink * sink, GList * link)
{ {
int fd; int fd;
GTimeVal now; GTimeVal now;
GstTCPClient *client = (GstTCPClient *) link->data; GstTCPClient *client = (GstTCPClient *) link->data;
GstMultiFdSinkClass *fclass; GstMultiFdSinkClass *fclass;
fclass = GST_MULTIFDSINK_GET_CLASS (sink); fclass = GST_MULTI_FD_SINK_GET_CLASS (sink);
fd = client->fd.fd; fd = client->fd.fd;
...@@ -676,7 +677,7 @@ gst_multifdsink_remove_client_link (GstMultiFdSink * sink, GList * link) ...@@ -676,7 +677,7 @@ gst_multifdsink_remove_client_link (GstMultiFdSink * sink, GList * link)
CLIENTS_UNLOCK (sink); CLIENTS_UNLOCK (sink);
g_signal_emit (G_OBJECT (sink), g_signal_emit (G_OBJECT (sink),
gst_multifdsink_signals[SIGNAL_CLIENT_REMOVED], 0, fd, client->status); gst_multi_fd_sink_signals[SIGNAL_CLIENT_REMOVED], 0, fd, client->status);
/* lock again before we remove the client completely */ /* lock again before we remove the client completely */
CLIENTS_LOCK (sink); CLIENTS_LOCK (sink);
...@@ -702,7 +703,7 @@ gst_multifdsink_remove_client_link (GstMultiFdSink * sink, GList * link) ...@@ -702,7 +703,7 @@ gst_multifdsink_remove_client_link (GstMultiFdSink * sink, GList * link)
* which either indicates a close or should be ignored * which either indicates a close or should be ignored
* returns FALSE if some error occured or the client closed. */ * returns FALSE if some error occured or the client closed. */
static gboolean static gboolean
gst_multifdsink_handle_client_read (GstMultiFdSink * sink, gst_multi_fd_sink_handle_client_read (GstMultiFdSink * sink,
GstTCPClient * client) GstTCPClient * client)
{ {
int avail, fd; int avail, fd;
...@@ -770,8 +771,8 @@ gst_multifdsink_handle_client_read (GstMultiFdSink * sink, ...@@ -770,8 +771,8 @@ gst_multifdsink_handle_client_read (GstMultiFdSink * sink,
* setting it as GST_BUFFER_MALLOCDATA() on the created buffer * setting it as GST_BUFFER_MALLOCDATA() on the created buffer
*/ */
static gboolean static gboolean
gst_multifdsink_client_queue_data (GstMultiFdSink * sink, GstTCPClient * client, gst_multi_fd_sink_client_queue_data (GstMultiFdSink * sink,
gchar * data, gint len) GstTCPClient * client, gchar * data, gint len)
{ {
GstBuffer *buf; GstBuffer *buf;
...@@ -789,8 +790,8 @@ gst_multifdsink_client_queue_data (GstMultiFdSink * sink, GstTCPClient * client, ...@@ -789,8 +790,8 @@ gst_multifdsink_client_queue_data (GstMultiFdSink * sink, GstTCPClient * client,
} }
static gboolean static gboolean
gst_multifdsink_client_queue_caps (GstMultiFdSink * sink, GstTCPClient * client, gst_multi_fd_sink_client_queue_caps (GstMultiFdSink * sink,
const GstCaps * caps) GstTCPClient * client, const GstCaps * caps)
{ {
guint8 *header; guint8 *header;
guint8 *payload; guint8 *payload;
...@@ -808,10 +809,10 @@ gst_multifdsink_client_queue_caps (GstMultiFdSink * sink, GstTCPClient * client, ...@@ -808,10 +809,10 @@ gst_multifdsink_client_queue_caps (GstMultiFdSink * sink, GstTCPClient * client,
GST_DEBUG_OBJECT (sink, "Could not create GDP packet from caps"); GST_DEBUG_OBJECT (sink, "Could not create GDP packet from caps");
return FALSE; return FALSE;
} }
gst_multifdsink_client_queue_data (sink, client, (gchar *) header, length); gst_multi_fd_sink_client_queue_data (sink, client, (gchar *) header, length);
length = gst_dp_header_payload_length (header); length = gst_dp_header_payload_length (header);
gst_multifdsink_client_queue_data (sink, client, (gchar *) payload, length); gst_multi_fd_sink_client_queue_data (sink, client, (gchar *) payload, length);
return TRUE; return TRUE;
} }
...@@ -828,7 +829,7 @@ is_sync_frame (GstMultiFdSink * sink, GstBuffer * buffer) ...@@ -828,7 +829,7 @@ is_sync_frame (GstMultiFdSink * sink, GstBuffer * buffer)
} }
static gboolean static gboolean
gst_multifdsink_client_queue_buffer (GstMultiFdSink * sink, gst_multi_fd_sink_client_queue_buffer (GstMultiFdSink * sink,
GstTCPClient * client, GstBuffer * buffer) GstTCPClient * client, GstBuffer * buffer)
{ {
if (sink->protocol == GST_TCP_PROTOCOL_GDP) { if (sink->protocol == GST_TCP_PROTOCOL_GDP) {
...@@ -840,7 +841,7 @@ gst_multifdsink_client_queue_buffer (GstMultiFdSink * sink, ...@@ -840,7 +841,7 @@ gst_multifdsink_client_queue_buffer (GstMultiFdSink * sink,
"[fd %5d] could not create header, removing client", client->fd.fd); "[fd %5d] could not create header, removing client", client->fd.fd);
return FALSE; return FALSE;
} }
gst_multifdsink_client_queue_data (sink, client, (gchar *) header, len); gst_multi_fd_sink_client_queue_data (sink, client, (gchar *) header, len);
} }
GST_LOG_OBJECT (sink, "[fd %5d] queueing buffer of length %d", GST_LOG_OBJECT (sink, "[fd %5d] queueing buffer of length %d",
...@@ -853,7 +854,7 @@ gst_multifdsink_client_queue_buffer (GstMultiFdSink * sink, ...@@ -853,7 +854,7 @@ gst_multifdsink_client_queue_buffer (GstMultiFdSink * sink,
} }
static gint static gint
gst_multifdsink_new_client (GstMultiFdSink * sink, GstTCPClient * client) gst_multi_fd_sink_new_client (GstMultiFdSink * sink, GstTCPClient * client)
{ {
gint result; gint result;
...@@ -961,7 +962,7 @@ done: ...@@ -961,7 +962,7 @@ done:
* This functions returns FALSE if some error occured. * This functions returns FALSE if some error occured.
*/ */
static gboolean static gboolean
gst_multifdsink_handle_client_write (GstMultiFdSink * sink, gst_multi_fd_sink_handle_client_write (GstMultiFdSink * sink,
GstTCPClient * client) GstTCPClient * client)
{ {
int fd = client->fd.fd; int fd = client->fd.fd;
...@@ -989,7 +990,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink, ...@@ -989,7 +990,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink,
gst_object_unref (peer); gst_object_unref (peer);
/* queue caps for sending */ /* queue caps for sending */
res = gst_multifdsink_client_queue_caps (sink, client, caps); res = gst_multi_fd_sink_client_queue_caps (sink, client, caps);
gst_caps_unref (caps); gst_caps_unref (caps);
...@@ -1011,7 +1012,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink, ...@@ -1011,7 +1012,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink,
for (l = sink->streamheader; l; l = l->next) { for (l = sink->streamheader; l; l = l->next) {
/* queue stream headers for sending */ /* queue stream headers for sending */
res = res =
gst_multifdsink_client_queue_buffer (sink, client, gst_multi_fd_sink_client_queue_buffer (sink, client,
GST_BUFFER (l->data)); GST_BUFFER (l->data));
if (!res) { if (!res) {
GST_DEBUG_OBJECT (sink, GST_DEBUG_OBJECT (sink,
...@@ -1041,7 +1042,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink, ...@@ -1041,7 +1042,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink,
/* for new connections, we need to find a good spot in the /* for new connections, we need to find a good spot in the
* bufqueue to start streaming from */ * bufqueue to start streaming from */
if (client->new_connection) { if (client->new_connection) {
gint position = gst_multifdsink_new_client (sink, client); gint position = gst_multi_fd_sink_new_client (sink, client);
if (position >= 0) { if (position >= 0) {
/* we got a valid spot in the queue */ /* we got a valid spot in the queue */
...@@ -1061,7 +1062,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink, ...@@ -1061,7 +1062,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink,
fd, client, client->bufpos); fd, client, client->bufpos);
/* queueing a buffer will ref it */ /* queueing a buffer will ref it */
gst_multifdsink_client_queue_buffer (sink, client, buf); gst_multi_fd_sink_client_queue_buffer (sink, client, buf);
/* need to start from the first byte for this new buffer */ /* need to start from the first byte for this new buffer */
client->bufoffset = 0; client->bufoffset = 0;
...@@ -1138,7 +1139,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink, ...@@ -1138,7 +1139,7 @@ gst_multifdsink_handle_client_write (GstMultiFdSink * sink,
* position. * position.
*/ */
static gint static gint
gst_multifdsink_recover_client (GstMultiFdSink * sink, GstTCPClient * client) gst_multi_fd_sink_recover_client (GstMultiFdSink * sink, GstTCPClient * client)
{ {
gint newbufpos; gint newbufpos;
...@@ -1204,7 +1205,7 @@ gst_multifdsink_recover_client (GstMultiFdSink * sink, GstTCPClient * client) ...@@ -1204,7 +1205,7 @@ gst_multifdsink_recover_client (GstMultiFdSink * sink, GstTCPClient * client)
* *
*/ */
static void static void
gst_multifdsink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf) gst_multi_fd_sink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf)
{ {
GList *clients, *next; GList *clients, *next;
gint queuelen; gint queuelen;
...@@ -1237,7 +1238,7 @@ gst_multifdsink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf) ...@@ -1237,7 +1238,7 @@ gst_multifdsink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf)
if (sink->units_soft_max > 0 && client->bufpos >= sink->units_soft_max) { if (sink->units_soft_max > 0 && client->bufpos >= sink->units_soft_max) {
gint newpos; gint newpos;
newpos = gst_multifdsink_recover_client (sink, client); newpos = gst_multi_fd_sink_recover_client (sink, client);
if (newpos != client->bufpos) { if (newpos != client->bufpos) {
client->bufpos = newpos; client->bufpos = newpos;
client->discont = TRUE; client->discont = TRUE;
...@@ -1259,7 +1260,7 @@ gst_multifdsink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf) ...@@ -1259,7 +1260,7 @@ gst_multifdsink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf)
/* remove the client, the fd set will be cleared and the select thread will /* remove the client, the fd set will be cleared and the select thread will
* be signaled */ * be signaled */
client->status = GST_CLIENT_STATUS_SLOW; client->status = GST_CLIENT_STATUS_SLOW;
gst_multifdsink_remove_client_link (sink, clients); gst_multi_fd_sink_remove_client_link (sink, clients);
/* set client to invalid position while being removed */ /* set client to invalid position while being removed */
client->bufpos = -1; client->bufpos = -1;
need_signal = TRUE; need_signal = TRUE;
...@@ -1334,14 +1335,14 @@ gst_multifdsink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf) ...@@ -1334,14 +1335,14 @@ gst_multifdsink_queue_buffer (GstMultiFdSink * sink, GstBuffer * buf)
* garbage list and removed. * garbage list and removed.
*/ */
static void static void
gst_multifdsink_handle_clients (GstMultiFdSink * sink) gst_multi_fd_sink_handle_clients (GstMultiFdSink * sink)
{ {
int result; int result;
GList *clients, *next; GList *clients, *next;
gboolean try_again; gboolean try_again;
GstMultiFdSinkClass *fclass; GstMultiFdSinkClass *fclass;
fclass = GST_MULTIFDSINK_GET_CLASS (sink); fclass = GST_MULTI_FD_SINK_GET_CLASS (sink);
do { do {
gboolean stop = FALSE; gboolean stop = FALSE;
...@@ -1380,7 +1381,7 @@ gst_multifdsink_handle_clients (GstMultiFdSink * sink) ...@@ -1380,7 +1381,7 @@ gst_multifdsink_handle_clients (GstMultiFdSink * sink)
fd, g_strerror (errno), errno); fd, g_strerror (errno), errno);
if (errno == EBADF) {