Mercurial > pidgin
annotate libpurple/media.h @ 23801:43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
to missing GStreamer/Farsight plugins.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Tue, 27 May 2008 02:24:03 +0000 |
parents | e1c8ec1259de |
children | cbe97caec684 |
rev | line source |
---|---|
23760 | 1 /** |
23766 | 2 * @file media.h Media API |
23760 | 3 * @ingroup core |
4 * | |
5 * purple | |
6 * | |
7 * Purple 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 | |
26 #ifndef __MEDIA_H_ | |
27 #define __MEDIA_H_ | |
28 | |
29 #ifdef USE_FARSIGHT | |
23787
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
30 #ifdef USE_GSTPROPS |
23760 | 31 |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
32 #include <gst/gst.h> |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
33 #include <gst/farsight/fs-stream.h> |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
34 #include <gst/farsight/fs-session.h> |
23760 | 35 #include <glib.h> |
36 #include <glib-object.h> | |
37 | |
38 #include "connection.h" | |
39 | |
40 G_BEGIN_DECLS | |
41 | |
42 #define PURPLE_TYPE_MEDIA (purple_media_get_type()) | |
43 #define PURPLE_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia)) | |
44 #define PURPLE_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass)) | |
45 #define PURPLE_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA)) | |
46 #define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA)) | |
47 #define PURPLE_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass)) | |
48 | |
49 typedef struct _PurpleMedia PurpleMedia; | |
50 typedef struct _PurpleMediaClass PurpleMediaClass; | |
51 typedef struct _PurpleMediaPrivate PurpleMediaPrivate; | |
52 | |
53 typedef enum { | |
54 PURPLE_MEDIA_RECV_AUDIO = 1 << 0, | |
55 PURPLE_MEDIA_SEND_AUDIO = 1 << 1, | |
56 PURPLE_MEDIA_RECV_VIDEO = 1 << 2, | |
57 PURPLE_MEDIA_SEND_VIDEO = 1 << 3, | |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
58 PURPLE_MEDIA_AUDIO = PURPLE_MEDIA_RECV_AUDIO | PURPLE_MEDIA_SEND_AUDIO, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
59 PURPLE_MEDIA_VIDEO = PURPLE_MEDIA_RECV_VIDEO | PURPLE_MEDIA_SEND_VIDEO |
23760 | 60 } PurpleMediaStreamType; |
61 | |
62 struct _PurpleMediaClass | |
63 { | |
64 GObjectClass parent_class; | |
65 }; | |
66 | |
67 struct _PurpleMedia | |
68 { | |
69 GObject parent; | |
70 PurpleMediaPrivate *priv; | |
71 }; | |
72 | |
23772
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23766
diff
changeset
|
73 GType purple_media_get_type(void); |
23760 | 74 |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
75 void purple_media_get_elements(PurpleMedia *media, GstElement **audio_src, GstElement **audio_sink, |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
76 GstElement **video_src, GstElement **video_sink); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
77 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
78 void purple_media_set_audio_src(PurpleMedia *media, GstElement *video_src); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
79 void purple_media_set_audio_sink(PurpleMedia *media, GstElement *video_src); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
80 void purple_media_set_video_src(PurpleMedia *media, GstElement *video_src); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
81 void purple_media_set_video_sink(PurpleMedia *media, GstElement *video_src); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
82 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
83 GstElement *purple_media_get_audio_src(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
84 GstElement *purple_media_get_audio_sink(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
85 GstElement *purple_media_get_video_src(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
86 GstElement *purple_media_get_video_sink(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
87 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
88 GstElement *purple_media_get_audio_pipeline(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
89 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
90 PurpleConnection *purple_media_get_connection(PurpleMedia *media); |
23763
de4914b5e45c
Cute little compile errors.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23762
diff
changeset
|
91 const char *purple_media_get_screenname(PurpleMedia *media); |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
92 void purple_media_ready(PurpleMedia *media); |
23793
befeece4dd48
Change a few things:
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23787
diff
changeset
|
93 void purple_media_wait(PurpleMedia *media); |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
94 void purple_media_accept(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
95 void purple_media_reject(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
96 void purple_media_hangup(PurpleMedia *media); |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
97 void purple_media_got_hangup(PurpleMedia *media); |
23787
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
98 void purple_media_got_accept(PurpleMedia *media); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
99 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
100 gchar *purple_media_get_device_name(GstElement *element, |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
101 GValue *device); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
102 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
103 GList *purple_media_get_devices(GstElement *element); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
104 void purple_media_element_set_device(GstElement *element, GValue *device); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
105 void purple_media_element_set_device_from_name(GstElement *element, |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
106 const gchar *name); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
107 GValue *purple_media_element_get_device(GstElement *element); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
108 GstElement *purple_media_get_element(const gchar *factory_name); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
109 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
110 void purple_media_audio_init_src(GstElement **sendbin, |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
111 GstElement **sendlevel); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
112 void purple_media_video_init_src(GstElement **sendbin); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
113 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
114 void purple_media_audio_init_recv(GstElement **recvbin, GstElement **recvlevel); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
115 |
23801
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23797
diff
changeset
|
116 gboolean purple_media_add_stream(PurpleMedia *media, const gchar *who, |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
117 PurpleMediaStreamType type, const gchar *transmitter); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
118 void purple_media_remove_stream(PurpleMedia *media, const gchar *who, PurpleMediaStreamType type); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
119 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
120 GList *purple_media_get_local_audio_candidates(PurpleMedia *media); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
121 GList *purple_media_get_negotiated_audio_codecs(PurpleMedia *media); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
122 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
123 GList *purple_media_get_local_audio_codecs(PurpleMedia *media); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
124 void purple_media_add_remote_audio_candidates(PurpleMedia *media, const gchar *name, |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
125 GList *remote_candidates); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
126 FsCandidate *purple_media_get_local_candidate(PurpleMedia *media); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
127 FsCandidate *purple_media_get_remote_candidate(PurpleMedia *media); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
128 void purple_media_set_remote_audio_codecs(PurpleMedia *media, const gchar *name, GList *codecs); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
129 |
23760 | 130 G_END_DECLS |
131 | |
23787
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
132 #endif /* USE_GSTPROPS */ |
23760 | 133 #endif /* USE_FARSIGHT */ |
134 | |
135 | |
136 #endif /* __MEDIA_H_ */ |