[farsight2/master] Rename local-codecs-config into codec-preferences
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:23:26 PST 2008
---
docs/libs/farsight2-libs-sections.txt | 2 +-
gst-libs/gst/farsight/fs-session.c | 37 +++++++++++-----------
gst-libs/gst/farsight/fs-session.h | 11 +++---
gst/fsrtpconference/fs-rtp-session.c | 55 ++++++++++++++++-----------------
python/pyfarsight.defs | 6 ++--
python/pyfarsight.override | 6 ++--
tests/check/main/rtpcodecs.c | 52 +++++++++++++++---------------
tests/gui/fs2-gui.py | 4 +-
8 files changed, 86 insertions(+), 87 deletions(-)
diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index 6b86f2e..156ebd4 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -50,7 +50,7 @@ fs_session_new_stream
fs_session_start_telephony_event
fs_session_stop_telephony_event
fs_session_set_send_codec
-fs_session_set_local_codecs_config
+fs_session_set_codec_preferences
fs_session_emit_error
<SUBSECTION Standard>
FS_SESSION
diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c
index d8c267e..ea41b42 100644
--- a/gst-libs/gst/farsight/fs-session.c
+++ b/gst-libs/gst/farsight/fs-session.c
@@ -98,7 +98,7 @@ enum
PROP_MEDIA_TYPE,
PROP_ID,
PROP_SINK_PAD,
- PROP_LOCAL_CODECS_CONFIG,
+ PROP_CODEC_PREFERENCES,
PROP_CODECS,
PROP_CODECS_WITHOUT_CONFIG,
PROP_CURRENT_SEND_CODEC,
@@ -186,13 +186,13 @@ fs_session_class_init (FsSessionClass *klass)
G_PARAM_READABLE));
/**
- * FsSession:local-codecs-config:
+ * FsSession:codec-preferences:
*
- * This is the current configuration list for the local codecs. It is
+ * This is the current preferences list for the local codecs. It is
* set by the user to specify the codec options and priorities. The user may
- * change its value with fs_session_set_local_codecs() at any time during a
- * session. It is a #GList of #FsCodec. The user must free this codec list
- * using fs_codec_list_destroy() when done.
+ * change its value with fs_session_set_codec_preferences() at any time
+ * during a session. It is a #GList of #FsCodec.
+ * The user must free this codec list using fs_codec_list_destroy() when done.
*
* The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
* or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
@@ -200,9 +200,9 @@ fs_session_class_init (FsSessionClass *klass)
* dynamically assigned payload type.
*/
g_object_class_install_property (gobject_class,
- PROP_LOCAL_CODECS_CONFIG,
- g_param_spec_boxed ("local-codecs-config",
- "List of user configuration for local codecs",
+ PROP_CODEC_PREFERENCES,
+ g_param_spec_boxed ("codec-preferences",
+ "List of user preferences for the codecs",
"A GList of FsCodecs that allows user to set his codec options and"
" priorities",
FS_TYPE_CODEC_LIST,
@@ -216,7 +216,7 @@ fs_session_class_init (FsSessionClass *klass)
* also include any configuration parameter that must be transmitted reliably
* for the other end to decode the content.
*
- * It may change when the local-codecs-config are set, when codecs are set
+ * It may change when the codec preferences 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.
*
@@ -518,16 +518,17 @@ fs_session_set_send_codec (FsSession *session, FsCodec *send_codec,
}
/**
- * fs_session_set_local_codecs_config:
+ * fs_session_set_codec_preferences:
* @session: a #FsSession
* @local_codecs_config: a #GList of #FsCodec with the desired configuration
* @error: location of a #GError, or %NULL if no error occured
*
- * Set the list of desired codec configuration. The user may
+ * Set the list of desired codec preferences. 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 codecs and renegotiate them with the peers. It is a #GList
- * of #FsCodec. The function does not take ownership of the list.
+ * of #FsCodec. The changes are immediately effective.
+ * The function does not take ownership of the list.
*
* The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE
* or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the
@@ -540,17 +541,17 @@ fs_session_set_send_codec (FsSession *session, FsCodec *send_codec,
* Returns: %TRUE on success, %FALSE on error.
*/
gboolean
-fs_session_set_local_codecs_config (FsSession *session,
- GList *local_codecs_config,
+fs_session_set_codec_preferences (FsSession *session,
+ GList *codec_preferences,
GError **error)
{
FsSessionClass *klass = FS_SESSION_GET_CLASS (session);
- if (klass->set_local_codecs_config) {
- return klass->set_local_codecs_config (session, local_codecs_config, error);
+ if (klass->set_codec_preferences) {
+ return klass->set_codec_preferences (session, codec_preferences, error);
} else {
g_set_error (error, FS_ERROR, FS_ERROR_NOT_IMPLEMENTED,
- "set_local_codecs_config not defined in class");
+ "set_codec_preferences not defined in class");
}
return FALSE;
}
diff --git a/gst-libs/gst/farsight/fs-session.h b/gst-libs/gst/farsight/fs-session.h
index 210f503..670c592 100644
--- a/gst-libs/gst/farsight/fs-session.h
+++ b/gst-libs/gst/farsight/fs-session.h
@@ -106,8 +106,7 @@ typedef enum
* @start_telephony_event: Starts a telephony event
* @stop_telephony_event: Stops a telephony event
* @set_send_codec: Forces sending with a specific codec
- * @set_local_codecs_config: Specifies the favorite configurations for local
- * codecs
+ * @set_codec_preferences: Specifies the codec preferences
*
* You must override at least new_stream in a subclass.
*/
@@ -132,8 +131,8 @@ struct _FsSessionClass
gboolean (* set_send_codec) (FsSession *session, FsCodec *send_codec,
GError **error);
- gboolean (* set_local_codecs_config) (FsSession *session,
- GList *local_codecs_config,
+ gboolean (* set_codec_preferences) (FsSession *session,
+ GList *codec_preferences,
GError **error);
/*< private >*/
@@ -175,8 +174,8 @@ gboolean fs_session_stop_telephony_event (FsSession *session,
gboolean fs_session_set_send_codec (FsSession *session, FsCodec *send_codec,
GError **error);
-gboolean fs_session_set_local_codecs_config (FsSession *session,
- GList *local_codecs_config,
+gboolean fs_session_set_codec_preferences (FsSession *session,
+ GList *codec_preferences,
GError **error);
void fs_session_emit_error (FsSession *session, gint error_no,
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 282185f..e94130b 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -63,7 +63,7 @@ enum
PROP_MEDIA_TYPE,
PROP_ID,
PROP_SINK_PAD,
- PROP_LOCAL_CODECS_CONFIG,
+ PROP_CODEC_PREFERENCES,
PROP_CODECS,
PROP_CODECS_WITHOUT_CONFIG,
PROP_CURRENT_SEND_CODEC,
@@ -140,7 +140,7 @@ struct _FsRtpSessionPrivate
/* The static list of all the blueprints */
GList *blueprints;
- GList *local_codecs_configuration;
+ GList *codec_preferences;
/* These are protected by the session mutex */
GList *codec_associations;
@@ -190,8 +190,8 @@ static gboolean fs_rtp_session_stop_telephony_event (FsSession *session,
static gboolean fs_rtp_session_set_send_codec (FsSession *session,
FsCodec *send_codec,
GError **error);
-static gboolean fs_rtp_session_set_local_codecs_config (FsSession *session,
- GList *local_codecs_config,
+static gboolean fs_rtp_session_set_codec_preferences (FsSession *session,
+ GList *codec_preferences,
GError **error);
static gboolean fs_rtp_session_verify_send_codec_bin_locked (
FsRtpSession *self,
@@ -272,8 +272,8 @@ fs_rtp_session_class_init (FsRtpSessionClass *klass)
session_class->start_telephony_event = fs_rtp_session_start_telephony_event;
session_class->stop_telephony_event = fs_rtp_session_stop_telephony_event;
session_class->set_send_codec = fs_rtp_session_set_send_codec;
- session_class->set_local_codecs_config =
- fs_rtp_session_set_local_codecs_config;
+ session_class->set_codec_preferences =
+ fs_rtp_session_set_codec_preferences;
g_object_class_override_property (gobject_class,
PROP_MEDIA_TYPE, "media-type");
@@ -282,7 +282,7 @@ fs_rtp_session_class_init (FsRtpSessionClass *klass)
g_object_class_override_property (gobject_class,
PROP_SINK_PAD, "sink-pad");
g_object_class_override_property (gobject_class,
- PROP_LOCAL_CODECS_CONFIG, "local-codecs-config");
+ PROP_CODEC_PREFERENCES, "codec-preferences");
g_object_class_override_property (gobject_class,
PROP_CODECS, "codecs");
g_object_class_override_property (gobject_class,
@@ -560,8 +560,8 @@ fs_rtp_session_finalize (GObject *object)
g_static_rec_mutex_free (&self->mutex);
- if (self->priv->local_codecs_configuration)
- fs_codec_list_destroy (self->priv->local_codecs_configuration);
+ if (self->priv->codec_preferences)
+ fs_codec_list_destroy (self->priv->codec_preferences);
if (self->priv->codec_associations)
codec_association_list_destroy (self->priv->codec_associations);
@@ -594,8 +594,8 @@ fs_rtp_session_get_property (GObject *object,
case PROP_SINK_PAD:
g_value_set_object (value, self->priv->media_sink_pad);
break;
- case PROP_LOCAL_CODECS_CONFIG:
- g_value_set_boxed (value, self->priv->local_codecs_configuration);
+ case PROP_CODEC_PREFERENCES:
+ g_value_set_boxed (value, self->priv->codec_preferences);
break;
case PROP_CODECS:
{
@@ -1413,39 +1413,38 @@ fs_rtp_session_set_send_codec (FsSession *session, FsCodec *send_codec,
}
static gboolean
-fs_rtp_session_set_local_codecs_config (FsSession *session,
- GList *local_codecs_config,
+fs_rtp_session_set_codec_preferences (FsSession *session,
+ GList *codec_preferences,
GError **error)
{
FsRtpSession *self = FS_RTP_SESSION (session);
- GList *old_codec_configs = NULL;
- GList *new_local_codecs_configuration =
- fs_codec_list_copy (local_codecs_config);
+ GList *old_codec_prefs = NULL;
+ GList *new_codec_prefs = fs_codec_list_copy (codec_preferences);
gboolean ret;
- new_local_codecs_configuration =
+ new_codec_prefs =
validate_codecs_configuration (
self->priv->media_type, self->priv->blueprints,
- new_local_codecs_configuration);
+ new_codec_prefs);
- if (new_local_codecs_configuration == NULL)
- GST_DEBUG ("None of the local codecs configuration passed are usable,"
+ if (new_codec_prefs == NULL)
+ GST_DEBUG ("None of the new codec preferences passed are usable,"
" this will restore the original list of detected codecs");
FS_RTP_SESSION_LOCK (self);
- old_codec_configs = self->priv->local_codecs_configuration;
+ old_codec_prefs = self->priv->codec_preferences;
- self->priv->local_codecs_configuration = new_local_codecs_configuration;
+ self->priv->codec_preferences = new_codec_prefs;
ret = fs_rtp_session_update_codecs (self, NULL, NULL, error);
if (ret)
{
- fs_codec_list_destroy (old_codec_configs);
+ fs_codec_list_destroy (old_codec_prefs);
g_object_notify ((GObject*) self, "codecs");
g_object_notify ((GObject*) self, "codecs-without-config");
- g_object_notify ((GObject*) self, "local-codecs-config");
+ g_object_notify ((GObject*) self, "codec-preferences");
gst_element_post_message (GST_ELEMENT (self->priv->conference),
gst_message_new_element (GST_OBJECT (self->priv->conference),
@@ -1456,9 +1455,9 @@ fs_rtp_session_set_local_codecs_config (FsSession *session,
}
else
{
- fs_codec_list_destroy (new_local_codecs_configuration);
- self->priv->local_codecs_configuration = old_codec_configs;
- GST_WARNING ("Invalid new codec configurations");
+ fs_codec_list_destroy (new_codec_prefs);
+ self->priv->codec_preferences = old_codec_prefs;
+ GST_WARNING ("Invalid new codec preferences");
}
FS_RTP_SESSION_UNLOCK (self);
@@ -1896,7 +1895,7 @@ fs_rtp_session_negotiate_codecs (FsRtpSession *session,
has_many_streams = TRUE;
new_negotiated_codec_associations = create_local_codec_associations (
- session->priv->blueprints, session->priv->local_codecs_configuration,
+ session->priv->blueprints, session->priv->codec_preferences,
session->priv->codec_associations);
if (!new_negotiated_codec_associations)
diff --git a/python/pyfarsight.defs b/python/pyfarsight.defs
index 2d2807a..34ef27a 100644
--- a/python/pyfarsight.defs
+++ b/python/pyfarsight.defs
@@ -391,12 +391,12 @@
)
)
-(define-method set_local_codecs_config
+(define-method set_codec_preferences
(of-object "FsSession")
- (c-name "fs_session_set_local_codecs_config")
+ (c-name "fs_session_set_codec_preferences")
(return-type "gboolean")
(parameters
- '("GList*" "local_codecs_config")
+ '("GList*" "codec_preferences")
'("GError**" "error")
)
)
diff --git a/python/pyfarsight.override b/python/pyfarsight.override
index f09e140..536ae1d 100644
--- a/python/pyfarsight.override
+++ b/python/pyfarsight.override
@@ -694,9 +694,9 @@ _wrap_fs_stream_set_remote_codecs (PyGObject *self, PyObject *arg)
return PyBool_FromLong (ret);
}
%%
-override fs_session_set_local_codecs_config onearg
+override fs_session_set_codec_preferences onearg
static PyObject *
-_wrap_fs_session_set_local_codecs_config (PyGObject *self, PyObject *arg)
+_wrap_fs_session_set_codec_preferences (PyGObject *self, PyObject *arg)
{
gboolean ret = FALSE;
GError *error = NULL;
@@ -706,7 +706,7 @@ _wrap_fs_session_set_local_codecs_config (PyGObject *self, PyObject *arg)
return NULL;
Py_BEGIN_ALLOW_THREADS
- ret = fs_session_set_local_codecs_config (FS_SESSION(self->obj), codecs,
+ ret = fs_session_set_codec_preferences (FS_SESSION(self->obj), codecs,
&error);
Py_END_ALLOW_THREADS
diff --git a/tests/check/main/rtpcodecs.c b/tests/check/main/rtpcodecs.c
index 68c65d2..5fcb019 100644
--- a/tests/check/main/rtpcodecs.c
+++ b/tests/check/main/rtpcodecs.c
@@ -31,13 +31,13 @@
GMainLoop *loop = NULL;
void
-_notify_local_codecs (GObject *object, GParamSpec *param, gpointer user_data)
+_notify_codecs (GObject *object, GParamSpec *param, gpointer user_data)
{
guint *value = user_data;
*value = 1;
}
-GST_START_TEST (test_rtpcodecs_local_codecs_config)
+GST_START_TEST (test_rtpcodecs_codec_preferences)
{
struct SimpleTestConference *dat = NULL;
GList *orig_codecs = NULL, *codecs = NULL, *codecs2 = NULL, *item = NULL;
@@ -49,8 +49,8 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
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");
+ fail_unless (fs_session_set_codec_preferences (dat->session, orig_codecs,
+ &error), "Could not set local codecs as codec preferences");
g_object_get (dat->session, "codecs", &codecs, NULL);
@@ -89,26 +89,26 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
}
g_signal_connect (dat->session, "notify::codecs",
- G_CALLBACK (_notify_local_codecs), &local_codecs_notified);
+ G_CALLBACK (_notify_codecs), &local_codecs_notified);
fail_unless (
- fs_session_set_local_codecs_config (dat->session, codecs, &error),
- "Could not set local codecs config");
- fail_unless (error == NULL, "Setting the local codecs config failed,"
+ fs_session_set_codec_preferences (dat->session, codecs, &error),
+ "Could not set codec preferences");
+ fail_unless (error == NULL, "Setting the local codecs preferences failed,"
" but the error is still there");
fail_unless (local_codecs_notified == TRUE, "Not notified of codec changed");
local_codecs_notified = FALSE;
- g_object_get (dat->session, "local-codecs-config", &codecs2, NULL);
+ g_object_get (dat->session, "codec-preferences", &codecs2, NULL);
fail_unless (g_list_length (codecs2) == 2,
- "Returned list from local-codecs-config is wrong length");
+ "Returned list from codec-preferences is wrong length");
fail_unless (fs_codec_are_equal (codecs->data, codecs2->data),
- "local-codecs-config first element wrong");
+ "codec-preferences first element wrong");
fail_unless (fs_codec_are_equal (codecs->next->data, codecs2->next->data),
- "local-codecs-config second element wrong");
+ "codec-preferences second element wrong");
fs_codec_list_destroy (codecs);
fs_codec_list_destroy (codecs2);
@@ -137,8 +137,8 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
fs_codec_list_destroy (codecs);
- fail_unless (fs_session_set_local_codecs_config (dat->session, NULL, &error),
- "Could not set local-codecs-config");
+ fail_unless (fs_session_set_codec_preferences (dat->session, NULL, &error),
+ "Could not set codec-preferences");
fail_if (error, "Error set while function succeeded?");
fail_unless (local_codecs_notified, "We were not notified of the change"
" in codecs");
@@ -146,7 +146,7 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
g_object_get (dat->session, "codecs", &codecs, NULL);
fail_unless (fs_codec_list_are_equal (codecs, orig_codecs),
- "Resetting codecs-config failed, codec lists are not equal");
+ "Resetting codec-preferences failed, codec lists are not equal");
fs_codec_list_destroy (orig_codecs);
@@ -158,7 +158,7 @@ GST_START_TEST (test_rtpcodecs_local_codecs_config)
codec->id = FS_CODEC_ID_DISABLE;
}
- fail_if (fs_session_set_local_codecs_config (dat->session, codecs,
+ fail_if (fs_session_set_codec_preferences (dat->session, codecs,
&error),
"Disabling all codecs did not fail");
fail_unless (error != NULL, "The error is not set");
@@ -313,8 +313,8 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
codec_prefs = g_list_prepend (NULL, fs_codec_new (id, "reserve-pt",
FS_MEDIA_TYPE_AUDIO, 0));
- fail_unless (fs_session_set_local_codecs_config (dat->session, codec_prefs,
- NULL), "Could not set local codecs config");
+ fail_unless (fs_session_set_codec_preferences (dat->session, codec_prefs,
+ NULL), "Could not set codec preferences");
g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
@@ -359,8 +359,8 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
fail_if (item == NULL, "There is no pt %u in the negotiated codecs, "
"but there was one in the local codecs", id);
- fail_unless (fs_session_set_local_codecs_config (dat->session, codec_prefs,
- NULL), "Could not set local-codecs config after set_remote_codecs");
+ fail_unless (fs_session_set_codec_preferences (dat->session, codec_prefs,
+ NULL), "Could not set codec preferences after set_remote_codecs");
g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
@@ -374,8 +374,8 @@ GST_START_TEST (test_rtpcodecs_reserved_pt)
fs_codec_list_destroy (codecs);
- fail_unless (fs_session_set_local_codecs_config (dat->session, codec_prefs,
- NULL), "Could not re-set local-codes config after set_remote_codecs");
+ fail_unless (fs_session_set_codec_preferences (dat->session, codec_prefs,
+ NULL), "Could not re-set codec-preferences after set_remote_codecs");
g_object_get (dat->session, "codecs", &codecs, NULL);
for (item = g_list_first (codecs); item; item = g_list_next (item))
@@ -636,9 +636,9 @@ run_test_rtpcodecs_config_data (gboolean preset_remotes)
codecs = g_list_prepend (NULL, fs_codec_new (FS_CODEC_ID_ANY, "VORBIS",
FS_MEDIA_TYPE_AUDIO, 44100));
- fail_unless (fs_session_set_local_codecs_config (cd.dat->session, codecs,
+ fail_unless (fs_session_set_codec_preferences (cd.dat->session, codecs,
&error),
- "Unable to set local codecs config: %s",
+ "Unable to set codec preferences: %s",
error ? error->message : "UNKNOWN");
fs_codec_list_destroy (codecs);
@@ -752,8 +752,8 @@ fsrtpcodecs_suite (void)
g_log_set_always_fatal (fatal_mask);
- tc_chain = tcase_create ("fsrtpcodecs_local_codecs_config");
- tcase_add_test (tc_chain, test_rtpcodecs_local_codecs_config);
+ tc_chain = tcase_create ("fsrtpcodecs_codec_preferences");
+ tcase_add_test (tc_chain, test_rtpcodecs_codec_preferences);
suite_add_tcase (s, tc_chain);
tc_chain = tcase_create ("fsrtpcodecs_two_way_negotiation");
diff --git a/tests/gui/fs2-gui.py b/tests/gui/fs2-gui.py
index 96b682c..cd8bf3c 100644
--- a/tests/gui/fs2-gui.py
+++ b/tests/gui/fs2-gui.py
@@ -337,7 +337,7 @@ class FsUISession:
# We don't know if the others do work
# We know H264 doesn't work for now or anything else
# that needs to send config data
- self.fssession.set_local_codecs_config( [ \
+ self.fssession.set_codec_preferences( [ \
farsight.Codec(farsight.CODEC_ID_ANY,
"THEORA",
farsight.MEDIA_TYPE_VIDEO,
@@ -355,7 +355,7 @@ class FsUISession:
farsight.MEDIA_TYPE_VIDEO,
0)])
elif source.get_type() == farsight.MEDIA_TYPE_AUDIO:
- self.fssession.set_local_codecs_config( [ \
+ self.fssession.set_codec_preferences( [ \
farsight.Codec(farsight.CODEC_ID_ANY,
"SPEEX",
farsight.MEDIA_TYPE_AUDIO,
--
1.5.6.5
More information about the farsight-commits
mailing list