comparison libpurple/mediamanager.h @ 32771:52fb2e955198

propagate from branch 'im.pidgin.pidgin.2.x.y' (head 6ee8e5cba5c96a1f2171038180b636724b258817) to branch 'im.pidgin.pidgin' (head 92cc5e21737e6702460525c581295fdd26a2380f)
author Mark Doliner <mark@kingant.net>
date Fri, 13 Apr 2012 07:39:04 +0000
parents 98520ee78f12
children
comparison
equal deleted inserted replaced
32770:1e0ded0cb2ee 32771:52fb2e955198
35 /** The GObject class structure of the PurpleMediaManager object. */ 35 /** The GObject class structure of the PurpleMediaManager object. */
36 typedef struct _PurpleMediaManagerClass PurpleMediaManagerClass; 36 typedef struct _PurpleMediaManagerClass PurpleMediaManagerClass;
37 37
38 #include "account.h" 38 #include "account.h"
39 #include "media.h" 39 #include "media.h"
40
41 G_BEGIN_DECLS
42 40
43 #define PURPLE_TYPE_MEDIA_MANAGER (purple_media_manager_get_type()) 41 #define PURPLE_TYPE_MEDIA_MANAGER (purple_media_manager_get_type())
44 #define PURPLE_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManager)) 42 #define PURPLE_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManager))
45 #define PURPLE_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass)) 43 #define PURPLE_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass))
46 #define PURPLE_IS_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_MANAGER)) 44 #define PURPLE_IS_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_MANAGER))
47 #define PURPLE_IS_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_MANAGER)) 45 #define PURPLE_IS_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_MANAGER))
48 #define PURPLE_MEDIA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass)) 46 #define PURPLE_MEDIA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass))
49 47
50 #ifdef __cplusplus 48 G_BEGIN_DECLS
51 extern "C" {
52 #endif
53 49
54 /**************************************************************************/ 50 /**************************************************************************/
55 /** @name Media Manager API */ 51 /** @name Media Manager API */
56 /**************************************************************************/ 52 /**************************************************************************/
57 /*@{*/ 53 /*@{*/
58 54
59 /** 55 /**
60 * Gets the media manager's GType. 56 * Gets the media manager's GType.
61 * 57 *
62 * @return The media manager's GType. 58 * @return The media manager's GType.
63 *
64 * @since 2.6.0
65 */ 59 */
66 GType purple_media_manager_get_type(void); 60 GType purple_media_manager_get_type(void);
67 61
68 /** 62 /**
69 * Gets the "global" media manager object. It's created if it doesn't already exist. 63 * Gets the "global" media manager object. It's created if it doesn't already exist.
70 * 64 *
71 * @return The "global" instance of the media manager object. 65 * @return The "global" instance of the media manager object.
72 *
73 * @since 2.6.0
74 */ 66 */
75 PurpleMediaManager *purple_media_manager_get(void); 67 PurpleMediaManager *purple_media_manager_get(void);
76 68
77 /** 69 /**
78 * Creates a media session. 70 * Creates a media session.
82 * @param conference_type The conference type to feed into Farsight2. 74 * @param conference_type The conference type to feed into Farsight2.
83 * @param remote_user The remote user to initiate the session with. 75 * @param remote_user The remote user to initiate the session with.
84 * @param initiator TRUE if the local user is the initiator of this media call, FALSE otherwise. 76 * @param initiator TRUE if the local user is the initiator of this media call, FALSE otherwise.
85 * 77 *
86 * @return A newly created media session. 78 * @return A newly created media session.
87 *
88 * @since 2.6.0
89 */ 79 */
90 PurpleMedia *purple_media_manager_create_media(PurpleMediaManager *manager, 80 PurpleMedia *purple_media_manager_create_media(PurpleMediaManager *manager,
91 PurpleAccount *account, 81 PurpleAccount *account,
92 const char *conference_type, 82 const char *conference_type,
93 const char *remote_user, 83 const char *remote_user,
97 * Gets all of the media sessions. 87 * Gets all of the media sessions.
98 * 88 *
99 * @param manager The media manager to get all of the sessions from. 89 * @param manager The media manager to get all of the sessions from.
100 * 90 *
101 * @return A list of all the media sessions. 91 * @return A list of all the media sessions.
102 *
103 * @since 2.6.0
104 */ 92 */
105 GList *purple_media_manager_get_media(PurpleMediaManager *manager); 93 GList *purple_media_manager_get_media(PurpleMediaManager *manager);
106 94
107 /** 95 /**
108 * Gets all of the media sessions for a given account. 96 * Gets all of the media sessions for a given account.
109 * 97 *
110 * @param manager The media manager to get the sessions from. 98 * @param manager The media manager to get the sessions from.
111 * @param account The account the sessions are on. 99 * @param account The account the sessions are on.
112 * 100 *
113 * @return A list of the media sessions on the given account. 101 * @return A list of the media sessions on the given account.
114 *
115 * @since 2.6.0
116 */ 102 */
117 GList *purple_media_manager_get_media_by_account( 103 GList *purple_media_manager_get_media_by_account(
118 PurpleMediaManager *manager, PurpleAccount *account); 104 PurpleMediaManager *manager, PurpleAccount *account);
119 105
120 /** 106 /**
121 * Removes a media session from the media manager. 107 * Removes a media session from the media manager.
122 * 108 *
123 * @param manager The media manager to remove the media session from. 109 * @param manager The media manager to remove the media session from.
124 * @param media The media session to remove. 110 * @param media The media session to remove.
125 *
126 * @since 2.6.0
127 */ 111 */
128 void 112 void
129 purple_media_manager_remove_media(PurpleMediaManager *manager, 113 purple_media_manager_remove_media(PurpleMediaManager *manager,
130 PurpleMedia *media); 114 PurpleMedia *media);
131 115
138 * @param media Media session the output windows are registered for. 122 * @param media Media session the output windows are registered for.
139 * @param session_id The session the output windows are registered with. 123 * @param session_id The session the output windows are registered with.
140 * @param participant The participant the output windows are registered with. 124 * @param participant The participant the output windows are registered with.
141 * 125 *
142 * @return TRUE if it succeeded, FALSE if it failed. 126 * @return TRUE if it succeeded, FALSE if it failed.
143 *
144 * @since 2.6.0
145 */ 127 */
146 gboolean purple_media_manager_create_output_window( 128 gboolean purple_media_manager_create_output_window(
147 PurpleMediaManager *manager, PurpleMedia *media, 129 PurpleMediaManager *manager, PurpleMedia *media,
148 const gchar *session_id, const gchar *participant); 130 const gchar *session_id, const gchar *participant);
149 131
155 * @param session_id The session the stream is associated with. 137 * @param session_id The session the stream is associated with.
156 * @param participant The participant the stream is associated with. 138 * @param participant The participant the stream is associated with.
157 * @param window_id The window ID to embed the video in. 139 * @param window_id The window ID to embed the video in.
158 * 140 *
159 * @return A unique ID to the registered output window, 0 if it failed. 141 * @return A unique ID to the registered output window, 0 if it failed.
160 *
161 * @since 2.6.0
162 */ 142 */
163 gulong purple_media_manager_set_output_window(PurpleMediaManager *manager, 143 gulong purple_media_manager_set_output_window(PurpleMediaManager *manager,
164 PurpleMedia *media, const gchar *session_id, 144 PurpleMedia *media, const gchar *session_id,
165 const gchar *participant, gulong window_id); 145 const gchar *participant, gulong window_id);
166 146
169 * 149 *
170 * @param manager The manager the output window was registered with. 150 * @param manager The manager the output window was registered with.
171 * @param output_window_id The ID of the output window. 151 * @param output_window_id The ID of the output window.
172 * 152 *
173 * @return TRUE if it found the output window and was successful, else FALSE. 153 * @return TRUE if it found the output window and was successful, else FALSE.
174 *
175 * @since 2.6.0
176 */ 154 */
177 gboolean purple_media_manager_remove_output_window( 155 gboolean purple_media_manager_remove_output_window(
178 PurpleMediaManager *manager, gulong output_window_id); 156 PurpleMediaManager *manager, gulong output_window_id);
179 157
180 /** 158 /**
182 * 160 *
183 * @param manager The manager the output windows were registered with. 161 * @param manager The manager the output windows were registered with.
184 * @param media The media instance the output windows were registered for. 162 * @param media The media instance the output windows were registered for.
185 * @param session_id The session the output windows were registered for. 163 * @param session_id The session the output windows were registered for.
186 * @param participant The participant the output windows were registered for. 164 * @param participant The participant the output windows were registered for.
187 *
188 * @since 2.6.0
189 */ 165 */
190 void purple_media_manager_remove_output_windows( 166 void purple_media_manager_remove_output_windows(
191 PurpleMediaManager *manager, PurpleMedia *media, 167 PurpleMediaManager *manager, PurpleMedia *media,
192 const gchar *session_id, const gchar *participant); 168 const gchar *session_id, const gchar *participant);
193 169
194 /** 170 /**
195 * Sets which media caps the UI supports. 171 * Sets which media caps the UI supports.
196 * 172 *
197 * @param manager The manager to set the caps on. 173 * @param manager The manager to set the caps on.
198 * @param caps The caps to set. 174 * @param caps The caps to set.
199 *
200 * @since 2.6.0
201 */ 175 */
202 void purple_media_manager_set_ui_caps(PurpleMediaManager *manager, 176 void purple_media_manager_set_ui_caps(PurpleMediaManager *manager,
203 PurpleMediaCaps caps); 177 PurpleMediaCaps caps);
204 178
205 /** 179 /**
206 * Gets which media caps the UI supports. 180 * Gets which media caps the UI supports.
207 * 181 *
208 * @param manager The manager to get caps from. 182 * @param manager The manager to get caps from.
209 * 183 *
210 * @return caps The caps retrieved. 184 * @return caps The caps retrieved.
211 *
212 * @since 2.6.0
213 */ 185 */
214 PurpleMediaCaps purple_media_manager_get_ui_caps(PurpleMediaManager *manager); 186 PurpleMediaCaps purple_media_manager_get_ui_caps(PurpleMediaManager *manager);
215 187
216 /** 188 /**
217 * Sets which media backend type media objects will use. 189 * Sets which media backend type media objects will use.
218 * 190 *
219 * @param manager The manager to set the caps on. 191 * @param manager The manager to set the caps on.
220 * @param backend_type The media backend type to use. 192 * @param backend_type The media backend type to use.
221 *
222 * @since 2.7.0
223 */ 193 */
224 void purple_media_manager_set_backend_type(PurpleMediaManager *manager, 194 void purple_media_manager_set_backend_type(PurpleMediaManager *manager,
225 GType backend_type); 195 GType backend_type);
226 196
227 /** 197 /**
228 * Gets which media backend type media objects will use. 198 * Gets which media backend type media objects will use.
229 * 199 *
230 * @param manager The manager to get the media backend type from. 200 * @param manager The manager to get the media backend type from.
231 * 201 *
232 * @return The type of media backend type media objects will use. 202 * @return The type of media backend type media objects will use.
233 *
234 * @since 2.7.0
235 */ 203 */
236 GType purple_media_manager_get_backend_type(PurpleMediaManager *manager); 204 GType purple_media_manager_get_backend_type(PurpleMediaManager *manager);
237 205
238 /*}@*/ 206 /*}@*/
239 207
240 #ifdef __cplusplus
241 }
242 #endif
243
244 G_END_DECLS 208 G_END_DECLS
245 209
246 #endif /* _PURPLE_MEDIA_MANAGER_H_ */ 210 #endif /* _PURPLE_MEDIA_MANAGER_H_ */