Mercurial > pidgin
annotate libpurple/media.h @ 23787:92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
It's now possible to initiate an audio session, sometimes. It's somewhat
buggy.
Some other issues also need to be resolved:
* Properly get rid of the compile warnings
* Rename the serv_ functions with proper namespacing.
* Possibly rename the purple_media_ functions that don't deal with a
PurpleMedia (e.g. purple_media_audio_init_src) to something different,
e.g. purple_media_util_, or even purple_gst_util etc.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 22 Mar 2008 04:45:46 +0000 |
parents | 1fefd8340821 |
children | befeece4dd48 |
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 |
32 #include <farsight/farsight.h> | |
33 #include <glib.h> | |
34 #include <glib-object.h> | |
35 | |
36 #include "connection.h" | |
37 | |
38 G_BEGIN_DECLS | |
39 | |
40 #define PURPLE_TYPE_MEDIA (purple_media_get_type()) | |
41 #define PURPLE_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA, PurpleMedia)) | |
42 #define PURPLE_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA, PurpleMediaClass)) | |
43 #define PURPLE_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA)) | |
44 #define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA)) | |
45 #define PURPLE_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass)) | |
46 | |
47 typedef struct _PurpleMedia PurpleMedia; | |
48 typedef struct _PurpleMediaClass PurpleMediaClass; | |
49 typedef struct _PurpleMediaPrivate PurpleMediaPrivate; | |
50 | |
51 typedef enum { | |
52 PURPLE_MEDIA_RECV_AUDIO = 1 << 0, | |
53 PURPLE_MEDIA_SEND_AUDIO = 1 << 1, | |
54 PURPLE_MEDIA_RECV_VIDEO = 1 << 2, | |
55 PURPLE_MEDIA_SEND_VIDEO = 1 << 3, | |
56 } PurpleMediaStreamType; | |
57 | |
58 struct _PurpleMediaClass | |
59 { | |
60 GObjectClass parent_class; | |
61 }; | |
62 | |
63 struct _PurpleMedia | |
64 { | |
65 GObject parent; | |
66 PurpleMediaPrivate *priv; | |
67 }; | |
68 | |
23772
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23766
diff
changeset
|
69 GType purple_media_get_type(void); |
23760 | 70 |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
71 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
|
72 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
|
73 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
74 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
|
75 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
|
76 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
|
77 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
|
78 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
79 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
|
80 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
|
81 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
|
82 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
|
83 |
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_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
|
85 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
86 PurpleConnection *purple_media_get_connection(PurpleMedia *media); |
23763
de4914b5e45c
Cute little compile errors.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23762
diff
changeset
|
87 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
|
88 void purple_media_ready(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 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
95 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
|
96 GValue *device); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
97 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
98 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
|
99 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
|
100 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
|
101 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
|
102 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
|
103 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
|
104 |
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_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
|
106 GstElement **sendlevel); |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
107 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
|
108 |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
109 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
|
110 |
23760 | 111 G_END_DECLS |
112 | |
23787
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23775
diff
changeset
|
113 #endif /* USE_GSTPROPS */ |
23760 | 114 #endif /* USE_FARSIGHT */ |
115 | |
116 | |
117 #endif /* __MEDIA_H_ */ |