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>
* docs/plugins/Makefile.am:
......
This diff is collapsed.
......@@ -19,8 +19,8 @@
*/
#ifndef __GST_MULTIFDSINK_H__
#define __GST_MULTIFDSINK_H__
#ifndef __GST_MULTI_FD_SINK_H__
#define __GST_MULTI_FD_SINK_H__
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
......@@ -30,27 +30,27 @@ G_BEGIN_DECLS
#include "gsttcp.h"
#include "gstfdset.h"
#define GST_TYPE_MULTIFDSINK \
(gst_multifdsink_get_type())
#define GST_MULTIFDSINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTIFDSINK,GstMultiFdSink))
#define GST_MULTIFDSINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTIFDSINK,GstMultiFdSink))
#define GST_IS_MULTIFDSINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTIFDSINK))
#define GST_IS_MULTIFDSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTIFDSINK))
#define GST_MULTIFDSINK_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MULTIFDSINK, GstMultiFdSinkClass))
#define GST_TYPE_MULTI_FD_SINK \
(gst_multi_fd_sink_get_type())
#define GST_MULTI_FD_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MULTI_FD_SINK,GstMultiFdSink))
#define GST_MULTI_FD_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MULTI_FD_SINK,GstMultiFdSink))
#define GST_IS_MULTI_FD_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MULTI_FD_SINK))
#define GST_IS_MULTI_FD_SINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MULTI_FD_SINK))
#define GST_MULTI_FD_SINK_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MULTI_FD_SINK, GstMultiFdSinkClass))
typedef struct _GstMultiFdSink GstMultiFdSink;
typedef struct _GstMultiFdSinkClass GstMultiFdSinkClass;
typedef enum {
GST_MULTIFDSINK_OPEN = (GST_ELEMENT_FLAG_LAST << 0),
GST_MULTI_FD_SINK_OPEN = (GST_ELEMENT_FLAG_LAST << 0),
GST_MULTIFDSINK_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2),
GST_MULTI_FD_SINK_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2),
} GstMultiFdSinkFlags;
typedef enum
......@@ -180,13 +180,13 @@ struct _GstMultiFdSinkClass {
void (*client_removed) (GstElement *element, gchar *host, gint fd);
};
GType gst_multifdsink_get_type (void);
GType gst_multi_fd_sink_get_type (void);
void gst_multifdsink_add (GstMultiFdSink *sink, int fd);
void gst_multifdsink_remove (GstMultiFdSink *sink, int fd);
void gst_multifdsink_clear (GstMultiFdSink *sink);
GValueArray* gst_multifdsink_get_stats (GstMultiFdSink *sink, int fd);
void gst_multi_fd_sink_add (GstMultiFdSink *sink, int fd);
void gst_multi_fd_sink_remove (GstMultiFdSink *sink, int fd);
void gst_multi_fd_sink_clear (GstMultiFdSink *sink);
GValueArray* gst_multi_fd_sink_get_stats (GstMultiFdSink *sink, int fd);
G_END_DECLS
#endif /* __GST_MULTIFDSINK_H__ */
#endif /* __GST_MULTI_FD_SINK_H__ */
......@@ -27,7 +27,7 @@
#include "gsttcpclientsink.h"
/* elementfactory information */
static GstElementDetails gst_tcpclientsink_details =
static GstElementDetails gst_tcp_client_sink_details =
GST_ELEMENT_DETAILS ("TCP Client sink",
"Sink/Network",
"Send data as a client over the network via TCP",
......@@ -58,29 +58,30 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static void gst_tcpclientsink_base_init (gpointer g_class);
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_tcp_client_sink_base_init (gpointer g_class);
static void gst_tcp_client_sink_class_init (GstTCPClientSink * klass);
static void gst_tcp_client_sink_init (GstTCPClientSink * tcpclientsink);
static void gst_tcp_client_sink_finalize (GObject * gobject);
static gboolean gst_tcpclientsink_setcaps (GstBaseSink * bsink, GstCaps * caps);
static GstFlowReturn gst_tcpclientsink_render (GstBaseSink * bsink,
static gboolean gst_tcp_client_sink_setcaps (GstBaseSink * bsink,
GstCaps * caps);
static GstFlowReturn gst_tcp_client_sink_render (GstBaseSink * bsink,
GstBuffer * buf);
static GstStateChangeReturn gst_tcpclientsink_change_state (GstElement *
static GstStateChangeReturn gst_tcp_client_sink_change_state (GstElement *
element, GstStateChange transition);
static void gst_tcpclientsink_set_property (GObject * object, guint prop_id,
static void gst_tcp_client_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_tcpclientsink_get_property (GObject * object, guint prop_id,
static void gst_tcp_client_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstElementClass *parent_class = NULL;
/*static guint gst_tcpclientsink_signals[LAST_SIGNAL] = { 0 }; */
/*static guint gst_tcp_client_sink_signals[LAST_SIGNAL] = { 0 }; */
GType
gst_tcpclientsink_get_type (void)
gst_tcp_client_sink_get_type (void)
{
static GType tcpclientsink_type = 0;
......@@ -88,14 +89,14 @@ gst_tcpclientsink_get_type (void)
if (!tcpclientsink_type) {
static const GTypeInfo tcpclientsink_info = {
sizeof (GstTCPClientSinkClass),
gst_tcpclientsink_base_init,
gst_tcp_client_sink_base_init,
NULL,
(GClassInitFunc) gst_tcpclientsink_class_init,
(GClassInitFunc) gst_tcp_client_sink_class_init,
NULL,
NULL,
sizeof (GstTCPClientSink),
0,
(GInstanceInitFunc) gst_tcpclientsink_init,
(GInstanceInitFunc) gst_tcp_client_sink_init,
NULL
};
......@@ -107,18 +108,18 @@ gst_tcpclientsink_get_type (void)
}
static void
gst_tcpclientsink_base_init (gpointer g_class)
gst_tcp_client_sink_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_set_details (element_class, &gst_tcpclientsink_details);
gst_element_class_set_details (element_class, &gst_tcp_client_sink_details);
}
static void
gst_tcpclientsink_class_init (GstTCPClientSink * klass)
gst_tcp_client_sink_class_init (GstTCPClientSink * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
......@@ -130,9 +131,9 @@ gst_tcpclientsink_class_init (GstTCPClientSink * klass)
parent_class = g_type_class_ref (GST_TYPE_BASE_SINK);
gobject_class->set_property = gst_tcpclientsink_set_property;
gobject_class->get_property = gst_tcpclientsink_get_property;
gobject_class->finalize = gst_tcpclientsink_finalize;
gobject_class->set_property = gst_tcp_client_sink_set_property;
gobject_class->get_property = gst_tcp_client_sink_get_property;
gobject_class->finalize = gst_tcp_client_sink_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",
......@@ -144,39 +145,39 @@ gst_tcpclientsink_class_init (GstTCPClientSink * klass)
g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in",
GST_TYPE_TCP_PROTOCOL, GST_TCP_PROTOCOL_NONE, G_PARAM_READWRITE));
gstelement_class->change_state = gst_tcpclientsink_change_state;
gstelement_class->change_state = gst_tcp_client_sink_change_state;
gstbasesink_class->set_caps = gst_tcpclientsink_setcaps;
gstbasesink_class->render = gst_tcpclientsink_render;
gstbasesink_class->set_caps = gst_tcp_client_sink_setcaps;
gstbasesink_class->render = gst_tcp_client_sink_render;
GST_DEBUG_CATEGORY_INIT (tcpclientsink_debug, "tcpclientsink", 0, "TCP sink");
}
static void
gst_tcpclientsink_init (GstTCPClientSink * this)
gst_tcp_client_sink_init (GstTCPClientSink * this)
{
this->host = g_strdup (TCP_DEFAULT_HOST);
this->port = TCP_DEFAULT_PORT;
this->sock_fd = -1;
this->protocol = GST_TCP_PROTOCOL_NONE;
GST_OBJECT_FLAG_UNSET (this, GST_TCPCLIENTSINK_OPEN);
GST_OBJECT_FLAG_UNSET (this, GST_TCP_CLIENT_SINK_OPEN);
}
static void
gst_tcpclientsink_finalize (GObject * gobject)
gst_tcp_client_sink_finalize (GObject * gobject)
{
GstTCPClientSink *this = GST_TCPCLIENTSINK (gobject);
GstTCPClientSink *this = GST_TCP_CLIENT_SINK (gobject);
g_free (this->host);
}
static gboolean
gst_tcpclientsink_setcaps (GstBaseSink * bsink, GstCaps * caps)
gst_tcp_client_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
{
GstTCPClientSink *sink;
sink = GST_TCPCLIENTSINK (bsink);
sink = GST_TCP_CLIENT_SINK (bsink);
/* write the buffer header if we have one */
switch (sink->protocol) {
......@@ -216,15 +217,15 @@ gdp_write_error:
}
static GstFlowReturn
gst_tcpclientsink_render (GstBaseSink * bsink, GstBuffer * buf)
gst_tcp_client_sink_render (GstBaseSink * bsink, GstBuffer * buf)
{
size_t wrote = 0;
GstTCPClientSink *sink;
gint size;
sink = GST_TCPCLIENTSINK (bsink);
sink = GST_TCP_CLIENT_SINK (bsink);
g_return_val_if_fail (GST_OBJECT_FLAG_IS_SET (sink, GST_TCPCLIENTSINK_OPEN),
g_return_val_if_fail (GST_OBJECT_FLAG_IS_SET (sink, GST_TCP_CLIENT_SINK_OPEN),
GST_FLOW_WRONG_STATE);
size = GST_BUFFER_SIZE (buf);
......@@ -271,13 +272,13 @@ write_error:
}
static void
gst_tcpclientsink_set_property (GObject * object, guint prop_id,
gst_tcp_client_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstTCPClientSink *tcpclientsink;
g_return_if_fail (GST_IS_TCPCLIENTSINK (object));
tcpclientsink = GST_TCPCLIENTSINK (object);
g_return_if_fail (GST_IS_TCP_CLIENT_SINK (object));
tcpclientsink = GST_TCP_CLIENT_SINK (object);
switch (prop_id) {
case ARG_HOST:
......@@ -302,13 +303,13 @@ gst_tcpclientsink_set_property (GObject * object, guint prop_id,
}
static void
gst_tcpclientsink_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
gst_tcp_client_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstTCPClientSink *tcpclientsink;
g_return_if_fail (GST_IS_TCPCLIENTSINK (object));
tcpclientsink = GST_TCPCLIENTSINK (object);
g_return_if_fail (GST_IS_TCP_CLIENT_SINK (object));
tcpclientsink = GST_TCP_CLIENT_SINK (object);
switch (prop_id) {
case ARG_HOST:
......@@ -330,12 +331,12 @@ gst_tcpclientsink_get_property (GObject * object, guint prop_id, GValue * value,
/* create a socket for sending to remote machine */
static gboolean
gst_tcpclientsink_start (GstTCPClientSink * this)
gst_tcp_client_sink_start (GstTCPClientSink * this)
{
int ret;
gchar *ip;
if (GST_OBJECT_FLAG_IS_SET (this, GST_TCPCLIENTSINK_OPEN))
if (GST_OBJECT_FLAG_IS_SET (this, GST_TCP_CLIENT_SINK_OPEN))
return TRUE;
/* reset caps_sent flag */
......@@ -388,7 +389,7 @@ gst_tcpclientsink_start (GstTCPClientSink * this)
}
}
GST_OBJECT_FLAG_SET (this, GST_TCPCLIENTSINK_OPEN);
GST_OBJECT_FLAG_SET (this, GST_TCP_CLIENT_SINK_OPEN);
this->data_written = 0;
......@@ -396,9 +397,9 @@ gst_tcpclientsink_start (GstTCPClientSink * this)
}
static gboolean
gst_tcpclientsink_stop (GstTCPClientSink * this)
gst_tcp_client_sink_stop (GstTCPClientSink * this)
{
if (!GST_OBJECT_FLAG_IS_SET (this, GST_TCPCLIENTSINK_OPEN))
if (!GST_OBJECT_FLAG_IS_SET (this, GST_TCP_CLIENT_SINK_OPEN))
return TRUE;
if (this->sock_fd != -1) {
......@@ -406,23 +407,24 @@ gst_tcpclientsink_stop (GstTCPClientSink * this)
this->sock_fd = -1;
}
GST_OBJECT_FLAG_UNSET (this, GST_TCPCLIENTSINK_OPEN);
GST_OBJECT_FLAG_UNSET (this, GST_TCP_CLIENT_SINK_OPEN);
return TRUE;
}
static GstStateChangeReturn
gst_tcpclientsink_change_state (GstElement * element, GstStateChange transition)
gst_tcp_client_sink_change_state (GstElement * element,
GstStateChange transition)
{
GstTCPClientSink *sink;
GstStateChangeReturn res;
sink = GST_TCPCLIENTSINK (element);
sink = GST_TCP_CLIENT_SINK (element);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
case GST_STATE_CHANGE_READY_TO_PAUSED:
if (!gst_tcpclientsink_start (GST_TCPCLIENTSINK (element)))
if (!gst_tcp_client_sink_start (GST_TCP_CLIENT_SINK (element)))
goto start_failure;
break;
default:
......@@ -432,7 +434,7 @@ gst_tcpclientsink_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
gst_tcpclientsink_stop (GST_TCPCLIENTSINK (element));
gst_tcp_client_sink_stop (GST_TCP_CLIENT_SINK (element));
default:
break;
}
......
......@@ -18,8 +18,8 @@
*/
#ifndef __GST_TCPCLIENTSINK_H__
#define __GST_TCPCLIENTSINK_H__
#ifndef __GST_TCP_CLIENT_SINK_H__
#define __GST_TCP_CLIENT_SINK_H__
#include <gst/gst.h>
......@@ -44,24 +44,24 @@ G_BEGIN_DECLS
#include <arpa/inet.h>
#include "gsttcp.h"
#define GST_TYPE_TCPCLIENTSINK \
(gst_tcpclientsink_get_type())
#define GST_TCPCLIENTSINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TCPCLIENTSINK,GstTCPClientSink))
#define GST_TCPCLIENTSINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TCPCLIENTSINK,GstTCPClientSink))
#define GST_IS_TCPCLIENTSINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TCPCLIENTSINK))
#define GST_IS_TCPCLIENTSINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TCPCLIENTSINK))
#define GST_TYPE_TCP_CLIENT_SINK \
(gst_tcp_client_sink_get_type())
#define GST_TCP_CLIENT_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TCP_CLIENT_SINK,GstTCPClientSink))
#define GST_TCP_CLIENT_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TCP_CLIENT_SINK,GstTCPClientSink))
#define GST_IS_TCP_CLIENT_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TCP_CLIENT_SINK))
#define GST_IS_TCP_CLIENT_SINK_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TCP_CLIENT_SINK))
typedef struct _GstTCPClientSink GstTCPClientSink;
typedef struct _GstTCPClientSinkClass GstTCPClientSinkClass;
typedef enum {
GST_TCPCLIENTSINK_OPEN = (GST_ELEMENT_FLAG_LAST << 0),
GST_TCP_CLIENT_SINK_OPEN = (GST_ELEMENT_FLAG_LAST << 0),
GST_TCPCLIENTSINK_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2),
GST_TCP_CLIENT_SINK_FLAG_LAST = (GST_ELEMENT_FLAG_LAST << 2),
} GstTCPClientSinkFlags;
struct _GstTCPClientSink {
......@@ -84,8 +84,8 @@ struct _GstTCPClientSinkClass {
GstBaseSinkClass parent_class;
};
GType gst_tcpclientsink_get_type(void);
GType gst_tcp_client_sink_get_type(void);
G_END_DECLS
#endif /* __GST_TCPCLIENTSINK_H__ */
#endif /* __GST_TCP_CLIENT_SINK_H__ */
......@@ -56,7 +56,7 @@ GST_DEBUG_CATEGORY (tcpclientsrc_debug);
#define MAX_READ_SIZE 4 * 1024
static GstElementDetails gst_tcpclientsrc_details =
static GstElementDetails gst_tcp_client_src_details =
GST_ELEMENT_DETAILS ("TCP Client source",
"Source/Network",
"Receive data as a client over the network via TCP",
......@@ -77,39 +77,39 @@ enum
};
GST_BOILERPLATE (GstTCPClientSrc, gst_tcpclientsrc, GstPushSrc,
GST_BOILERPLATE (GstTCPClientSrc, gst_tcp_client_src, GstPushSrc,
GST_TYPE_PUSH_SRC);
static void gst_tcpclientsrc_finalize (GObject * gobject);
static void gst_tcp_client_src_finalize (GObject * gobject);
static GstCaps *gst_tcpclientsrc_getcaps (GstBaseSrc * psrc);
static GstCaps *gst_tcp_client_src_getcaps (GstBaseSrc * psrc);
static GstFlowReturn gst_tcpclientsrc_create (GstPushSrc * psrc,
static GstFlowReturn gst_tcp_client_src_create (GstPushSrc * psrc,
GstBuffer ** outbuf);
static gboolean gst_tcpclientsrc_stop (GstBaseSrc * bsrc);
static gboolean gst_tcpclientsrc_start (GstBaseSrc * bsrc);
static gboolean gst_tcpclientsrc_unlock (GstBaseSrc * bsrc);
static gboolean gst_tcp_client_src_stop (GstBaseSrc * bsrc);
static gboolean gst_tcp_client_src_start (GstBaseSrc * bsrc);
static gboolean gst_tcp_client_src_unlock (GstBaseSrc * bsrc);
static void gst_tcpclientsrc_set_property (GObject * object, guint prop_id,
static void gst_tcp_client_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_tcpclientsrc_get_property (GObject * object, guint prop_id,
static void gst_tcp_client_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static void
gst_tcpclientsrc_base_init (gpointer g_class)
gst_tcp_client_src_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_set_details (element_class, &gst_tcpclientsrc_details);
gst_element_class_set_details (element_class, &gst_tcp_client_src_details);
}
static void
gst_tcpclientsrc_class_init (GstTCPClientSrcClass * klass)
gst_tcp_client_src_class_init (GstTCPClientSrcClass * klass)
{
GObjectClass *gobject_class;
GstBaseSrcClass *gstbasesrc_class;
......@@ -119,9 +119,9 @@ gst_tcpclientsrc_class_init (GstTCPClientSrcClass * klass)
gstbasesrc_class = (GstBaseSrcClass *) klass;
gstpush_src_class = (GstPushSrcClass *) klass;
gobject_class->set_property = gst_tcpclientsrc_set_property;
gobject_class->get_property = gst_tcpclientsrc_get_property;
gobject_class->finalize = gst_tcpclientsrc_finalize;
gobject_class->set_property = gst_tcp_client_src_set_property;
gobject_class->get_property = gst_tcp_client_src_get_property;
gobject_class->finalize = gst_tcp_client_src_finalize;
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_HOST,
g_param_spec_string ("host", "Host",
......@@ -134,19 +134,19 @@ gst_tcpclientsrc_class_init (GstTCPClientSrcClass * klass)
g_param_spec_enum ("protocol", "Protocol", "The protocol to wrap data in",
GST_TYPE_TCP_PROTOCOL, GST_TCP_PROTOCOL_NONE, G_PARAM_READWRITE));
gstbasesrc_class->get_caps = gst_tcpclientsrc_getcaps;
gstbasesrc_class->start = gst_tcpclientsrc_start;
gstbasesrc_class->stop = gst_tcpclientsrc_stop;
gstbasesrc_class->unlock = gst_tcpclientsrc_unlock;
gstbasesrc_class->get_caps = gst_tcp_client_src_getcaps;
gstbasesrc_class->start = gst_tcp_client_src_start;
gstbasesrc_class->stop = gst_tcp_client_src_stop;
gstbasesrc_class->unlock = gst_tcp_client_src_unlock;
gstpush_src_class->create = gst_tcpclientsrc_create;
gstpush_src_class->create = gst_tcp_client_src_create;
GST_DEBUG_CATEGORY_INIT (tcpclientsrc_debug, "tcpclientsrc", 0,
"TCP Client Source");
}
static void
gst_tcpclientsrc_init (GstTCPClientSrc * this, GstTCPClientSrcClass * g_class)
gst_tcp_client_src_init (GstTCPClientSrc * this, GstTCPClientSrcClass * g_class)
{
this->port = TCP_DEFAULT_PORT;
this->host = g_strdup (TCP_DEFAULT_HOST);
......@@ -159,26 +159,26 @@ gst_tcpclientsrc_init (GstTCPClientSrc * this, GstTCPClientSrcClass * g_class)
gst_base_src_set_live (GST_BASE_SRC (this), TRUE);
GST_OBJECT_FLAG_UNSET (this, GST_TCPCLIENTSRC_OPEN);
GST_OBJECT_FLAG_UNSET (this, GST_TCP_CLIENT_SRC_OPEN);
}
static void
gst_tcpclientsrc_finalize (GObject * gobject)
gst_tcp_client_src_finalize (GObject * gobject)
{
GstTCPClientSrc *this = GST_TCPCLIENTSRC (gobject);
GstTCPClientSrc *this = GST_TCP_CLIENT_SRC (gobject);
g_free (this->host);
}
static GstCaps *
gst_tcpclientsrc_getcaps (GstBaseSrc * bsrc)
gst_tcp_client_src_getcaps (GstBaseSrc * bsrc)
{
GstTCPClientSrc *src;
GstCaps *caps = NULL;
src = GST_TCPCLIENTSRC (bsrc);
src = GST_TCP_CLIENT_SRC (bsrc);
if (!GST_OBJECT_FLAG_IS_SET (src, GST_TCPCLIENTSRC_OPEN))
if (!GST_OBJECT_FLAG_IS_SET (src, GST_TCP_CLIENT_SRC_OPEN))
caps = gst_caps_new_any ();
else if (src->caps)
caps = gst_caps_copy (src->caps);
......@@ -190,14 +190,14 @@ gst_tcpclientsrc_getcaps (GstBaseSrc * bsrc)
}
static GstFlowReturn
gst_tcpclientsrc_create (GstPushSrc * psrc, GstBuffer ** outbuf)
gst_tcp_client_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
{
GstTCPClientSrc *src;
GstFlowReturn ret = GST_FLOW_OK;
src = GST_TCPCLIENTSRC (psrc);
src = GST_TCP_CLIENT_SRC (psrc);
if (!GST_OBJECT_FLAG_IS_SET (src, GST_TCPCLIENTSRC_OPEN))
if (!GST_OBJECT_FLAG_IS_SET (src, GST_TCP_CLIENT_SRC_OPEN))
goto wrong_state;
GST_LOG_OBJECT (src, "asked for a buffer");
......@@ -263,10 +263,10 @@ no_caps:
}
static void
gst_tcpclientsrc_set_property (GObject * object, guint prop_id,
gst_tcp_client_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstTCPClientSrc *tcpclientsrc = GST_TCPCLIENTSRC (object);
GstTCPClientSrc *tcpclientsrc = GST_TCP_CLIENT_SRC (object);
switch (prop_id) {
case PROP_HOST:
......@@ -291,10 +291,10 @@ gst_tcpclientsrc_set_property (GObject * object, guint prop_id,
}
static void
gst_tcpclientsrc_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
gst_tcp_client_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstTCPClientSrc *tcpclientsrc = GST_TCPCLIENTSRC (object);
GstTCPClientSrc *tcpclientsrc = GST_TCP_CLIENT_SRC (object);
switch (prop_id) {
case PROP_HOST:
......@@ -315,11 +315,11 @@ gst_tcpclientsrc_get_property (GObject * object, guint prop_id, GValue * value,
/* create a socket for connecting to remote server */
static gboolean
gst_tcpclientsrc_start (GstBaseSrc * bsrc)
gst_tcp_client_src_start (GstBaseSrc * bsrc)
{
int ret;
gchar *ip;
GstTCPClientSrc *src = GST_TCPCLIENTSRC (bsrc);
GstTCPClientSrc *src = GST_TCP_CLIENT_SRC (bsrc);
/* create the control sockets before anything */
if (socketpair (PF_UNIX, SOCK_STREAM, 0, CONTROL_SOCKETS (src)) < 0)
......@@ -337,7 +337,7 @@ gst_tcpclientsrc_start (GstBaseSrc * bsrc)
GST_DEBUG_OBJECT (src, "opened receiving client socket with fd %d",
src->sock_fd);
GST_OBJECT_FLAG_SET (src, GST_TCPCLIENTSRC_OPEN);
GST_OBJECT_FLAG_SET (src, GST_TCP_CLIENT_SRC_OPEN);
/* look up name if we need to */
if (!(ip = gst_tcp_host_to_ip (GST_ELEMENT (src), src->host)))
......@@ -357,7 +357,7 @@ gst_tcpclientsrc_start (GstBaseSrc * bsrc)
sizeof (src->server_sin));
if (ret) {
gst_tcpclientsrc_stop (GST_BASE_SRC (src));
gst_tcp_client_src_stop (GST_BASE_SRC (src));
switch (errno) {
case ECONNREFUSED:
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
......@@ -388,7 +388,7 @@ no_socket:
}
name_resolv:
{
gst_tcpclientsrc_stop (GST_BASE_SRC (src));
gst_tcp_client_src_stop (GST_BASE_SRC (src));
return FALSE;
}
}
......@@ -397,11 +397,11 @@ name_resolv:
* unset OPEN flag
* used both to recover from errors and go to NULL state */
static gboolean
gst_tcpclientsrc_stop (GstBaseSrc * bsrc)
gst_tcp_client_src_stop (GstBaseSrc * bsrc)
{
GstTCPClientSrc *src;
src = GST_TCPCLIENTSRC (bsrc);
src =