[farsight2/master] Rename FsSession property negotiated-codecs into codecs
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:23:29 PST 2008
---
gst-libs/gst/farsight/fs-session.c | 46 +++++++++++++++++++--------------
gst/fsrtpconference/fs-rtp-session.c | 27 +++++++++----------
tests/check/main/rtpcodecs.c | 42 +++++++++++++++---------------
tests/check/main/rtpconference.c | 30 +++++++++++-----------
tests/check/main/rtpsendcodecs.c | 2 +-
tests/gui/fs2-gui.py | 2 +-
6 files changed, 77 insertions(+), 72 deletions(-)
diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c
index 0fcfec9..1989946 100644
--- a/gst-libs/gst/farsight/fs-session.c
+++ b/gst-libs/gst/farsight/fs-session.c
@@ -58,7 +58,7 @@
* ]|
* <para>
* This message is sent on the bus when the value of the
- * #FsSession:negotiated-codecs property changes.
+ * #FsSession:codecs property changes.
* If one is using codecs that have configuration data that needs to be
* transmitted reliably, once should check the value of #FsSession:codecs-ready
* property to make sure all of the codecs configuration are ready and have been
@@ -99,7 +99,7 @@ enum
PROP_ID,
PROP_SINK_PAD,
PROP_LOCAL_CODECS_CONFIG,
- PROP_NEGOTIATED_CODECS,
+ PROP_CODECS,
PROP_CURRENT_SEND_CODEC,
PROP_CODECS_READY
};
@@ -208,25 +208,31 @@ fs_session_class_init (FsSessionClass *klass)
G_PARAM_READABLE));
/**
- * FsSession:negotiated-codecs:
+ * FsSession:codecs:
*
- * This list indicated what codecs have been successfully negotiated with the
- * session participants. This list can change based on participants
- * joining/leaving the session. It is a #GList of #FsCodec. User must free
- * this codec list using fs_codec_list_destroy() when done.
+ * This is the list of codecs used for this session. It will include the
+ * codecs and payload type used to receive media on this session. It will
+ * also include any configuration parameter that must be transmitted reliably
+ * for the other end to decode the content.
*
- * The #GObject::notify signal is emited when the content of this property
- * changes. This can happen when new remote codecs are added to the session
- * (i.e. When a session is being initialized or a new participant joins an
- * existing session).
+ * It may change when the local-codecs-config are set, when codecs are set
+ * on a #FsStream in this session, when a #FsStream is destroyed or
+ * asynchronously when new config data is discovered.
+ *
+ * You can only assume that the configuration parameters are valid when
+ * the #FsSession:codecs-ready property is %TRUE.
+ * The "farsight-codecs-changed" message will be emitted whenever the value
+ * of this property changes.
+ *
+ * It is a #GList of #FsCodec. User must free this codec list using
+ * fs_codec_list_destroy() when done.
*
*/
g_object_class_install_property (gobject_class,
- PROP_NEGOTIATED_CODECS,
- g_param_spec_boxed ("negotiated-codecs",
- "List of negotiated codecs",
- "A GList of FsCodecs indicating the codecs that have been successfully"
- " negotiated",
+ PROP_CODECS,
+ g_param_spec_boxed ("codecs",
+ "List of codecs",
+ "A GList of FsCodecs indicating the codecs for this session",
FS_TYPE_CODEC_LIST,
G_PARAM_READABLE));
@@ -254,7 +260,7 @@ fs_session_class_init (FsSessionClass *klass)
* Some codecs that have configuration data that needs to be sent reliably
* may need to be initialized from actual data before being ready. If your
* application uses such codecs, wait until this property is %TRUE before
- * using the #FsSession:negotiated-codecs
+ * using the #FsSession:codecs
* property. If the value if not %TRUE, the "farsight-codecs-changed"
* message will be emitted when it becomes %TRUE. You should re-check
* the value of this property when you receive the message.
@@ -458,8 +464,8 @@ fs_session_stop_telephony_event (FsSession *session, FsDTMFMethod method)
* @error: location of a #GError, or %NULL if no error occured
*
* This function will set the currently being sent codec for all streams in this
- * session. The given #FsCodec must be taken directly from the #negotiated-codecs
- * property of the session. If the given codec is not in the negotiated codecs
+ * session. The given #FsCodec must be taken directly from the #codecs
+ * property of the session. If the given codec is not in the codecs
* list, @error will be set and %FALSE will be returned. The @send_codec will be
* copied so it must be free'd using fs_codec_destroy() when done.
*
@@ -489,7 +495,7 @@ fs_session_set_send_codec (FsSession *session, FsCodec *send_codec,
* Set the list of desired codec configuration. The user may
* change this value during an ongoing session. Note that doing this can cause
* the codecs to change. Therefore this requires the user to fetch
- * the new negotiated-codecs and renegotiate them with the peers. It is a #GList
+ * the new codecs and renegotiate them with the peers. It is a #GList
* of #FsCodec. The function does not take ownership of the list.
*
* The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 1b707fe..fed9f70 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -64,7 +64,7 @@ enum
PROP_ID,
PROP_SINK_PAD,
PROP_LOCAL_CODECS_CONFIG,
- PROP_NEGOTIATED_CODECS,
+ PROP_CODECS,
PROP_CURRENT_SEND_CODEC,
PROP_CODECS_READY,
PROP_CONFERENCE,
@@ -283,7 +283,7 @@ fs_rtp_session_class_init (FsRtpSessionClass *klass)
g_object_class_override_property (gobject_class,
PROP_LOCAL_CODECS_CONFIG, "local-codecs-config");
g_object_class_override_property (gobject_class,
- PROP_NEGOTIATED_CODECS, "negotiated-codecs");
+ PROP_CODECS, "codecs");
g_object_class_override_property (gobject_class,
PROP_CURRENT_SEND_CODEC, "current-send-codec");
g_object_class_override_property (gobject_class,
@@ -594,14 +594,14 @@ fs_rtp_session_get_property (GObject *object,
case PROP_LOCAL_CODECS_CONFIG:
g_value_set_boxed (value, self->priv->local_codecs_configuration);
break;
- case PROP_NEGOTIATED_CODECS:
+ case PROP_CODECS:
{
- GList *negotiated_codecs = NULL;
+ GList *codecs = NULL;
FS_RTP_SESSION_LOCK (self);
- negotiated_codecs = codec_associations_to_codecs (
- self->priv->codec_associations, TRUE);
+ codecs = codec_associations_to_codecs (self->priv->codec_associations,
+ TRUE);
FS_RTP_SESSION_UNLOCK (self);
- g_value_take_boxed (value, negotiated_codecs);
+ g_value_take_boxed (value, codecs);
}
break;
case PROP_CODECS_READY:
@@ -1362,8 +1362,8 @@ fs_rtp_session_stop_telephony_event (FsSession *session, FsDTMFMethod method)
* @error: location of a #GError, or NULL if no error occured
*
* This function will set the currently being sent codec for all streams in this
- * session. The given #FsCodec must be taken directly from the #negotiated-codecs
- * property of the session. If the given codec is not in the negotiated codecs
+ * session. The given #FsCodec must be taken directly from the #FsSession:codecs
+ * property of the session. If the given codec is not in the codecs
* list, @error will be set and %FALSE will be returned. The @send_codec will be
* copied so it must be free'd using fs_codec_destroy () when done.
*
@@ -1391,7 +1391,7 @@ fs_rtp_session_set_send_codec (FsSession *session, FsCodec *send_codec,
else
{
g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
- "The passed codec is not part of the list of negotiated codecs");
+ "The passed codec is not part of the list of codecs");
}
FS_RTP_SESSION_UNLOCK (self);
@@ -1430,7 +1430,7 @@ fs_rtp_session_set_local_codecs_config (FsSession *session,
{
fs_codec_list_destroy (old_codec_configs);
- g_object_notify ((GObject*) self, "negotiated-codecs");
+ g_object_notify ((GObject*) self, "codecs");
g_object_notify ((GObject*) self, "local-codecs-config");
gst_element_post_message (GST_ELEMENT (self->priv->conference),
@@ -2022,8 +2022,7 @@ fs_rtp_session_update_codecs (FsRtpSession *session,
if (is_new)
{
- if (has_remotes)
- g_object_notify (G_OBJECT (session), "negotiated-codecs");
+ g_object_notify (G_OBJECT (session), "codecs");
gst_element_post_message (GST_ELEMENT (session->priv->conference),
gst_message_new_element (GST_OBJECT (session->priv->conference),
@@ -2433,7 +2432,7 @@ fs_rtp_session_get_recv_codec_locked (FsRtpSession *session,
if (!session->priv->codec_associations)
{
g_set_error (error, FS_ERROR, FS_ERROR_INTERNAL,
- "No negotiated codecs yet");
+ "No codecs yet");
return NULL;
}
diff --git a/tests/check/main/rtpcodecs.c b/tests/check/main/rtpcodecs.c
index 51ce566..1149c3a 100644
--- a/tests/check/main/rtpcodecs.c
+++ b/tests/check/main/rtpcodecs.c
@@ -47,12 +47,12 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
dat = setup_simple_conference (1, "fsrtpconference", "bob at 127.0.0.1");
- g_object_get (dat->session, "negotiated-codecs", &orig_codecs, NULL);
+ g_object_get (dat->session, "codecs", &orig_codecs, NULL);
fail_unless (fs_session_set_local_codecs_config (dat->session, orig_codecs,
&error), "Could not set local codecs as codec config");
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
fail_unless (fs_codec_list_are_equal (orig_codecs, codecs),
"Setting local codecs as preferences changes the list of local codecs");
@@ -88,7 +88,7 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
codecs = g_list_append (codecs, codec);
}
- g_signal_connect (dat->session, "notify::negotiated-codecs",
+ g_signal_connect (dat->session, "notify::codecs",
G_CALLBACK (_notify_local_codecs), &local_codecs_notified);
fail_unless (
@@ -113,7 +113,7 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
fs_codec_list_destroy (codecs);
fs_codec_list_destroy (codecs2);
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
{
@@ -141,12 +141,12 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
"Could not set local-codecs-config");
fail_if (error, "Error set while function succeeded?");
fail_unless (local_codecs_notified, "We were not notified of the change"
- " in negotiated-codecs");
+ " in codecs");
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
fail_unless (fs_codec_list_are_equal (codecs, orig_codecs),
- "Resetting negotiated-codecs-config failed, codec lists are not equal");
+ "Resetting codecs-config failed, codec lists are not equal");
fs_codec_list_destroy (orig_codecs);
@@ -192,7 +192,7 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
dat = setup_simple_conference (1, "fsrtpconference", "bob at 127.0.0.1");
st = simple_conference_add_stream (dat, dat);
- g_signal_connect (dat->session, "notify::negotiated-codecs",
+ g_signal_connect (dat->session, "notify::codecs",
G_CALLBACK (_negotiated_codecs_notify), dat);
codecs = g_list_append (codecs,
@@ -225,9 +225,9 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
"Could not set remote PCMU codec");
fail_unless (has_negotiated == TRUE,
- "Did not receive the notify::negotiated-codecs signal");
+ "Did not receive the notify::codecs signal");
- g_object_get (dat->session, "negotiated-codecs", &codecs2, NULL);
+ g_object_get (dat->session, "codecs", &codecs2, NULL);
fail_unless (g_list_length (codecs2) == 1, "Too many negotiated codecs");
fail_unless (fs_codec_are_equal (codecs->data, codecs2->data),
"Negotiated codec does not match remote codec");
@@ -239,7 +239,7 @@ GST_START_TEST (test_rtpcodecs_two_way_negotiation)
"Could not re-set remote PCMU codec");
fail_if (has_negotiated == TRUE,
- "We received the notify::negotiated-codecs signal even though codecs"
+ "We received the notify::codecs signal even though codecs"
" have not changed");
fs_codec_list_destroy (codecs);
@@ -292,7 +292,7 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
dat = setup_simple_conference (1, "fsrtpconference", "bob at 127.0.0.1");
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
{
FsCodec *codec = item->data;
@@ -316,7 +316,7 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
fail_unless (fs_session_set_local_codecs_config (dat->session, codec_prefs,
NULL), "Could not set local codecs config");
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
{
FsCodec *codec = item->data;
@@ -340,14 +340,14 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
fail_if (s == NULL, "Could not add stream");
g_object_unref (p);
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
fail_unless (fs_stream_set_remote_codecs (s, codecs, NULL),
"Could not set local codecs as remote codecs");
fs_codec_list_destroy (codecs);
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
{
FsCodec *codec = item->data;
@@ -362,7 +362,7 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
fail_unless (fs_session_set_local_codecs_config (dat->session, codec_prefs,
NULL), "Could not set local-codecs config after set_remote_codecs");
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
{
FsCodec *codec = item->data;
@@ -377,7 +377,7 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
fail_unless (fs_session_set_local_codecs_config (dat->session, codec_prefs,
NULL), "Could not re-set local-codes config after set_remote_codecs");
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
{
FsCodec *codec = item->data;
@@ -460,7 +460,7 @@ _bus_message_element (GstBus *bus, GstMessage *message,
if (!ready)
return;
- g_object_get (cd->dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (cd->dat->session, "codecs", &codecs, NULL);
check_vorbis_and_configuration ("codecs before negotiation", codecs, NULL);
fs_codec_list_destroy (codecs);
@@ -511,7 +511,7 @@ _bus_message_element (GstBus *bus, GstMessage *message,
g_object_get (cd->dat->session, "codecs-ready", &ready, NULL);
fail_unless (ready, "Codecs became unready after setting new remote codecs");
- g_object_get (cd->dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (cd->dat->session, "codecs", &codecs, NULL);
check_vorbis_and_configuration ("session codecs after negotiation",
codecs, NULL);
fs_codec_list_destroy (codecs);
@@ -553,7 +553,7 @@ _bus_message_element (GstBus *bus, GstMessage *message,
g_object_get (cd->dat->session, "codecs-ready", &ready, NULL);
fail_unless (ready, "Codecs became unready after setting new remote codecs");
- g_object_get (cd->dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (cd->dat->session, "codecs", &codecs, NULL);
check_vorbis_and_configuration ("session codecs after renegotiation",
codecs, NULL);
fs_codec_list_destroy (codecs);
@@ -613,7 +613,7 @@ run_test_rtpcodecs_config_data (gboolean preset_remotes)
fs_codec_list_destroy (codecs);
- g_object_get (cd.dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (cd.dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
{
FsCodec *codec = item->data;
diff --git a/tests/check/main/rtpconference.c b/tests/check/main/rtpconference.c
index 3d4b002..50bffd6 100644
--- a/tests/check/main/rtpconference.c
+++ b/tests/check/main/rtpconference.c
@@ -78,7 +78,7 @@ GST_START_TEST (test_rtpconference_new)
g_object_get (dat->session,
"id", &id,
- "negotiated-codecs", &codecs,
+ "codecs", &codecs,
"media-type", &media_type,
"sink-pad", &sinkpad,
"conference", &conf,
@@ -353,18 +353,18 @@ _handoff_handler (GstElement *element, GstBuffer *buffer, GstPad *pad,
struct SimpleTestStream *st = user_data;
int i;
gboolean stop = TRUE;
- GList *negotiated_codecs = NULL;
+ GList *codecs = NULL;
g_object_get (st->dat->session,
- "negotiated-codecs", &negotiated_codecs,
+ "codecs", &codecs,
NULL);
- ts_fail_if (negotiated_codecs == NULL, "Could not get negotiated codecs");
+ ts_fail_if (codecs == NULL, "Could not get codecs");
if (st->flags & WAITING_ON_LAST_CODEC)
{
if (fs_codec_are_equal (
- g_list_last (negotiated_codecs)->data,
+ g_list_last (codecs)->data,
g_object_get_data (G_OBJECT (element), "codec")))
{
st->flags &= ~WAITING_ON_LAST_CODEC;
@@ -376,12 +376,12 @@ _handoff_handler (GstElement *element, GstBuffer *buffer, GstPad *pad,
{
gchar *str = fs_codec_to_string (
g_object_get_data (G_OBJECT (element), "codec"));
- gchar *str2 = fs_codec_to_string (g_list_last (negotiated_codecs)->data);
+ gchar *str2 = fs_codec_to_string (g_list_last (codecs)->data);
g_debug ("not yet the last codec, skipping (we have %s, we want %s)",
str, str2);
g_free (str);
g_free (str2);
- fs_codec_list_destroy (negotiated_codecs);
+ fs_codec_list_destroy (codecs);
return;
}
}
@@ -390,17 +390,17 @@ _handoff_handler (GstElement *element, GstBuffer *buffer, GstPad *pad,
if (select_last_codec || st->flags & SHOULD_BE_LAST_CODEC)
ts_fail_unless (
fs_codec_are_equal (
- g_list_last (negotiated_codecs)->data,
+ g_list_last (codecs)->data,
g_object_get_data (G_OBJECT (element), "codec")),
"The handoff handler got a buffer from the wrong codec (last)");
else
ts_fail_unless (
fs_codec_are_equal (
- g_list_first (negotiated_codecs)->data,
+ g_list_first (codecs)->data,
g_object_get_data (G_OBJECT (element), "codec")),
"The handoff handler got a buffer from the wrong codec");
- fs_codec_list_destroy (negotiated_codecs);
+ fs_codec_list_destroy (codecs);
st->buffer_count++;
@@ -440,10 +440,10 @@ _handoff_handler (GstElement *element, GstBuffer *buffer, GstPad *pad,
gchar *str = NULL;
g_object_get (st->target->session,
- "negotiated-codecs", &nego_codecs,
+ "codecs", &nego_codecs,
NULL);
- ts_fail_if (nego_codecs == NULL, "No negotiated codecs ??");
+ ts_fail_if (nego_codecs == NULL, "No codecs");
ts_fail_if (g_list_length (nego_codecs) < 2, "Only one negotiated codec");
str = fs_codec_to_string (g_list_last (nego_codecs)->data);
@@ -592,7 +592,7 @@ _negotiated_codecs_notify (GObject *object, GParamSpec *paramspec,
ts_fail_if (session != dat->session, "Got signal from the wrong object");
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
ts_fail_if (codecs == NULL, "Could not get the negotiated codecs");
@@ -649,7 +649,7 @@ set_initial_codecs (
GList *rcodecs2 = NULL;
GError *error = NULL;
- g_object_get (from->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (from->session, "codecs", &codecs, NULL);
ts_fail_if (codecs == NULL, "Could not get the codecs");
@@ -723,7 +723,7 @@ nway_test (int in_count, extra_init extrainit)
setup_fakesrc (dats[i]);
if (i != 0)
- g_signal_connect (dats[i]->session, "notify::negotiated-codecs",
+ g_signal_connect (dats[i]->session, "notify::codecs",
G_CALLBACK (_negotiated_codecs_notify), dats[i]);
}
diff --git a/tests/check/main/rtpsendcodecs.c b/tests/check/main/rtpsendcodecs.c
index 69f41e4..a2bd33b 100644
--- a/tests/check/main/rtpsendcodecs.c
+++ b/tests/check/main/rtpsendcodecs.c
@@ -187,7 +187,7 @@ set_codecs (struct SimpleTestConference *dat, FsStream *stream)
GList *item = NULL;
GError *error = NULL;
- g_object_get (dat->session, "negotiated-codecs", &codecs, NULL);
+ g_object_get (dat->session, "codecs", &codecs, NULL);
ts_fail_if (codecs == NULL, "Could not get the local codecs");
diff --git a/tests/gui/fs2-gui.py b/tests/gui/fs2-gui.py
index 2f51b2e..96b682c 100644
--- a/tests/gui/fs2-gui.py
+++ b/tests/gui/fs2-gui.py
@@ -485,7 +485,7 @@ class FsUIStream:
if not self.session.fssession.get_property("codecs-ready"):
print "Codecs are not ready"
return
- codecs = self.session.fssession.get_property("negotiated-codecs")
+ codecs = self.session.fssession.get_property("codecs")
assert(codecs is not None and len(codecs) > 0)
if (codecs == self.last_codecs):
return
--
1.5.6.5
More information about the farsight-commits
mailing list