mediamanager.h
Go to the documentation of this file.
1
6 /* purple
7 *
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26
27 #ifndef _PURPLE_MEDIA_MANAGER_H_
28 #define _PURPLE_MEDIA_MANAGER_H_
29
30 #include <glib.h>
31 #include <glib-object.h>
32
34 typedef struct _PurpleMediaManager PurpleMediaManager;
36 typedef struct _PurpleMediaManagerClass PurpleMediaManagerClass;
37
38 #include "account.h"
39 #include "media.h"
40
57 typedef struct {
58 void (*readable) (PurpleMediaManager *manager, PurpleMedia *media,
59 const gchar *session_id, const gchar *participant, gpointer user_data);
60 void (*writable) (PurpleMediaManager *manager, PurpleMedia *media,
61 const gchar *session_id, const gchar *participant, gboolean writable,
62 gpointer user_data);
63 } PurpleMediaAppDataCallbacks;
64
65 G_BEGIN_DECLS
66
67 #define PURPLE_TYPE_MEDIA_MANAGER (purple_media_manager_get_type())
68 #define PURPLE_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManager))
69 #define PURPLE_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass))
70 #define PURPLE_IS_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_MANAGER))
71 #define PURPLE_IS_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_MANAGER))
72 #define PURPLE_MEDIA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass))
73
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77
78 /**************************************************************************/
80 /**************************************************************************/
90 GType purple_media_manager_get_type(void);
91
99 PurpleMediaManager *purple_media_manager_get(void);
100
114 PurpleMedia *purple_media_manager_create_media(PurpleMediaManager *manager,
115 PurpleAccount *account,
116 const char *conference_type,
117 const char *remote_user,
118 gboolean initiator);
119
129 GList *purple_media_manager_get_media(PurpleMediaManager *manager);
130
141 GList *purple_media_manager_get_media_by_account(
142 PurpleMediaManager *manager, PurpleAccount *account);
143
152 void
153 purple_media_manager_remove_media(PurpleMediaManager *manager,
154 PurpleMedia *media);
155
175 PurpleMedia *purple_media_manager_create_private_media(
176 PurpleMediaManager *manager,
177 PurpleAccount *account,
178 const char *conference_type,
179 const char *remote_user,
180 gboolean initiator);
181
191 GList *purple_media_manager_get_private_media(PurpleMediaManager *manager);
192
203 GList *purple_media_manager_get_private_media_by_account(
204 PurpleMediaManager *manager, PurpleAccount *account);
205
220 gboolean purple_media_manager_create_output_window(
221 PurpleMediaManager *manager, PurpleMedia *media,
222 const gchar *session_id, const gchar *participant);
223
237 gulong purple_media_manager_set_output_window(PurpleMediaManager *manager,
238 PurpleMedia *media, const gchar *session_id,
239 const gchar *participant, gulong window_id);
240
251 gboolean purple_media_manager_remove_output_window(
252 PurpleMediaManager *manager, gulong output_window_id);
253
264 void purple_media_manager_remove_output_windows(
265 PurpleMediaManager *manager, PurpleMedia *media,
266 const gchar *session_id, const gchar *participant);
267
276 void purple_media_manager_set_ui_caps(PurpleMediaManager *manager,
277 PurpleMediaCaps caps);
278
288 PurpleMediaCaps purple_media_manager_get_ui_caps(PurpleMediaManager *manager);
289
298 void purple_media_manager_set_backend_type(PurpleMediaManager *manager,
299 GType backend_type);
300
310 GType purple_media_manager_get_backend_type(PurpleMediaManager *manager);
311
325 void purple_media_manager_set_application_data_callbacks(
326 PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id,
327 const gchar *participant, PurpleMediaAppDataCallbacks *callbacks,
328 gpointer user_data, GDestroyNotify notify);
329
351 gint purple_media_manager_send_application_data (
352 PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id,
353 const gchar *participant, gpointer buffer, guint size, gboolean blocking);
354
372 gint purple_media_manager_receive_application_data (
373 PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id,
374 const gchar *participant, gpointer buffer, guint max_size,
375 gboolean blocking);
376
377 /*}@*/
378
379 #ifdef __cplusplus
380 }
381 #endif
382
383 G_END_DECLS
384
385 #endif /* _PURPLE_MEDIA_MANAGER_H_ */
purple_media_manager_get
PurpleMediaManager * purple_media_manager_get(void)
Gets the "global" media manager object.
purple_media_manager_get_private_media_by_account
GList * purple_media_manager_get_private_media_by_account(PurpleMediaManager *manager, PurpleAccount *account)
Gets all of the private media sessions for a given account.
purple_media_manager_get_ui_caps
PurpleMediaCaps purple_media_manager_get_ui_caps(PurpleMediaManager *manager)
Gets which media caps the UI supports.
purple_media_manager_send_application_data
gint purple_media_manager_send_application_data(PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id, const gchar *participant, gpointer buffer, guint size, gboolean blocking)
purple_media_manager_send_application_data: : The manager to send data with.
purple_media_manager_get_backend_type
GType purple_media_manager_get_backend_type(PurpleMediaManager *manager)
Gets which media backend type media objects will use.
purple_media_manager_set_application_data_callbacks
void purple_media_manager_set_application_data_callbacks(PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id, const gchar *participant, PurpleMediaAppDataCallbacks *callbacks, gpointer user_data, GDestroyNotify notify)
purple_media_manager_set_application_data_callbacks: : The manager to register the callbacks with...
purple_media_manager_remove_output_window
gboolean purple_media_manager_remove_output_window(PurpleMediaManager *manager, gulong output_window_id)
Remove a previously registerd output window.
media.h
Media API.
_PurpleAccount
Structure representing an account.
Definition: account.h:169
purple_media_manager_set_backend_type
void purple_media_manager_set_backend_type(PurpleMediaManager *manager, GType backend_type)
Sets which media backend type media objects will use.
PurpleMediaManager
struct _PurpleMediaManager PurpleMediaManager
An opaque structure representing a group of (usually all) media calls.
Definition: mediamanager.h:34
PurpleMediaAppDataCallbacks
PurpleMediaAppDataCallbacks: : Called when the stream has received data and is readable.
Definition: mediamanager.h:57
purple_media_manager_create_private_media
PurpleMedia * purple_media_manager_create_private_media(PurpleMediaManager *manager, PurpleAccount *account, const char *conference_type, const char *remote_user, gboolean initiator)
Creates a private media session.
PurpleMedia
struct _PurpleMedia PurpleMedia
An opaque structure representing a media call.
Definition: media.h:47
account.h
Account API.
purple_media_manager_get_private_media
GList * purple_media_manager_get_private_media(PurpleMediaManager *manager)
Gets all of the private media sessions.
purple_media_manager_remove_media
void purple_media_manager_remove_media(PurpleMediaManager *manager, PurpleMedia *media)
Removes a media session from the media manager.
purple_media_manager_get_type
GType purple_media_manager_get_type(void)
Gets the media manager&#39;s GType.
purple_media_manager_get_media_by_account
GList * purple_media_manager_get_media_by_account(PurpleMediaManager *manager, PurpleAccount *account)
Gets all of the media sessions for a given account.
purple_media_manager_remove_output_windows
void purple_media_manager_remove_output_windows(PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id, const gchar *participant)
Remove all output windows for a given conference/session/participant/stream.
purple_media_manager_receive_application_data
gint purple_media_manager_receive_application_data(PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id, const gchar *participant, gpointer buffer, guint max_size, gboolean blocking)
purple_media_manager_receive_application_data: : The manager to receive data with.
purple_media_manager_set_output_window
gulong purple_media_manager_set_output_window(PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id, const gchar *participant, gulong window_id)
Registers a video output window to be created for a given stream.
purple_media_manager_create_media
PurpleMedia * purple_media_manager_create_media(PurpleMediaManager *manager, PurpleAccount *account, const char *conference_type, const char *remote_user, gboolean initiator)
Creates a media session.
purple_media_manager_get_media
GList * purple_media_manager_get_media(PurpleMediaManager *manager)
Gets all of the media sessions.
PurpleMediaManagerClass
struct _PurpleMediaManagerClass PurpleMediaManagerClass
The GObject class structure of the PurpleMediaManager object.
Definition: mediamanager.h:36
purple_media_manager_set_ui_caps
void purple_media_manager_set_ui_caps(PurpleMediaManager *manager, PurpleMediaCaps caps)
Sets which media caps the UI supports.
purple_media_manager_create_output_window
gboolean purple_media_manager_create_output_window(PurpleMediaManager *manager, PurpleMedia *media, const gchar *session_id, const gchar *participant)
Signals that output windows should be created for the chosen stream.