[farsight2/master] Make the config data optional when creating codec lists
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:23:00 PST 2008
---
gst/fsrtpconference/fs-rtp-codec-negotiation.c | 12 ++++++++++--
gst/fsrtpconference/fs-rtp-codec-negotiation.h | 3 ++-
gst/fsrtpconference/fs-rtp-session.c | 5 +++--
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.c b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
index 660b3ab..8f98138 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.c
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
@@ -839,6 +839,7 @@ codec_association_copy (CodecAssociation *ca)
/**
* codec_associations_to_codecs:
* @codec_associations: a #GList of #CodecAssociation
+ * @include_config: whether to include the config data
*
* Returns a #GList of the #FsCodec that are inside the list of associations
* excluding those that are disabled or otherwise receive-only. It copies
@@ -847,7 +848,8 @@ codec_association_copy (CodecAssociation *ca)
* Returns: a #GList of #FsCodec
*/
GList *
-codec_associations_to_codecs (GList *codec_associations)
+codec_associations_to_codecs (GList *codec_associations,
+ gboolean include_config)
{
GList *codecs = NULL;
GList *item = NULL;
@@ -859,7 +861,13 @@ codec_associations_to_codecs (GList *codec_associations)
CodecAssociation *ca = item->data;
if (!ca->disable && !ca->reserved && !ca->recv_only && ca->codec)
{
- codecs = g_list_append (codecs, fs_codec_copy (ca->codec));
+ FsCodec *codec = NULL;
+
+ if (include_config)
+ codec = fs_codec_copy (ca->codec);
+ else
+ codec = codec_copy_without_config (ca->codec);
+ codecs = g_list_append (codecs, codec);
}
}
diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.h b/gst/fsrtpconference/fs-rtp-codec-negotiation.h
index cc581ba..df3931a 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.h
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.h
@@ -94,7 +94,8 @@ gboolean
codec_association_is_valid_for_sending (CodecAssociation *ca);
GList *
-codec_associations_to_codecs (GList *codec_associations);
+codec_associations_to_codecs (GList *codec_associations,
+ gboolean include_config);
gboolean
codec_associations_list_are_equal (GList *list1, GList *list2);
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 44a8ba8..d17c95c 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -594,7 +594,8 @@ fs_rtp_session_get_property (GObject *object,
self->priv->blueprints,
self->priv->local_codecs_configuration,
self->priv->codec_associations);
- local_codecs = codec_associations_to_codecs (local_codec_associations);
+ local_codecs = codec_associations_to_codecs (local_codec_associations,
+ TRUE);
codec_association_list_destroy (local_codec_associations);
FS_RTP_SESSION_UNLOCK (self);
@@ -609,7 +610,7 @@ fs_rtp_session_get_property (GObject *object,
GList *negotiated_codecs = NULL;
FS_RTP_SESSION_LOCK (self);
negotiated_codecs = codec_associations_to_codecs (
- self->priv->codec_associations);
+ self->priv->codec_associations, TRUE);
FS_RTP_SESSION_UNLOCK (self);
g_value_take_boxed (value, negotiated_codecs);
}
--
1.5.6.5
More information about the farsight-commits
mailing list