[farsight2/master] Completely remove negotiated_codecs list
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:22:39 PST 2008
---
gst/fsrtpconference/fs-rtp-codec-negotiation.c | 18 ++++--------------
gst/fsrtpconference/fs-rtp-codec-negotiation.h | 3 +--
gst/fsrtpconference/fs-rtp-session.c | 14 ++------------
3 files changed, 7 insertions(+), 28 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.c b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
index 9b5fbfb..37d8e39 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.c
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.c
@@ -428,12 +428,10 @@ create_local_codec_associations (
* negotiate_codecs:
* @remote_codecs: The list of remote codecs passed from the other side
* @negotiated_codec_associations: The previous negotiated codecs
- * @local_codec_associations: The list of local #CodecAssociation
+ * @local_codec_associations: The list of local #CodecAssociation ordered by
+ * priority
* @use_local_ids: Wheter to use local or remote PTs if they dont match (%TRUE
* for local, %FALSE for remote)
- * @negotiated_codecs_out: A pointer to a pointer to a #GList where the ordered
- * GList of negotiated codecs can be stored (its not touched if no codec could
- * be negotiated)
*
* This function performs the codec negotiation.
*
@@ -444,11 +442,9 @@ GList *
negotiate_codecs (const GList *remote_codecs,
GList *negotiated_codec_associations,
GList *local_codec_associations,
- gboolean use_local_ids,
- GList **negotiated_codecs_out)
+ gboolean use_local_ids)
{
GList *new_codec_associations = NULL;
- GList *new_negotiated_codecs = NULL;
const GList *rcodec_e = NULL;
int i;
@@ -509,8 +505,6 @@ negotiate_codecs (const GList *remote_codecs,
new_codec_associations = g_list_append (new_codec_associations,
new_ca);
- new_negotiated_codecs = g_list_append (new_negotiated_codecs,
- fs_codec_copy (new_ca->codec));
} else {
gchar *tmp = fs_codec_to_string (remote_codec);
CodecAssociation *ca = g_slice_new0 (CodecAssociation);
@@ -526,11 +520,8 @@ negotiate_codecs (const GList *remote_codecs,
}
/* If no intersection was found, lets return NULL */
- if (!new_negotiated_codecs)
- {
- codec_association_list_destroy (new_codec_associations);
+ if (!new_codec_associations)
return NULL;
- }
/* Now, lets fill all of the PTs that were previously used in the session
* even if they are not currently used, so they can't be re-used
@@ -571,7 +562,6 @@ negotiate_codecs (const GList *remote_codecs,
}
- *negotiated_codecs_out = new_negotiated_codecs;
return new_codec_associations;
}
diff --git a/gst/fsrtpconference/fs-rtp-codec-negotiation.h b/gst/fsrtpconference/fs-rtp-codec-negotiation.h
index 16c1c12..202dc4b 100644
--- a/gst/fsrtpconference/fs-rtp-codec-negotiation.h
+++ b/gst/fsrtpconference/fs-rtp-codec-negotiation.h
@@ -70,8 +70,7 @@ GList *
negotiate_codecs (const GList *remote_codecs,
GList *current_negotiated_codec_associations,
GList *local_codec_associations,
- gboolean use_local_ids,
- GList **new_negotiated_codecs);
+ gboolean use_local_ids);
CodecAssociation *
lookup_codec_association_by_pt (GList *codec_associations, gint pt);
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 659c1df..4c5da88 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -133,7 +133,6 @@ struct _FsRtpSessionPrivate
GList *local_codec_associations;
/* These are protected by the session mutex */
- GList *negotiated_codecs;
GList *negotiated_codec_associations;
/* Protected by the session mutex */
@@ -499,9 +498,6 @@ fs_rtp_session_finalize (GObject *object)
if (self->priv->local_codec_associations)
codec_association_list_destroy (self->priv->local_codec_associations);
- if (self->priv->negotiated_codecs)
- fs_codec_list_destroy (self->priv->negotiated_codecs);
-
if (self->priv->negotiated_codec_associations)
codec_association_list_destroy (self->priv->negotiated_codec_associations);
@@ -1582,7 +1578,6 @@ fs_rtp_session_negotiate_codecs (FsRtpSession *session,
{
gboolean has_many_streams = FALSE;
GList *new_negotiated_codec_associations = NULL;
- GList *new_negotiated_codecs = NULL;
GList *item;
FS_RTP_SESSION_LOCK (session);
@@ -1602,20 +1597,17 @@ fs_rtp_session_negotiate_codecs (FsRtpSession *session,
new_negotiated_codec_associations = negotiate_codecs (remote_codecs,
session->priv->negotiated_codec_associations,
session->priv->local_codec_associations,
- has_many_streams,
- &new_negotiated_codecs);
+ has_many_streams);
if (new_negotiated_codec_associations) {
gboolean is_new = TRUE;
GList *old_negotiated_codec_associations =
session->priv->negotiated_codec_associations;
- GList *old_negotiated_codecs = session->priv->negotiated_codecs;
session->priv->negotiated_codec_associations =
new_negotiated_codec_associations;
- session->priv->negotiated_codecs = new_negotiated_codecs;
- if (old_negotiated_codecs)
+ if (old_negotiated_codec_associations)
{
gboolean clear_pts = FALSE;
int pt;
@@ -1658,8 +1650,6 @@ fs_rtp_session_negotiate_codecs (FsRtpSession *session,
if (old_negotiated_codec_associations)
codec_association_list_destroy (old_negotiated_codec_associations);
- if (old_negotiated_codecs)
- fs_codec_list_destroy (old_negotiated_codecs);
if (!fs_rtp_session_verify_send_codec_bin_locked (session, error))
{
--
1.5.6.5
More information about the farsight-commits
mailing list