summaryrefslogtreecommitdiff
path: root/rtmp
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2014-09-01 13:38:54 -0700
committerDavid Schleef <ds@schleef.org>2014-09-01 13:38:54 -0700
commit2002d4ddef7c0c4fe9a3701b93c0b567fb205ebc (patch)
tree6aa5f6d4e5a82f56083280361fa9624f12bc5cec /rtmp
parent6fd24b0c5e6bab6a98af932cbca351b612264e04 (diff)
hacking
Diffstat (limited to 'rtmp')
-rw-r--r--rtmp/rtmpclient.c5
-rw-r--r--rtmp/rtmpconnection.c17
-rw-r--r--rtmp/rtmpconnection.h4
-rw-r--r--rtmp/rtmpserver.c3
4 files changed, 21 insertions, 8 deletions
diff --git a/rtmp/rtmpclient.c b/rtmp/rtmpclient.c
index ecec842..ed7c0d1 100644
--- a/rtmp/rtmpclient.c
+++ b/rtmp/rtmpclient.c
@@ -99,6 +99,8 @@ gst_rtmp_client_init (GstRtmpClient * rtmpclient)
{
rtmpclient->server_address = g_strdup (DEFAULT_SERVER_ADDRESS);
rtmpclient->server_port = DEFAULT_SERVER_PORT;
+
+ rtmpclient->connection = gst_rtmp_connection_new ();
}
void
@@ -256,7 +258,8 @@ gst_rtmp_client_connect_done (GObject * source, GAsyncResult * result,
return;
}
- client->connection = gst_rtmp_connection_new (client->socket_connection);
+ gst_rtmp_connection_set_socket_connection (client->connection,
+ client->socket_connection);
gst_rtmp_connection_start_handshake (client->connection, FALSE);
g_simple_async_result_complete (client->async);
diff --git a/rtmp/rtmpconnection.c b/rtmp/rtmpconnection.c
index c4277c5..1529ed4 100644
--- a/rtmp/rtmpconnection.c
+++ b/rtmp/rtmpconnection.c
@@ -198,13 +198,22 @@ gst_rtmp_connection_finalize (GObject * object)
}
GstRtmpConnection *
-gst_rtmp_connection_new (GSocketConnection * connection)
+gst_rtmp_connection_new (void)
{
GstRtmpConnection *sc;
- GInputStream *is;
sc = g_object_new (GST_TYPE_RTMP_CONNECTION, NULL);
- sc->connection = connection;
+
+ return sc;
+}
+
+void
+gst_rtmp_connection_set_socket_connection (GstRtmpConnection * sc,
+ GSocketConnection * connection)
+{
+ GInputStream *is;
+
+ sc->connection = g_object_ref (connection);
is = g_io_stream_get_input_stream (G_IO_STREAM (sc->connection));
sc->input_source =
@@ -213,8 +222,6 @@ gst_rtmp_connection_new (GSocketConnection * connection)
g_source_set_callback (sc->input_source,
(GSourceFunc) gst_rtmp_connection_input_ready, sc, NULL);
g_source_attach (sc->input_source, NULL);
-
- return sc;
}
static void
diff --git a/rtmp/rtmpconnection.h b/rtmp/rtmpconnection.h
index db26288..6f2a6a2 100644
--- a/rtmp/rtmpconnection.h
+++ b/rtmp/rtmpconnection.h
@@ -93,7 +93,9 @@ struct _GstRtmpConnectionClass
GType gst_rtmp_connection_get_type (void);
-GstRtmpConnection *gst_rtmp_connection_new (GSocketConnection *connection);
+GstRtmpConnection *gst_rtmp_connection_new (void);
+void gst_rtmp_connection_set_socket_connection (
+ GstRtmpConnection *rtmpconnection, GSocketConnection *connection);
void gst_rtmp_connection_start_handshake (GstRtmpConnection *connection,
gboolean is_server);
diff --git a/rtmp/rtmpserver.c b/rtmp/rtmpserver.c
index 7bb2854..41cd93e 100644
--- a/rtmp/rtmpserver.c
+++ b/rtmp/rtmpserver.c
@@ -182,7 +182,8 @@ gst_rtmp_server_incoming (GSocketService * service,
GST_INFO ("client connected");
g_object_ref (socket_connection);
- connection = gst_rtmp_connection_new (socket_connection);
+ connection = gst_rtmp_connection_new ();
+ gst_rtmp_connection_set_socket_connection (connection, socket_connection);
gst_rtmp_server_add_connection (rtmpserver, connection);
gst_rtmp_connection_start_handshake (connection, TRUE);