audio: start of removing purple specific code from core
[siplcs.git] / src / api / sipe-media.h
blobc6365da8caf853589eae494546f95d0cb2fbf309
1 /**
2 * @file sipe-media.h
4 * pidgin-sipe
6 * Copyright (C) 2010 Jakub Adam <jakub.adam@tieto.com>
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
23 struct sipe_account_data;
25 typedef enum sipe_media_type {
26 SIPE_MEDIA_AUDIO,
27 SIPE_MEDIA_VIDEO
28 } SipeMediaType;
30 typedef enum sipe_call_state {
31 SIPE_CALL_CONNECTING,
32 SIPE_CALL_RUNNING,
33 SIPE_CALL_HELD,
34 SIPE_CALL_FINISHED
35 } SipeCallState;
37 typedef gpointer sipe_codec;
39 typedef struct _sipe_media_call {
40 gpointer media;
41 struct sip_session *session;
42 struct sip_dialog *dialog;
44 gchar *remote_ip;
45 guint16 remote_port;
47 GSList *sdp_attrs;
48 struct sipmsg *invitation;
49 GList *remote_candidates;
50 GList *remote_codecs;
51 gchar *sdp_response;
52 gboolean legacy_mode;
53 SipeCallState state;
54 } sipe_media_call;
56 void sipe_media_incoming_invite(struct sipe_account_data *sip, struct sipmsg *msg);
58 void sipe_media_hangup(struct sipe_account_data *sip);
60 gchar *sipe_media_get_callid(sipe_media_call *call);
63 /* Backend functions **********************************************************/
65 sipe_codec * sipe_backend_codec_new(int id, const char *name,
66 SipeMediaType type, guint clock_rate);
68 void sipe_backend_codec_free(sipe_codec *codec);
70 gchar * sipe_backend_codec_get_name(sipe_codec *codec);
73 gboolean sipe_backend_set_remote_codecs(sipe_media_call* call, gchar* participant);
75 GList* sipe_backend_get_local_codecs(sipe_media_call* call);