Mercurial > pidgin
annotate src/media.h @ 12810:b0ede7907dd0
[gaim-migrate @ 15158]
Improve the handling of SRV results. If we get a result, use the specified port; if you want to manually specify the port, you need to manually specify the connect server and not do the SRV lookup at all. This was discussed in #gaim last night.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 10 Jan 2006 20:39:47 +0000 |
parents | fee6a32644a4 |
children |
rev | line source |
---|---|
12024 | 1 /** |
2 * @file media.h Voice and Video API | |
3 * @ingroup core | |
4 * | |
5 * gaim | |
6 * | |
7 * Gaim is the legal property of its developers, whose names are too numerous | |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
10 * | |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
25 #ifndef _GAIM_MEDIA_H_ | |
26 #define _GAIM_MEDIA_H_ | |
27 | |
28 typedef struct _GaimVoiceChat GaimVoiceChat; | |
29 typedef struct _GaimMediaPrplOps GaimMediaPrplOps; | |
30 | |
31 #include "connection.h" | |
32 | |
12050 | 33 /* Forward declarations so I needn't #include mediastreamer headers in |
12024 | 34 * nearly every single file */ |
35 struct _MSFilter; | |
36 struct _MSSync; | |
37 | |
38 /** | |
39 * The state of a VoiceChat that should be reflected in the UI | |
40 */ | |
41 typedef enum { | |
42 GAIM_MEDIA_STATE_CALLING, /**< An outgoing call is waiting to be answered */ | |
43 GAIM_MEDIA_STATE_RECEIVING, /**< An incoming call is waiting to be answered */ | |
44 GAIM_MEDIA_STATE_IN_PROGRESS, /**< The call is connected */ | |
45 GAIM_MEDIA_STATE_ERROR, /**< Some error occured */ | |
46 } GaimMediaState; | |
47 | |
48 /** | |
49 * UI Operations | |
50 */ | |
51 typedef struct { | |
52 void (*new_voice_chat)(GaimVoiceChat *vc); /**< A new voice chat is created */ | |
53 void (*destroy)(GaimVoiceChat *vc); /**< The voice chat has been destroyed */ | |
54 void (*state_change)(GaimVoiceChat *vc, GaimMediaState state); /**< The state of the voice chat has changed */ | |
55 } GaimMediaUiOps; | |
56 | |
57 /** | |
58 * PRPL Operations | |
59 */ | |
60 struct _GaimMediaPrplOps { | |
61 void (*call)(GaimConnection *gc, const char *who); /**< Request an outgoing call to 'who' */ | |
62 void (*init_filters)(GaimVoiceChat *); /**< Create the media stream for the call */ | |
63 void (*accept)(GaimVoiceChat *); /**< Accept an incoming call */ | |
64 void (*reject)(GaimVoiceChat *); /**< Reject an incoming call */ | |
65 void (*terminate)(GaimVoiceChat *); /**< Terminate an in-progress call */ | |
66 }; | |
67 | |
68 #ifdef HAVE_VV | |
69 | |
70 /** | |
71 * Initializes mediastreamer and ortp | |
72 */ | |
73 void gaim_media_init(void); | |
74 | |
75 /**************************************************************************/ | |
76 /** @name Voice Chat API **************************************************/ | |
77 /**************************************************************************/ | |
78 /*@{*/ | |
79 | |
80 /** | |
81 * Creates a new voice chat | |
82 * This function creates a new voice chat object, and tells the UI about it. The UI | |
83 * probably won't want to do anything, until the state is changed to Incoming or Outgoing, | |
84 * but the UI should initialize any data structures it needs on this call | |
85 * | |
86 * @param gc The connection this chat is happening on | |
87 * @param name The person on the other end of the call | |
88 * @return The new voice chat | |
89 */ | |
90 GaimVoiceChat *gaim_voice_chat_new(GaimConnection *gc, const char *name); | |
91 | |
92 /** | |
93 * Destroys a voice chat | |
94 * | |
95 * @param vc The voice chat to destroy | |
96 */ | |
97 void gaim_voice_chat_destroy(GaimVoiceChat *vc); | |
98 | |
99 /** | |
12629
fee6a32644a4
[gaim-migrate @ 14965]
Richard Laager <rlaager@wiktel.com>
parents:
12627
diff
changeset
|
100 * Accessor function to get the name of the other user on the voice chat |
12024 | 101 * |
102 * @param vc The voice chat | |
103 * @return The name | |
104 */ | |
105 const char *gaim_voice_chat_get_name(GaimVoiceChat *vc); | |
106 | |
107 /** | |
12629
fee6a32644a4
[gaim-migrate @ 14965]
Richard Laager <rlaager@wiktel.com>
parents:
12627
diff
changeset
|
108 * Accessor function to set the name of the other user on the voice chat |
12627 | 109 * |
110 * @param vc The voice chat | |
111 * @return The name | |
112 */ | |
113 void gaim_voice_chat_set_name(GaimVoiceChat *vc, const char *name); | |
114 | |
115 /** | |
12024 | 116 * Accessor for the GaimConnection of the voice chat |
117 * | |
118 * @param vc The voice chat | |
119 * @return The GaimConnection | |
120 */ | |
121 GaimConnection *gaim_voice_chat_get_connection(GaimVoiceChat *vc); | |
122 | |
123 /** | |
124 * Accessor for the UI data | |
125 * | |
126 * @param vc The voice chat | |
127 * @return The UI data | |
128 */ | |
129 void *gaim_voice_chat_get_ui_data(GaimVoiceChat *vc); | |
130 | |
131 /** | |
132 * Mutator for the UI Data | |
133 * | |
134 * @param vc The voice chat | |
135 * @param data The data | |
136 */ | |
137 void gaim_voice_chat_set_ui_data(GaimVoiceChat *vc, void *data); | |
138 | |
139 /** | |
140 * Accessor for the protocol data | |
141 * | |
142 * @param vc The voice chat | |
143 * @return The protocol data | |
144 */ | |
145 void *gaim_voice_chat_get_proto_data(GaimVoiceChat *vc); | |
146 | |
147 /** | |
148 * Mutator for the protocol data | |
149 * | |
150 * @param vc The voice chat | |
151 * @param data The protocol data | |
152 */ | |
153 void gaim_voice_chat_set_proto_data(GaimVoiceChat *vc, void *data); | |
154 | |
155 /** | |
156 * Accessor for the state | |
157 * | |
158 * @param vc The voice chat | |
159 * @return The state | |
160 */ | |
161 GaimMediaState gaim_voice_chat_get_state(GaimVoiceChat *vc); | |
162 | |
163 /** | |
164 * Mutator for the state | |
165 * | |
166 * @param vc The voice chat | |
12050 | 167 * @param state The state |
12024 | 168 */ |
169 void gaim_voice_chat_set_state(GaimVoiceChat *vc, GaimMediaState state); | |
170 | |
171 /** | |
172 * Accepts an incoming voice chat | |
173 * | |
174 * @param vc The voice chat | |
175 */ | |
176 void gaim_voice_chat_accept(GaimVoiceChat *vc); | |
177 | |
178 /** | |
179 * Rejects an incoming voice chat | |
180 * | |
181 * @param vc The voice chat | |
182 */ | |
183 void gaim_voice_chat_reject(GaimVoiceChat *vc); | |
184 | |
185 /** | |
186 * Terminates an in-progress voice chat | |
187 * | |
188 * @param vc The voice chat | |
189 */ | |
190 void gaim_voice_chat_terminate(GaimVoiceChat *vc); | |
191 | |
192 /** | |
193 * Accessor for the microphone and speaker MSFilter objects | |
194 * | |
195 * @param vc The voice chat | |
196 * @param microphone A pointer to return the microphone filter in, or NULL. | |
197 * @param speaker A poitner to reutrn the speaker filter in, or NULL. | |
198 */ | |
199 void gaim_voice_chat_get_filters(GaimVoiceChat *vc, struct _MSFilter **microphone, struct _MSFilter **speaker); | |
200 | |
201 /** | |
202 * Accessor for the Mediastreamer timer | |
203 * | |
204 * @param vc The voice chat | |
205 * @return The timer | |
206 */ | |
207 struct _MSSync *gaim_voice_chat_get_timer(GaimVoiceChat *vc); | |
208 | |
12627 | 209 /** |
210 * Start the streams | |
211 * | |
212 * @param vc The voice chat | |
213 */ | |
214 void gaim_voice_chat_start_streams(GaimVoiceChat *vc); | |
215 | |
12024 | 216 /*@}*/ |
217 | |
218 /**************************************************************************/ | |
219 /** @name UI Registration Functions */ | |
220 /**************************************************************************/ | |
221 /*@{*/ | |
222 | |
223 /** | |
224 * Sets the UI operations structure to be used for the buddy list. | |
225 * | |
226 * @param ops The ops struct. | |
227 */ | |
228 void gaim_media_set_ui_ops(GaimMediaUiOps *ops); | |
229 | |
230 /** | |
231 * Returns the UI operations structure to be used for the buddy list. | |
232 * | |
233 * @return The UI operations structure. | |
234 */ | |
235 GaimMediaUiOps *gaim_media_get_ui_ops(void); | |
236 | |
237 /*@}*/ | |
238 | |
239 #endif /* HAVE_VV */ | |
240 | |
241 #endif /* _GAIM_MEDIA_H_ */ |