6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "sipe-media.h"
28 PurpleMediaSessionType
sipe_media_to_purple(SipeMediaType type
)
31 case SIPE_MEDIA_AUDIO
: return PURPLE_MEDIA_AUDIO
;
32 case SIPE_MEDIA_VIDEO
: return PURPLE_MEDIA_VIDEO
;
33 default: return PURPLE_MEDIA_NONE
;
37 /*SipeMediaType purple_media_to_sipe(PurpleMediaSessionType type)
40 case PURPLE_MEDIA_AUDIO: return SIPE_MEDIA_AUDIO;
41 case PURPLE_MEDIA_VIDEO: return SIPE_MEDIA_VIDEO;
42 default: return SIPE_MEDIA_AUDIO;
47 sipe_backend_codec_new(int id
, const char *name
, SipeMediaType type
, guint clock_rate
)
49 return (sipe_codec
*)purple_media_codec_new(id
, name
,
50 sipe_media_to_purple(type
), clock_rate
);
54 sipe_backend_codec_free(sipe_codec
*codec
)
56 g_object_unref(codec
);
60 sipe_backend_codec_get_name(sipe_codec
*codec
)
62 return purple_media_codec_get_encoding_name((PurpleMediaCodec
*)codec
);
65 gboolean
sipe_backend_set_remote_codecs(struct _sipe_media_call
* call
, gchar
* participant
)
67 PurpleMedia
*media
= call
->media
;
68 GList
*codecs
= call
->remote_codecs
;
70 return purple_media_set_remote_codecs(media
, "sipe-voice", participant
, codecs
);
73 GList
* sipe_backend_get_local_codecs(struct _sipe_media_call
* call
)
75 return purple_media_get_codecs(call
->media
, "sipe-voice");