media.h

Go to the documentation of this file.
00001 
00006 /* purple
00007  *
00008  * Purple is the legal property of its developers, whose names are too numerous
00009  * to list here.  Please refer to the COPYRIGHT file distributed with this
00010  * source distribution.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
00025  */
00026 
00027 #ifndef _PURPLE_MEDIA_H_
00028 #define _PURPLE_MEDIA_H_
00029 
00030 #include "media/candidate.h"
00031 #include "media/codec.h"
00032 #include "media/enum-types.h"
00033 
00034 #include <glib.h>
00035 #include <glib-object.h>
00036 
00037 G_BEGIN_DECLS
00038 
00039 #define PURPLE_TYPE_MEDIA            (purple_media_get_type())
00040 #define PURPLE_MEDIA(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia))
00041 #define PURPLE_MEDIA_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass))
00042 #define PURPLE_IS_MEDIA(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA))
00043 #define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA))
00044 #define PURPLE_MEDIA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
00045 
00047 typedef struct _PurpleMedia PurpleMedia;
00048 
00049 #include "signals.h"
00050 #include "util.h"
00051 
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055 
00063 GType purple_media_get_type(void);
00064 
00074 GList *purple_media_get_session_ids(PurpleMedia *media);
00075 
00085 PurpleAccount *purple_media_get_account(PurpleMedia *media);
00086 
00096 gpointer purple_media_get_prpl_data(PurpleMedia *media);
00097 
00106 void purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data);
00107 
00117 void purple_media_error(PurpleMedia *media, const gchar *error, ...);
00118 
00128 void purple_media_end(PurpleMedia *media, const gchar *session_id,
00129         const gchar *participant);
00130 
00142 void purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type,
00143         const gchar *session_id, const gchar *participant,
00144         gboolean local);
00145 
00165 gboolean purple_media_add_stream(PurpleMedia *media, const gchar *sess_id,
00166         const gchar *who, PurpleMediaSessionType type,
00167         gboolean initiator, const gchar *transmitter,
00168         guint num_params, GParameter *params);
00169 
00180 PurpleMediaSessionType purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id);
00181 
00191 struct _PurpleMediaManager *purple_media_get_manager(PurpleMedia *media);
00192 
00203 GList *purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id);
00204 
00215 void purple_media_add_remote_candidates(PurpleMedia *media,
00216                     const gchar *sess_id,
00217                     const gchar *participant,
00218                     GList *remote_candidates);
00219 
00229 GList *purple_media_get_local_candidates(PurpleMedia *media,
00230                      const gchar *sess_id,
00231                      const gchar *participant);
00232 
00233 #if 0
00234 /*
00235  * These two functions aren't being used and I'd rather not lock in the API
00236  * until they are needed. If they ever are.
00237  */
00238 
00249 GList *purple_media_get_active_local_candidates(PurpleMedia *media,
00250         const gchar *sess_id, const gchar *participant);
00251 
00262 GList *purple_media_get_active_remote_candidates(PurpleMedia *media,
00263         const gchar *sess_id, const gchar *participant);
00264 #endif
00265 
00278 gboolean purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id,
00279                     const gchar *participant, GList *codecs);
00280 
00292 gboolean purple_media_candidates_prepared(PurpleMedia *media,
00293         const gchar *session_id, const gchar *participant);
00294 
00306 gboolean purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec);
00307 
00318 gboolean purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id);
00319 
00331 gboolean purple_media_is_initiator(PurpleMedia *media,
00332         const gchar *sess_id, const gchar *participant);
00333 
00345 gboolean purple_media_accepted(PurpleMedia *media, const gchar *sess_id,
00346         const gchar *participant);
00347 
00357 void purple_media_set_input_volume(PurpleMedia *media, const gchar *session_id, double level);
00358 
00369 void purple_media_set_output_volume(PurpleMedia *media, const gchar *session_id,
00370         const gchar *participant, double level);
00371 
00384 gulong purple_media_set_output_window(PurpleMedia *media,
00385         const gchar *session_id, const gchar *participant,
00386         gulong window_id);
00387 
00395 void purple_media_remove_output_windows(PurpleMedia *media);
00396 
00397 #ifdef __cplusplus
00398 }
00399 #endif
00400 
00401 G_END_DECLS
00402 
00403 #endif  /* _PURPLE_MEDIA_H_ */