[farsight2/master] Implement dropping the SR if sending is false

Olivier Crête olivier.crete at collabora.co.uk
Thu Feb 5 06:32:04 PST 2009


---
 gst/rtcpfilter/fs-rtcp-filter.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/gst/rtcpfilter/fs-rtcp-filter.c b/gst/rtcpfilter/fs-rtcp-filter.c
index 2ebef2c..4b17310 100644
--- a/gst/rtcpfilter/fs-rtcp-filter.c
+++ b/gst/rtcpfilter/fs-rtcp-filter.c
@@ -182,12 +182,39 @@ fs_rtcp_filter_set_property (GObject *object,
 static GstFlowReturn
 fs_rtcp_filter_transform_ip (GstBaseTransform *transform, GstBuffer *buf)
 {
+  FsRtcpFilter *filter = FS_RTCP_FILTER (transform);
+
   if (!gst_rtcp_buffer_validate (buf))
   {
     GST_ERROR_OBJECT (transform, "Invalid RTCP buffer");
     return GST_FLOW_ERROR;
   }
 
+  GST_OBJECT_LOCK (filter);
+
+  if (!filter->sending)
+  {
+    GstRTCPPacket packet;
+
+    gst_rtcp_buffer_get_first_packet (buf, &packet);
+
+    for (;;)
+    {
+      if (gst_rtcp_packet_get_type (&packet) == GST_RTCP_TYPE_SR)
+      {
+        if (!gst_rtcp_packet_remove (&packet))
+          break;
+      }
+      else
+      {
+        if (!gst_rtcp_packet_move_to_next (&packet))
+          break;
+      }
+    }
+  }
+
+  GST_OBJECT_UNLOCK (filter);
+
   return GST_FLOW_OK;
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list