[farsight2/master] Add recvonly pipeline and functions to add dests to it
Olivier Crête
olivier.crete at collabora.co.uk
Thu Feb 5 06:32:05 PST 2009
---
docs/plugins/farsight2-plugins-sections.txt | 2 +
transmitters/rawudp/fs-rawudp-transmitter.c | 43 ++++++++++++++++++++++++++-
transmitters/rawudp/fs-rawudp-transmitter.h | 7 ++++
3 files changed, 51 insertions(+), 1 deletions(-)
diff --git a/docs/plugins/farsight2-plugins-sections.txt b/docs/plugins/farsight2-plugins-sections.txt
index f108151..38faae2 100644
--- a/docs/plugins/farsight2-plugins-sections.txt
+++ b/docs/plugins/farsight2-plugins-sections.txt
@@ -65,6 +65,8 @@ fs_rawudp_transmitter_udpport_is_pad
fs_rawudp_transmitter_udpport_get_port
fs_rawudp_transmitter_udpport_add_known_address
fs_rawudp_transmitter_udpport_remove_known_address
+fs_rawudp_transmitter_udpport_add_recvonly_dest
+fs_rawudp_transmitter_udpport_remove_recvonly_dest
<SUBSECTION Standard>
FS_RAWUDP_TRANSMITTER_CAST
FS_RAWUDP_TRANSMITTER
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.c b/transmitters/rawudp/fs-rawudp-transmitter.c
index 8ce24f9..636e530 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-transmitter.c
@@ -510,6 +510,10 @@ struct _UdpPort {
GstElement *udpsink;
GstPad *udpsink_requested_pad;
+ GstElement *recvonly_filter;
+ GstElement *recvonly_udpsink;
+ GstPad *recvonly_requested_pad;
+
gchar *requested_ip;
guint requested_port;
@@ -854,6 +858,24 @@ fs_rawudp_transmitter_get_udpport (FsRawUdpTransmitter *trans,
"sync", FALSE,
NULL);
+ udpport->recvonly_filter = fs_transmitter_get_recvonly_filter (
+ FS_TRANSMITTER (trans), udpport->component_id);
+
+ if (udpport->recvonly_filter)
+ {
+ udpport->recvonly_udpsink = _create_sinksource ("multiudpsink",
+ GST_BIN (trans->priv->gst_sink), udpport->tee, udpport->recvonly_filter,
+ udpport->fd, GST_PAD_SINK, &udpport->recvonly_requested_pad, error);
+ if (!udpport->recvonly_udpsink)
+ goto error;
+
+
+ g_object_set (udpport->recvonly_udpsink,
+ "async", FALSE,
+ "sync", FALSE,
+ NULL);
+ }
+
g_mutex_lock (trans->priv->mutex);
/* Check if someone else added the same port at the same time */
@@ -951,7 +973,7 @@ fs_rawudp_transmitter_put_udpport (FsRawUdpTransmitter *trans,
void
fs_rawudp_transmitter_udpport_add_dest (UdpPort *udpport,
- const gchar *ip,
+ const gchar *ip,
gint port)
{
GST_DEBUG ("Adding dest %s:%d", ip, port);
@@ -1167,3 +1189,22 @@ fs_rawudp_transmitter_udpport_remove_known_address (UdpPort *udpport,
g_mutex_unlock (udpport->mutex);
}
+
+void
+fs_rawudp_transmitter_udpport_add_recvonly_dest (UdpPort *udpport,
+ const gchar *ip,
+ gint port)
+{
+ if (udpport->recvonly_udpsink)
+ g_signal_emit_by_name (udpport->recvonly_udpsink, "add", ip, port);
+}
+
+
+void
+fs_rawudp_transmitter_udpport_remove_recvonly_dest (UdpPort *udpport,
+ const gchar *ip,
+ gint port)
+{
+ if (udpport->recvonly_udpsink)
+ g_signal_emit_by_name (udpport->recvonly_udpsink, "remove", ip, port);
+}
diff --git a/transmitters/rawudp/fs-rawudp-transmitter.h b/transmitters/rawudp/fs-rawudp-transmitter.h
index 1d112aa..151444a 100644
--- a/transmitters/rawudp/fs-rawudp-transmitter.h
+++ b/transmitters/rawudp/fs-rawudp-transmitter.h
@@ -144,6 +144,13 @@ void fs_rawudp_transmitter_udpport_remove_known_address (UdpPort *udpport,
FsRawUdpAddressUniqueCallbackFunc callback,
gpointer user_data);
+void fs_rawudp_transmitter_udpport_add_recvonly_dest (UdpPort *udpport,
+ const gchar *ip,
+ gint port);
+
+void fs_rawudp_transmitter_udpport_remove_recvonly_dest (UdpPort *udpport,
+ const gchar *ip,
+ gint port);
G_END_DECLS
--
1.5.6.5
More information about the farsight-commits
mailing list