diff options
author | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2009-07-10 22:21:16 +0800 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@collabora.co.uk> | 2009-08-07 01:24:39 +0800 |
commit | b1642e68a321a80d7557863409455375906c14ba (patch) | |
tree | 56f6589a7645fda471836feab160c17c80702d24 /libempathy | |
parent | 2fe171b03ebf6e2a4f726e456527cacafa1c4194 (diff) | |
download | gsoc2013-empathy-b1642e68a321a80d7557863409455375906c14ba.tar gsoc2013-empathy-b1642e68a321a80d7557863409455375906c14ba.tar.gz gsoc2013-empathy-b1642e68a321a80d7557863409455375906c14ba.tar.bz2 gsoc2013-empathy-b1642e68a321a80d7557863409455375906c14ba.tar.lz gsoc2013-empathy-b1642e68a321a80d7557863409455375906c14ba.tar.xz gsoc2013-empathy-b1642e68a321a80d7557863409455375906c14ba.tar.zst gsoc2013-empathy-b1642e68a321a80d7557863409455375906c14ba.zip |
Put codec preferences in a configuration file
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-call-handler.c | 53 |
1 files changed, 12 insertions, 41 deletions
diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c index f73c41e2e..4565ec10b 100644 --- a/libempathy/empathy-call-handler.c +++ b/libempathy/empathy-call-handler.c @@ -427,53 +427,24 @@ empathy_call_handler_tf_channel_closed_cb (TfChannel *tfchannel, } static GList * -empathy_call_handler_tf_channel_codec_config_get_defaults (FsCodec *codecs) -{ - GList *l = NULL; - int i; - - for (i = 0; codecs[i].encoding_name != NULL; i++) - l = g_list_append (l, fs_codec_copy (codecs + i)); - - return l; -} - -static GList * empathy_call_handler_tf_channel_codec_config_cb (TfChannel *channel, guint stream_id, FsMediaType media_type, guint direction, gpointer user_data) { - FsCodec audio_codecs[] = { - { FS_CODEC_ID_ANY, "SPEEX", FS_MEDIA_TYPE_AUDIO, 16000, }, - { FS_CODEC_ID_ANY, "SPEEX", FS_MEDIA_TYPE_AUDIO, 8000, }, - - { FS_CODEC_ID_DISABLE, "DV", FS_MEDIA_TYPE_AUDIO, }, - { FS_CODEC_ID_DISABLE, "MPA", FS_MEDIA_TYPE_AUDIO, }, - { FS_CODEC_ID_DISABLE, "VORBIS", FS_MEDIA_TYPE_AUDIO, }, - { FS_CODEC_ID_DISABLE, "MP3", FS_MEDIA_TYPE_AUDIO, }, - { 0, NULL, 0,} - }; - FsCodec video_codecs[] = { - { FS_CODEC_ID_ANY, "H264", FS_MEDIA_TYPE_VIDEO, }, - { FS_CODEC_ID_ANY, "THEORA", FS_MEDIA_TYPE_VIDEO, }, - { FS_CODEC_ID_ANY, "H263", FS_MEDIA_TYPE_VIDEO, }, - - { FS_CODEC_ID_DISABLE, "DV", FS_MEDIA_TYPE_VIDEO, }, - { FS_CODEC_ID_DISABLE, "JPEG", FS_MEDIA_TYPE_VIDEO, }, - { FS_CODEC_ID_DISABLE, "MPV", FS_MEDIA_TYPE_VIDEO, }, - { 0, NULL, 0} - }; - - switch (media_type) + gchar *filename = empathy_file_lookup ("codec-preferences", "data"); + GList *codecs; + GError *error = NULL; + + codecs = fs_codec_list_from_keyfile (filename, &error); + g_free (filename); + + if (!codecs) { - case FS_MEDIA_TYPE_AUDIO: - return empathy_call_handler_tf_channel_codec_config_get_defaults - (audio_codecs); - case FS_MEDIA_TYPE_VIDEO: - return empathy_call_handler_tf_channel_codec_config_get_defaults - (video_codecs); + g_warning ("No codec-preferences file: %s", + error ? error->message : "No error message"); } + g_clear_error (&error); - return NULL; + return codecs; } static void |