libpurple/protocols/jabber/jingle.h

Fri, 23 May 2008 02:42:32 +0000

author
Michael Ruprecht <maiku@pidgin.im>
date
Fri, 23 May 2008 02:42:32 +0000
branch
soc.2008.vv
changeset 23697
299bafcd8eb8
parent 22649
d29483a90e40
child 23698
0815965bd80b
permissions
-rw-r--r--

Updates voice and video to use Farsight 2, gets XMPP voice conferences
closer to XEP-0167, and fixes a lot of bugs.

22649
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
1 /*
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
2 * This program is free software; you can redistribute it and/or modify
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
3 * it under the terms of the GNU General Public License as published by
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
4 * the Free Software Foundation; either version 2 of the License, or
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
5 * (at your option) any later version.
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
6 *
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
7 * This program is distributed in the hope that it will be useful,
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
10 * GNU Library General Public License for more details.
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
11 *
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
12 * You should have received a copy of the GNU General Public License
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
13 * along with this program; if not, write to the Free Software
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
15 */
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
16
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
17 #ifndef JINGLE_H
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
18 #define JINGLE_H
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
19
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
20 #include "config.h"
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
21 #include "jabber.h"
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
22 #include "media.h"
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
23
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
24 #include <glib.h>
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
25 #include <glib-object.h>
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
26
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
27 #ifdef USE_FARSIGHT
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
28
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
29 G_BEGIN_DECLS
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
30
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
31 typedef struct {
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
32 char *id;
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
33 JabberStream *js;
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
34 PurpleMedia *media;
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
35 char *remote_jid;
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
36 char *initiator;
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
37 gboolean is_initiator;
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22649
diff changeset
38 gboolean session_started;
22649
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
39 } JingleSession;
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
40
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
41 JingleSession *jabber_jingle_session_create(JabberStream *js);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
42 JingleSession *jabber_jingle_session_create_by_id(JabberStream *js,
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
43 const char *id);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
44
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
45 const char *jabber_jingle_session_get_id(const JingleSession *sess);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
46 JabberStream *jabber_jingle_session_get_js(const JingleSession *sess);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
47
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
48 void jabber_jingle_session_destroy(JingleSession *sess);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
49
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
50 JingleSession *jabber_jingle_session_find_by_id(const char *id);
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22649
diff changeset
51 GList *jabber_jingle_session_find_by_js(JabberStream *js);
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22649
diff changeset
52 JingleSession *jabber_jingle_session_find_by_jid(JabberStream *js, const char *jid);
22649
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
53
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
54 PurpleMedia *jabber_jingle_session_get_media(const JingleSession *sess);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
55 void jabber_jingle_session_set_media(JingleSession *sess, PurpleMedia *media);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
56
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
57 const char *jabber_jingle_session_get_remote_jid(const JingleSession *sess);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
58
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
59 gboolean jabber_jingle_session_is_initiator(const JingleSession *sess);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
60
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
61 void jabber_jingle_session_set_remote_jid(JingleSession *sess,
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
62 const char *remote_jid);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
63
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
64 const char *jabber_jingle_session_get_initiator(const JingleSession *sess);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
65 void jabber_jingle_session_set_initiator(JingleSession *sess,
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
66 const char *initiator);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
67
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
68 xmlnode *jabber_jingle_session_create_terminate(const JingleSession *sess,
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
69 const char *reasoncode,
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
70 const char *reasontext);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
71 xmlnode *jabber_jingle_session_create_session_accept(const JingleSession *sess);
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22649
diff changeset
72 xmlnode *jabber_jingle_session_create_transport_info(const JingleSession *sess);
22649
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
73 xmlnode *jabber_jingle_session_create_content_replace(const JingleSession *sess,
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22649
diff changeset
74 FsCandidate *native_candidate,
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22649
diff changeset
75 FsCandidate *remote_candidate);
22649
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
76 xmlnode *jabber_jingle_session_create_content_accept(const JingleSession *sess);
23697
299bafcd8eb8 Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents: 22649
diff changeset
77 xmlnode *jabber_jingle_session_create_description(const JingleSession *sess);
22649
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
78
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
79 /**
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
80 * Gets a list of Farsight codecs from a Jingle <description> tag
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
81 *
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
82 * @param description
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
83 * @return A GList of FarsightCodecS
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
84 */
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
85 GList *jabber_jingle_get_codecs(const xmlnode *description);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
86
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
87 GList *jabber_jingle_get_candidates(const xmlnode *transport);
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
88
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
89 G_END_DECLS
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
90
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
91 #endif /* USE_FARSIGHT */
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
92
d29483a90e40 Add the new jingle.c/h files.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff changeset
93 #endif /* JINGLE_H */

mercurial