[farsight2/master] Add negotiation_filter method to the special source class

Olivier Crête olivier.crete at collabora.co.uk
Fri Feb 6 03:45:15 PST 2009


---
 gst/fsrtpconference/fs-rtp-special-source.c |   44 +++++++++++++++++++++++++++
 gst/fsrtpconference/fs-rtp-special-source.h |    8 +++++
 2 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-special-source.c b/gst/fsrtpconference/fs-rtp-special-source.c
index 8e326a9..f4b5c27 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.c
+++ b/gst/fsrtpconference/fs-rtp-special-source.c
@@ -352,6 +352,22 @@ fs_rtp_special_source_class_want_source (FsRtpSpecialSourceClass *klass,
   return FALSE;
 }
 
+
+static GList*
+fs_rtp_special_source_class_negotiation_filter (FsRtpSpecialSourceClass *klass,
+    GList *codec_associations)
+{
+  if (klass->negotiation_filter)
+    return klass->negotiation_filter (klass, codec_associations);
+  else
+    GST_CAT_DEBUG (fsrtpconference_disco,
+        "Class %s has no negotiation_filter function",
+        G_OBJECT_CLASS_NAME(klass));
+
+  return codec_associations;
+}
+
+
 /**
  * fs_rtp_special_sources_add_blueprints:
  * @blueprints: a #GList of #CodecBlueprint
@@ -382,6 +398,34 @@ fs_rtp_special_sources_add_blueprints (GList *blueprints)
   return blueprints;
 }
 
+/**
+ * fs_rtp_special_sources_negotiation_filter:
+ * @codec_associations: A #GList of negotiation Codec Associations
+ *
+ * This will apply all of the source specific negotiation filters to the list
+ * of just negotiated codec associations and modify it in the appropriate way.
+ */
+
+GList *
+fs_rtp_special_sources_negotiation_filter (GList *codec_associations)
+{
+  GList *item = NULL;
+
+  fs_rtp_special_sources_init ();
+
+  for (item = g_list_first (classes);
+       item;
+       item = g_list_next (item))
+  {
+    FsRtpSpecialSourceClass *klass = item->data;
+
+    codec_associations = fs_rtp_special_source_class_negotiation_filter (klass,
+        codec_associations);
+  }
+
+  return codec_associations;
+}
+
 static gboolean
 _source_order_compare_func (gconstpointer item1,gconstpointer item2)
 {
diff --git a/gst/fsrtpconference/fs-rtp-special-source.h b/gst/fsrtpconference/fs-rtp-special-source.h
index 22a68ed..7fde0a4 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.h
+++ b/gst/fsrtpconference/fs-rtp-special-source.h
@@ -65,6 +65,8 @@ typedef struct _FsRtpSpecialSourcePrivate FsRtpSpecialSourcePrivate;
  *  installed don't change. It must fill the #CodecBlueprint completely except
  *  for the send_pipeline_factory field. If no blueprints are installed by this
  *  class, this method is not required.
+ * @negotiation_filter: This filters out the invalid CodecAssociation according
+ *  to the special source specific rules.
  *
  * Class structure for #FsRtpSpecialSource, the build() and want_source()
  * methods are required.
@@ -87,6 +89,9 @@ struct _FsRtpSpecialSourceClass
 
   GList* (*add_blueprint) (FsRtpSpecialSourceClass *klass,
       GList *blueprints);
+
+  GList* (*negotiation_filter) (FsRtpSpecialSourceClass *klass,
+      GList *codec_associations);
 };
 
 /**
@@ -142,6 +147,9 @@ gboolean
 fs_rtp_special_sources_stop_telephony_event (GList *current_extra_sources,
     FsDTMFMethod method);
 
+GList *
+fs_rtp_special_sources_negotiation_filter (GList *codec_associations);
+
 G_END_DECLS
 
 #endif /* __FS_RTP_SPECIAL_SOURCE_H__ */
-- 
1.5.6.5




More information about the farsight-commits mailing list