[farsight2/master] Add a pointer to the parent rawudptransmiter to the rawudpstreamtransmitter
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:19:23 PST 2008
---
transmitters/rawudp/fs-rawudp-stream-transmitter.c | 15 ++++++++++++---
transmitters/rawudp/fs-rawudp-stream-transmitter.h | 5 +++--
transmitters/rawudp/fs-rawudp-transmitter.c | 3 ++-
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.c b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
index 45eee86..289ec28 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
@@ -58,6 +58,12 @@ struct _FsRawUdpStreamTransmitterPrivate
{
gboolean disposed;
+ /* We don't actually hold a ref to this,
+ * But since our parent FsStream can not exist without its parent
+ * FsSession, we should be safe
+ */
+ FsRawUdpTransmitter *transmitter;
+
gboolean sending;
gchar *stun_ip;
@@ -149,7 +155,7 @@ fs_rawudp_stream_transmitter_class_init (FsRawUdpStreamTransmitterClass *klass)
g_param_spec_uint ("stun-port",
"The port of the STUN server",
"The IPv4 UDP port of the STUN server as a ",
- 0, 65535, 3478,
+ 1, 65535, 3478,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
gobject_class->dispose = fs_rawudp_stream_transmitter_dispose;
@@ -280,8 +286,9 @@ fs_rawudp_stream_transmitter_add_remote_candidate (
FsRawUdpStreamTransmitter *
-fs_rawudp_stream_transmitter_newv (guint n_parameters, GParameter *parameters,
- GError **error)
+ fs_rawudp_stream_transmitter_newv (FsRawUdpTransmitter *transmitter,
+ guint n_parameters, GParameter *parameters,
+ GError **error)
{
FsRawUdpStreamTransmitter *streamtransmitter = NULL;
@@ -290,5 +297,7 @@ fs_rawudp_stream_transmitter_newv (guint n_parameters, GParameter *parameters,
streamtransmitter = g_object_newv (FS_TYPE_RAWUDP_STREAM_TRANSMITTER,
n_parameters, parameters);
+ streamtransmitter->priv->transmitter = transmitter;
+
return streamtransmitter;
}
diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.h b/transmitters/rawudp/fs-rawudp-stream-transmitter.h
index 6aef5b7..040bfa5 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.h
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.h
@@ -29,6 +29,7 @@
#include <glib-object.h>
#include <gst/farsight/fs-stream-transmitter.h>
+#include "fs-rawudp-transmitter.h"
G_BEGIN_DECLS
@@ -87,8 +88,8 @@ struct _FsRawUdpStreamTransmitter
GType fs_rawudp_stream_transmitter_get_type (void);
FsRawUdpStreamTransmitter *
-fs_rawudp_stream_transmitter_newv (guint n_parameters, GParameter *parameters,
- GError **error);
+fs_rawudp_stream_transmitter_newv (FsRawUdpTransmitter *transmitter,
+ guint n_parameters, GParameter *parameters, GError **error);
G_END_DECLS
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.c b/transmitters/rawudp/fs-rawudp-transmitter.c
index 1c5fb74..72c61aa 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-transmitter.c
@@ -367,9 +367,10 @@ fs_rawudp_transmitter_new_stream_transmitter (FsTransmitter *transmitter,
FsParticipant *participant, guint n_parameters, GParameter *parameters,
GError **error)
{
+ FsRawUdpTransmitter *self = FS_RAWUDP_TRANSMITTER (transmitter);
return FS_STREAM_TRANSMITTER (fs_rawudp_stream_transmitter_newv (
- n_parameters, parameters, error));
+ self, n_parameters, parameters, error));
}
--
1.5.6.5
More information about the farsight-commits
mailing list