Tue, 05 Aug 2014 19:23:09 -0400
media: Send a signal when a candidate pair is established
This will be used for calling purple_media_set_send_rtcp_mux() where
appropriate.
| 19883 | 1 | /** |
| 19889 | 2 | * @file media.c Media API |
| 19883 | 3 | * @ingroup core |
|
26105
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
4 | */ |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
5 | |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
6 | /* purple |
| 19883 | 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 | |
|
28321
c8d617c408ab
Update various header copyrights thanks to licensecheck.
Paul Aurich <darkrain42@pidgin.im>
parents:
28162
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 19883 | 25 | */ |
| 19889 | 26 | #include "internal.h" |
| 27 | ||
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
28 | #include "account.h" |
| 19883 | 29 | #include "media.h" |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
30 | #include "media/backend-iface.h" |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26112
diff
changeset
|
31 | #include "mediamanager.h" |
| 19883 | 32 | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
33 | #include "debug.h" |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
34 | |
|
26771
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
35 | #ifdef USE_GSTREAMER |
|
29661
ae75a0a4d399
Fix compile with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29655
diff
changeset
|
36 | #include "media/backend-fs2.h" |
|
26792
17140fe8c2f6
Include the media API on win32 even though it isn't actually enabled.
Daniel Atallah <datallah@pidgin.im>
parents:
26771
diff
changeset
|
37 | #include "marshallers.h" |
|
26771
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
38 | #include "media-gst.h" |
|
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
39 | #endif |
|
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
40 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
41 | #ifdef USE_VV |
| 19883 | 42 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
43 | /** @copydoc _PurpleMediaSession */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
44 | typedef struct _PurpleMediaSession PurpleMediaSession; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
45 | /** @copydoc _PurpleMediaStream */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
46 | typedef struct _PurpleMediaStream PurpleMediaStream; |
|
26621
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
47 | /** @copydoc _PurpleMediaClass */ |
|
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
48 | typedef struct _PurpleMediaClass PurpleMediaClass; |
|
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
49 | /** @copydoc _PurpleMediaPrivate */ |
|
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
50 | typedef struct _PurpleMediaPrivate PurpleMediaPrivate; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
51 | |
|
26613
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
52 | /** The media class */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
53 | struct _PurpleMediaClass |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
54 | { |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
55 | GObjectClass parent_class; /**< The parent class. */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
56 | }; |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
57 | |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
58 | /** The media class's private data */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
59 | struct _PurpleMedia |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
60 | { |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
61 | GObject parent; /**< The parent of this object. */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
62 | PurpleMediaPrivate *priv; /**< The private data of this object. */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
63 | }; |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
64 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
65 | struct _PurpleMediaSession |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
66 | { |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
67 | gchar *id; |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
68 | PurpleMedia *media; |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
69 | PurpleMediaSessionType type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
70 | gboolean initiator; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
71 | }; |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
72 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
73 | struct _PurpleMediaStream |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
74 | { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
75 | PurpleMediaSession *session; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
76 | gchar *participant; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
77 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
78 | GList *local_candidates; |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
79 | GList *remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
80 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
81 | gboolean initiator; |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
82 | gboolean accepted; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
83 | gboolean candidates_prepared; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
84 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
85 | GList *active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
86 | GList *active_remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
87 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
88 | #endif |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
89 | |
| 19883 | 90 | struct _PurpleMediaPrivate |
| 91 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
92 | #ifdef USE_VV |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
93 | PurpleMediaManager *manager; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
94 | PurpleAccount *account; |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
95 | PurpleMediaBackend *backend; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
96 | gchar *conference_type; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
97 | gboolean initiator; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
98 | gpointer prpl_data; |
| 19883 | 99 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
100 | GHashTable *sessions; /* PurpleMediaSession table */ |
|
29615
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
101 | GList *participants; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
102 | GList *streams; /* PurpleMediaStream table */ |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
103 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
104 | gpointer dummy; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
105 | #endif |
| 19883 | 106 | }; |
| 107 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
108 | #ifdef USE_VV |
| 19883 | 109 | #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) |
| 110 | ||
| 111 | static void purple_media_class_init (PurpleMediaClass *klass); | |
| 112 | static void purple_media_init (PurpleMedia *media); | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
113 | static void purple_media_dispose (GObject *object); |
| 19883 | 114 | static void purple_media_finalize (GObject *object); |
| 115 | static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 116 | static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
| 117 | ||
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
118 | static void purple_media_new_local_candidate_cb(PurpleMediaBackend *backend, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
119 | const gchar *sess_id, const gchar *participant, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
120 | PurpleMediaCandidate *candidate, PurpleMedia *media); |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
121 | static void purple_media_candidates_prepared_cb(PurpleMediaBackend *backend, |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
122 | const gchar *sess_id, const gchar *name, PurpleMedia *media); |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
123 | static void purple_media_candidate_pair_established_cb( |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
124 | PurpleMediaBackend *backend, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
125 | const gchar *sess_id, const gchar *name, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
126 | PurpleMediaCandidate *local_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
127 | PurpleMediaCandidate *remote_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
128 | PurpleMedia *media); |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
129 | static void purple_media_codecs_changed_cb(PurpleMediaBackend *backend, |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
130 | const gchar *sess_id, PurpleMedia *media); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
131 | |
| 19883 | 132 | static GObjectClass *parent_class = NULL; |
| 133 | ||
| 134 | ||
| 135 | ||
| 136 | enum { | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
137 | S_ERROR, |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
138 | CANDIDATES_PREPARED, |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
139 | CODECS_CHANGED, |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
140 | LEVEL, |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
141 | NEW_CANDIDATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
142 | STATE_CHANGED, |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
143 | STREAM_INFO, |
|
36322
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
144 | CANDIDATE_PAIR_ESTABLISHED, |
| 19883 | 145 | LAST_SIGNAL |
| 146 | }; | |
| 147 | static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
| 148 | ||
| 149 | enum { | |
| 150 | PROP_0, | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
151 | PROP_MANAGER, |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
152 | PROP_BACKEND, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
153 | PROP_ACCOUNT, |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
154 | PROP_CONFERENCE_TYPE, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
155 | PROP_INITIATOR, |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
156 | PROP_PRPL_DATA, |
| 19883 | 157 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
158 | #endif |
| 19883 | 159 | |
|
26618
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
160 | |
| 19883 | 161 | GType |
| 162 | purple_media_get_type() | |
| 163 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
164 | #ifdef USE_VV |
| 19883 | 165 | static GType type = 0; |
| 166 | ||
| 167 | if (type == 0) { | |
| 168 | static const GTypeInfo info = { | |
| 169 | sizeof(PurpleMediaClass), | |
| 170 | NULL, | |
| 171 | NULL, | |
| 172 | (GClassInitFunc) purple_media_class_init, | |
| 173 | NULL, | |
| 174 | NULL, | |
| 175 | sizeof(PurpleMedia), | |
| 176 | 0, | |
|
22071
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
177 | (GInstanceInitFunc) purple_media_init, |
|
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
178 | NULL |
| 19883 | 179 | }; |
| 180 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
| 181 | } | |
| 182 | return type; | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
183 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
184 | return G_TYPE_NONE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
185 | #endif |
| 19883 | 186 | } |
| 187 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
188 | #ifdef USE_VV |
| 19883 | 189 | static void |
| 190 | purple_media_class_init (PurpleMediaClass *klass) | |
| 191 | { | |
| 192 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
| 193 | parent_class = g_type_class_peek_parent(klass); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
194 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
195 | gobject_class->dispose = purple_media_dispose; |
| 19883 | 196 | gobject_class->finalize = purple_media_finalize; |
| 197 | gobject_class->set_property = purple_media_set_property; | |
| 198 | gobject_class->get_property = purple_media_get_property; | |
| 199 | ||
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
200 | g_object_class_install_property(gobject_class, PROP_MANAGER, |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
201 | g_param_spec_object("manager", |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
202 | "Purple Media Manager", |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
203 | "The media manager that contains this media session.", |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
204 | PURPLE_TYPE_MEDIA_MANAGER, |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
205 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
206 | |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
207 | /* |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
208 | * This one should be PURPLE_TYPE_MEDIA_BACKEND, but it doesn't |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
209 | * like interfaces because they "aren't GObjects" |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
210 | */ |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
211 | g_object_class_install_property(gobject_class, PROP_BACKEND, |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
212 | g_param_spec_object("backend", |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
213 | "Purple Media Backend", |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
214 | "The backend object this media object uses.", |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
215 | G_TYPE_OBJECT, |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
216 | G_PARAM_READABLE)); |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
217 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
218 | g_object_class_install_property(gobject_class, PROP_ACCOUNT, |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
219 | g_param_spec_pointer("account", |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
220 | "PurpleAccount", |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
221 | "The account this media session is on.", |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
222 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
223 | |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
224 | g_object_class_install_property(gobject_class, PROP_CONFERENCE_TYPE, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
225 | g_param_spec_string("conference-type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
226 | "Conference Type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
227 | "The type of conference that this media object " |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
228 | "has been created to provide.", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
229 | NULL, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
230 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
231 | |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
232 | g_object_class_install_property(gobject_class, PROP_INITIATOR, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
233 | g_param_spec_boolean("initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
234 | "initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
235 | "If the local user initiated the conference.", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
236 | FALSE, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
237 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
238 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
239 | g_object_class_install_property(gobject_class, PROP_PRPL_DATA, |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
240 | g_param_spec_pointer("prpl-data", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
241 | "gpointer", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
242 | "Data the prpl plugin set on the media session.", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
243 | G_PARAM_READWRITE)); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
244 | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
245 | purple_media_signals[S_ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
246 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
247 | g_cclosure_marshal_VOID__STRING, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
248 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
249 | purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
250 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
251 | purple_smarshal_VOID__STRING_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
252 | G_TYPE_NONE, 2, G_TYPE_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
253 | G_TYPE_STRING); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
254 | purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass), |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
255 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
256 | g_cclosure_marshal_VOID__STRING, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
257 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
258 | purple_media_signals[LEVEL] = g_signal_new("level", G_TYPE_FROM_CLASS(klass), |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
259 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
260 | purple_smarshal_VOID__STRING_STRING_DOUBLE, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
261 | G_TYPE_NONE, 3, G_TYPE_STRING, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
262 | G_TYPE_STRING, G_TYPE_DOUBLE); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
263 | purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass), |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
264 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
265 | purple_smarshal_VOID__POINTER_POINTER_OBJECT, |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
266 | G_TYPE_NONE, 3, G_TYPE_POINTER, |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
267 | G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
268 | purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
269 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
270 | purple_smarshal_VOID__ENUM_STRING_STRING, |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
271 | G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
272 | G_TYPE_STRING, G_TYPE_STRING); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
273 | purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass), |
|
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
274 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
275 | purple_smarshal_VOID__ENUM_STRING_STRING_BOOLEAN, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
276 | G_TYPE_NONE, 4, PURPLE_MEDIA_TYPE_INFO_TYPE, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
277 | G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); |
|
36322
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
278 | purple_media_signals[CANDIDATE_PAIR_ESTABLISHED] = g_signal_new("candidate-pair-established", G_TYPE_FROM_CLASS(klass), |
|
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
279 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
280 | purple_smarshal_VOID__POINTER_POINTER_OBJECT_OBJECT, |
|
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
281 | G_TYPE_NONE, 4, G_TYPE_POINTER, G_TYPE_POINTER, |
|
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
282 | PURPLE_TYPE_MEDIA_CANDIDATE, PURPLE_TYPE_MEDIA_CANDIDATE); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
283 | g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
| 19883 | 284 | } |
| 285 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
286 | |
| 19883 | 287 | static void |
| 288 | purple_media_init (PurpleMedia *media) | |
| 289 | { | |
| 290 | media->priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
|
26406
9cd3c72d787d
Zero out the proper size for the PurpleMediaPrivate structure.
Michael Ruprecht <maiku@pidgin.im>
parents:
26340
diff
changeset
|
291 | memset(media->priv, 0, sizeof(*media->priv)); |
| 19883 | 292 | } |
| 293 | ||
| 294 | static void | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
295 | purple_media_stream_free(PurpleMediaStream *stream) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
296 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
297 | if (stream == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
298 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
299 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
300 | g_free(stream->participant); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
301 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
302 | if (stream->local_candidates) |
|
29575
a9700491f857
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
303 | purple_media_candidate_list_free(stream->local_candidates); |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
304 | if (stream->remote_candidates) |
|
29576
b6988ade0028
Store remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29575
diff
changeset
|
305 | purple_media_candidate_list_free(stream->remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
306 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
307 | if (stream->active_local_candidates) |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
308 | purple_media_candidate_list_free( |
|
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
309 | stream->active_local_candidates); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
310 | if (stream->active_remote_candidates) |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
311 | purple_media_candidate_list_free( |
|
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
312 | stream->active_remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
313 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
314 | g_free(stream); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
315 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
316 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
317 | static void |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
318 | purple_media_session_free(PurpleMediaSession *session) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
319 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
320 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
321 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
322 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
323 | g_free(session->id); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
324 | g_free(session); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
325 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
326 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
327 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
328 | purple_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
329 | { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
330 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
331 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
332 | purple_debug_info("media","purple_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
333 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
334 | purple_media_manager_remove_media(priv->manager, PURPLE_MEDIA(media)); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
335 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
336 | if (priv->backend) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
337 | g_object_unref(priv->backend); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
338 | priv->backend = NULL; |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
339 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
340 | |
|
29567
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
341 | if (priv->manager) { |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
342 | g_object_unref(priv->manager); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
343 | priv->manager = NULL; |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
344 | } |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
345 | |
| 26412 | 346 | G_OBJECT_CLASS(parent_class)->dispose(media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
347 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
348 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
349 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
350 | purple_media_finalize(GObject *media) |
| 19883 | 351 | { |
|
23711
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
352 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
353 | purple_debug_info("media","purple_media_finalize\n"); |
|
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
354 | |
|
26181
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
355 | for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams)) |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
356 | purple_media_stream_free(priv->streams->data); |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
357 | |
|
29615
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
358 | for (; priv->participants; priv->participants = g_list_delete_link( |
|
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
359 | priv->participants, priv->participants)) |
|
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
360 | g_free(priv->participants->data); |
|
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
361 | |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
362 | if (priv->sessions) { |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
363 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
364 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
365 | purple_media_session_free(sessions->data); |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
366 | } |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
367 | g_hash_table_destroy(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
368 | } |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
369 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
370 | G_OBJECT_CLASS(parent_class)->finalize(media); |
| 19883 | 371 | } |
| 372 | ||
| 373 | static void | |
| 374 | purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
| 375 | { | |
| 376 | PurpleMedia *media; | |
| 377 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
378 | |
| 19883 | 379 | media = PURPLE_MEDIA(object); |
| 380 | ||
| 381 | switch (prop_id) { | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
382 | case PROP_MANAGER: |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
383 | media->priv->manager = g_value_dup_object(value); |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
384 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
385 | case PROP_ACCOUNT: |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
386 | media->priv->account = g_value_get_pointer(value); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
387 | break; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
388 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
389 | media->priv->conference_type = |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
390 | g_value_dup_string(value); |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
391 | media->priv->backend = g_object_new( |
|
29620
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
392 | purple_media_manager_get_backend_type( |
|
86e4f028f910
Add a way to set and get which media backend type to use.
Michael Ruprecht <maiku@pidgin.im>
parents:
29618
diff
changeset
|
393 | purple_media_manager_get()), |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
394 | "conference-type", |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
395 | media->priv->conference_type, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
396 | "media", media, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
397 | NULL); |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
398 | g_signal_connect(media->priv->backend, |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
399 | "active-candidate-pair", |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
400 | G_CALLBACK( |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
401 | purple_media_candidate_pair_established_cb), |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
402 | media); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
403 | g_signal_connect(media->priv->backend, |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
404 | "candidates-prepared", |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
405 | G_CALLBACK( |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
406 | purple_media_candidates_prepared_cb), |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
407 | media); |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
408 | g_signal_connect(media->priv->backend, |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
409 | "codecs-changed", |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
410 | G_CALLBACK( |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
411 | purple_media_codecs_changed_cb), |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
412 | media); |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
413 | g_signal_connect(media->priv->backend, |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
414 | "new-candidate", |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
415 | G_CALLBACK( |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
416 | purple_media_new_local_candidate_cb), |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
417 | media); |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
418 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
419 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
420 | media->priv->initiator = g_value_get_boolean(value); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
421 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
422 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
423 | media->priv->prpl_data = g_value_get_pointer(value); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
424 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
425 | default: |
| 19883 | 426 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 427 | break; | |
| 428 | } | |
| 429 | } | |
| 430 | ||
| 431 | static void | |
| 432 | purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 433 | { | |
| 434 | PurpleMedia *media; | |
| 435 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
436 | |
| 19883 | 437 | media = PURPLE_MEDIA(object); |
| 438 | ||
| 439 | switch (prop_id) { | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
440 | case PROP_MANAGER: |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
441 | g_value_set_object(value, media->priv->manager); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
442 | break; |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
443 | case PROP_BACKEND: |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
444 | g_value_set_object(value, media->priv->backend); |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
445 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
446 | case PROP_ACCOUNT: |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
447 | g_value_set_pointer(value, media->priv->account); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
448 | break; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
449 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
450 | g_value_set_string(value, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
451 | media->priv->conference_type); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
452 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
453 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
454 | g_value_set_boolean(value, media->priv->initiator); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
455 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
456 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
457 | g_value_set_pointer(value, media->priv->prpl_data); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
458 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
459 | default: |
|
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
460 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 19883 | 461 | break; |
| 462 | } | |
| 463 | ||
| 464 | } | |
| 465 | ||
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
466 | static PurpleMediaSession* |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
467 | purple_media_get_session(PurpleMedia *media, const gchar *sess_id) |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
468 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
469 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
470 | return (PurpleMediaSession*) (media->priv->sessions) ? |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
471 | g_hash_table_lookup(media->priv->sessions, sess_id) : NULL; |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
472 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
473 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
474 | static PurpleMediaStream* |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
475 | purple_media_get_stream(PurpleMedia *media, const gchar *session, const gchar *participant) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
476 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
477 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
478 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
479 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
480 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
481 | streams = media->priv->streams; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
482 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
483 | for (; streams; streams = g_list_next(streams)) { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
484 | PurpleMediaStream *stream = streams->data; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
485 | if (!strcmp(stream->session->id, session) && |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
486 | !strcmp(stream->participant, participant)) |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
487 | return stream; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
488 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
489 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
490 | return NULL; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
491 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
492 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
493 | static GList * |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
494 | purple_media_get_streams(PurpleMedia *media, const gchar *session, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
495 | const gchar *participant) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
496 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
497 | GList *streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
498 | GList *ret = NULL; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
499 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
500 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
501 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
502 | streams = media->priv->streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
503 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
504 | for (; streams; streams = g_list_next(streams)) { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
505 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
506 | if ((session == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
507 | !strcmp(stream->session->id, session)) && |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
508 | (participant == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
509 | !strcmp(stream->participant, participant))) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
510 | ret = g_list_append(ret, stream); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
511 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
512 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
513 | return ret; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
514 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
515 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
516 | static void |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
517 | purple_media_add_session(PurpleMedia *media, PurpleMediaSession *session) |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
518 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
519 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
520 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
521 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
522 | if (!media->priv->sessions) { |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
523 | purple_debug_info("media", "Creating hash table for sessions\n"); |
|
30715
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
29691
diff
changeset
|
524 | media->priv->sessions = g_hash_table_new_full(g_str_hash, g_str_equal, |
|
61a0bd743512
Fix some media code leaks.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
29691
diff
changeset
|
525 | g_free, NULL); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
526 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
527 | g_hash_table_insert(media->priv->sessions, g_strdup(session->id), session); |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
528 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
529 | |
| 29584 | 530 | #if 0 |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
531 | static gboolean |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
532 | purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
533 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
534 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
535 | return g_hash_table_remove(media->priv->sessions, session->id); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
536 | } |
| 29584 | 537 | #endif |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
538 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
539 | static PurpleMediaStream * |
|
29596
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
540 | purple_media_insert_stream(PurpleMediaSession *session, |
|
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
541 | const gchar *name, gboolean initiator) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
542 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
543 | PurpleMediaStream *media_stream; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
544 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
545 | g_return_val_if_fail(session != NULL, NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
546 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
547 | media_stream = g_new0(PurpleMediaStream, 1); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
548 | media_stream->participant = g_strdup(name); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
549 | media_stream->session = session; |
|
29596
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
550 | media_stream->initiator = initiator; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
551 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
552 | session->media->priv->streams = |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
553 | g_list_append(session->media->priv->streams, media_stream); |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
554 | |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
555 | return media_stream; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
556 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
557 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
558 | static void |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
559 | purple_media_insert_local_candidate(PurpleMediaSession *session, const gchar *name, |
|
29575
a9700491f857
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
560 | PurpleMediaCandidate *candidate) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
561 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
562 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
563 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
564 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
565 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
566 | stream = purple_media_get_stream(session->media, session->id, name); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
567 | stream->local_candidates = g_list_append(stream->local_candidates, candidate); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
568 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
569 | #endif |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
570 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
571 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
572 | purple_media_get_session_ids(PurpleMedia *media) |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
573 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
574 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
575 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
| 26332 | 576 | return media->priv->sessions != NULL ? |
| 577 | g_hash_table_get_keys(media->priv->sessions) : NULL; | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
578 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
579 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
580 | #endif |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
581 | } |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
582 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
583 | #ifdef USE_GSTREAMER |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
584 | GstElement * |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
585 | purple_media_get_src(PurpleMedia *media, const gchar *sess_id) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
586 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
587 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
588 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
589 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
590 | if (PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
591 | return purple_media_backend_fs2_get_src( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
592 | PURPLE_MEDIA_BACKEND_FS2( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
593 | media->priv->backend), sess_id); |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
594 | |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
595 | g_return_val_if_reached(NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
596 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
597 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
598 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
599 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
600 | #endif /* USE_GSTREAMER */ |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
601 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
602 | PurpleAccount * |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
603 | purple_media_get_account(PurpleMedia *media) |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
604 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
605 | #ifdef USE_VV |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
606 | PurpleAccount *account; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
607 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
608 | g_object_get(G_OBJECT(media), "account", &account, NULL); |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
609 | return account; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
610 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
611 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
612 | #endif |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
613 | } |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
614 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
615 | gpointer |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
616 | purple_media_get_prpl_data(PurpleMedia *media) |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
617 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
618 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
619 | gpointer prpl_data; |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
620 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
621 | g_object_get(G_OBJECT(media), "prpl-data", &prpl_data, NULL); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
622 | return prpl_data; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
623 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
624 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
625 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
626 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
627 | |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
628 | void |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
629 | purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data) |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
630 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
631 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
632 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
633 | g_object_set(G_OBJECT(media), "prpl-data", prpl_data, NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
634 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
635 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
636 | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
637 | void |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
638 | purple_media_error(PurpleMedia *media, const gchar *error, ...) |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
639 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
640 | #ifdef USE_VV |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
641 | va_list args; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
642 | gchar *message; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
643 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
644 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
645 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
646 | va_start(args, error); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
647 | message = g_strdup_vprintf(error, args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
648 | va_end(args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
649 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
650 | purple_debug_error("media", "%s\n", message); |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
651 | g_signal_emit(media, purple_media_signals[S_ERROR], 0, message); |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
652 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
653 | g_free(message); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
654 | #endif |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
655 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
656 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
657 | void |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
658 | purple_media_end(PurpleMedia *media, |
|
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
659 | const gchar *session_id, const gchar *participant) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
660 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
661 | #ifdef USE_VV |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
662 | GList *iter, *sessions = NULL, *participants = NULL; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
663 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
664 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
665 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
666 | iter = purple_media_get_streams(media, session_id, participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
667 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
668 | /* Free matching streams */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
669 | for (; iter; iter = g_list_delete_link(iter, iter)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
670 | PurpleMediaStream *stream = iter->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
671 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
672 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
673 | 0, PURPLE_MEDIA_STATE_END, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
674 | stream->session->id, stream->participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
675 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
676 | media->priv->streams = |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
677 | g_list_remove(media->priv->streams, stream); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
678 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
679 | if (g_list_find(sessions, stream->session) == NULL) |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
680 | sessions = g_list_prepend(sessions, stream->session); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
681 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
682 | if (g_list_find_custom(participants, stream->participant, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
683 | (GCompareFunc)strcmp) == NULL) |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
684 | participants = g_list_prepend(participants, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
685 | g_strdup(stream->participant)); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
686 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
687 | purple_media_stream_free(stream); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
688 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
689 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
690 | iter = media->priv->streams; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
691 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
692 | /* Reduce to list of sessions to remove */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
693 | for (; iter; iter = g_list_next(iter)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
694 | PurpleMediaStream *stream = iter->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
695 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
696 | sessions = g_list_remove(sessions, stream->session); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
697 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
698 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
699 | /* Free sessions with no streams left */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
700 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
701 | PurpleMediaSession *session = sessions->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
702 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
703 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
704 | 0, PURPLE_MEDIA_STATE_END, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
705 | session->id, NULL); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
706 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
707 | g_hash_table_remove(media->priv->sessions, session->id); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
708 | purple_media_session_free(session); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
709 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
710 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
711 | iter = media->priv->streams; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
712 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
713 | /* Reduce to list of participants to remove */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
714 | for (; iter; iter = g_list_next(iter)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
715 | PurpleMediaStream *stream = iter->data; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
716 | GList *tmp; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
717 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
718 | tmp = g_list_find_custom(participants, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
719 | stream->participant, (GCompareFunc)strcmp); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
720 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
721 | if (tmp != NULL) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
722 | g_free(tmp->data); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
723 | participants = g_list_delete_link(participants, tmp); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
724 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
725 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
726 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
727 | /* Remove participants with no streams left (just emit the signal) */ |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
728 | for (; participants; participants = |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
729 | g_list_delete_link(participants, participants)) { |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
730 | gchar *participant = participants->data; |
|
29616
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
731 | GList *link = g_list_find_custom(media->priv->participants, |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
732 | participant, (GCompareFunc)strcmp); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
733 | |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
734 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
735 | 0, PURPLE_MEDIA_STATE_END, |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
736 | NULL, participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
737 | |
|
29616
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
738 | if (link != NULL) { |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
739 | g_free(link->data); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
740 | media->priv->participants = g_list_delete_link( |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
741 | media->priv->participants, link); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
742 | } |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
743 | |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
744 | g_free(participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
745 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
746 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
747 | /* Free the conference if no sessions left */ |
|
29625
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
748 | if (media->priv->sessions != NULL && |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
749 | g_hash_table_size(media->priv->sessions) == 0) { |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
750 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
751 | 0, PURPLE_MEDIA_STATE_END, |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
752 | NULL, NULL); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
753 | g_object_unref(media); |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
754 | return; |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
755 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
756 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
757 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
758 | |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
759 | void |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
760 | purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
761 | const gchar *session_id, const gchar *participant, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
762 | gboolean local) |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
763 | { |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
764 | #ifdef USE_VV |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
765 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
766 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
767 | if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
768 | GList *streams, *sessions = NULL, *participants = NULL; |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
769 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
770 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
771 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
772 | streams = purple_media_get_streams(media, |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
773 | session_id, participant); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
774 | |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
775 | /* Emit stream acceptance */ |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
776 | for (; streams; streams = |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
777 | g_list_delete_link(streams, streams)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
778 | PurpleMediaStream *stream = streams->data; |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
779 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
780 | stream->accepted = TRUE; |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
781 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
782 | g_signal_emit(media, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
783 | purple_media_signals[STREAM_INFO], |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
784 | 0, type, stream->session->id, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
785 | stream->participant, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
786 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
787 | if (g_list_find(sessions, stream->session) == NULL) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
788 | sessions = g_list_prepend(sessions, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
789 | stream->session); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
790 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
791 | if (g_list_find_custom(participants, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
792 | stream->participant, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
793 | (GCompareFunc)strcmp) == NULL) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
794 | participants = g_list_prepend(participants, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
795 | g_strdup(stream->participant)); |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
796 | } |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
797 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
798 | /* Emit session acceptance */ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
799 | for (; sessions; sessions = |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
800 | g_list_delete_link(sessions, sessions)) { |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
801 | PurpleMediaSession *session = sessions->data; |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
802 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
803 | if (purple_media_accepted(media, session->id, NULL)) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
804 | g_signal_emit(media, purple_media_signals[ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
805 | STREAM_INFO], 0, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
806 | PURPLE_MEDIA_INFO_ACCEPT, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
807 | session->id, NULL, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
808 | } |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
809 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
810 | /* Emit participant acceptance */ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
811 | for (; participants; participants = g_list_delete_link( |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
812 | participants, participants)) { |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
813 | gchar *participant = participants->data; |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
814 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
815 | if (purple_media_accepted(media, NULL, participant)) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
816 | g_signal_emit(media, purple_media_signals[ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
817 | STREAM_INFO], 0, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
818 | PURPLE_MEDIA_INFO_ACCEPT, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
819 | NULL, participant, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
820 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
821 | g_free(participant); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
822 | } |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
823 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
824 | /* Emit conference acceptance */ |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
825 | if (purple_media_accepted(media, NULL, NULL)) |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
826 | g_signal_emit(media, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
827 | purple_media_signals[STREAM_INFO], |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
828 | 0, PURPLE_MEDIA_INFO_ACCEPT, |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
829 | NULL, NULL, local); |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
830 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
831 | return; |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
832 | } else if (type == PURPLE_MEDIA_INFO_HANGUP || |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
833 | type == PURPLE_MEDIA_INFO_REJECT) { |
|
29617
3cc3d60ee573
Keep track of participants better in purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
29616
diff
changeset
|
834 | GList *streams; |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
835 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
836 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
837 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
838 | streams = purple_media_get_streams(media, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
839 | session_id, participant); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
840 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
841 | /* Emit for stream */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
842 | for (; streams; streams = |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
843 | g_list_delete_link(streams, streams)) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
844 | PurpleMediaStream *stream = streams->data; |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
845 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
846 | g_signal_emit(media, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
847 | purple_media_signals[STREAM_INFO], |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
848 | 0, type, stream->session->id, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
849 | stream->participant, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
850 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
851 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
852 | if (session_id != NULL && participant != NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
853 | /* Everything that needs to be emitted has been */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
854 | } else if (session_id == NULL && participant == NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
855 | /* Emit for everything in the conference */ |
|
29625
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
856 | GList *sessions = NULL; |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
857 | GList *participants = media->priv->participants; |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
858 | |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
859 | if (media->priv->sessions != NULL) |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
860 | sessions = g_hash_table_get_values( |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
861 | media->priv->sessions); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
862 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
863 | /* Emit for sessions */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
864 | for (; sessions; sessions = g_list_delete_link( |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
865 | sessions, sessions)) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
866 | PurpleMediaSession *session = sessions->data; |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
867 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
868 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
869 | STREAM_INFO], 0, type, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
870 | session->id, NULL, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
871 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
872 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
873 | /* Emit for participants */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
874 | for (; participants; participants = |
|
29617
3cc3d60ee573
Keep track of participants better in purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
29616
diff
changeset
|
875 | g_list_next(participants)) { |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
876 | gchar *participant = participants->data; |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
877 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
878 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
879 | STREAM_INFO], 0, type, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
880 | NULL, participant, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
881 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
882 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
883 | /* Emit for conference */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
884 | g_signal_emit(media, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
885 | purple_media_signals[STREAM_INFO], |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
886 | 0, type, NULL, NULL, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
887 | } else if (session_id != NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
888 | /* Emit just the specific session */ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
889 | PurpleMediaSession *session = |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
890 | purple_media_get_session( |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
891 | media, session_id); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
892 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
893 | if (session == NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
894 | purple_debug_warning("media", |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
895 | "Couldn't find session" |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
896 | " to hangup/reject.\n"); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
897 | } else { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
898 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
899 | STREAM_INFO], 0, type, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
900 | session->id, NULL, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
901 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
902 | } else if (participant != NULL) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
903 | /* Emit just the specific participant */ |
|
29617
3cc3d60ee573
Keep track of participants better in purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
29616
diff
changeset
|
904 | if (!g_list_find_custom(media->priv->participants, |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
905 | participant, (GCompareFunc)strcmp)) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
906 | purple_debug_warning("media", |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
907 | "Couldn't find participant" |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
908 | " to hangup/reject.\n"); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
909 | } else { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
910 | g_signal_emit(media, purple_media_signals[ |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
911 | STREAM_INFO], 0, type, NULL, |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
912 | participant, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
913 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
914 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
915 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
916 | purple_media_end(media, session_id, participant); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
917 | return; |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
918 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
919 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
920 | g_signal_emit(media, purple_media_signals[STREAM_INFO], |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
921 | 0, type, session_id, participant, local); |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
922 | #endif |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
923 | } |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
924 | |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
925 | void |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
926 | purple_media_set_params(PurpleMedia *media, |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
927 | guint num_params, GParameter *params) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
928 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
929 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
930 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
931 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
932 | purple_media_backend_set_params(media->priv->backend, num_params, params); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
933 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
934 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
935 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
936 | const gchar ** |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
937 | purple_media_get_available_params(PurpleMedia *media) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
938 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
939 | static const gchar *NULL_ARRAY[] = { NULL }; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
940 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
941 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL_ARRAY); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
942 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
943 | return purple_media_backend_get_available_params(media->priv->backend); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
944 | #else |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
945 | return NULL_ARRAY; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
946 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
947 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
948 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
949 | gboolean |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
950 | purple_media_param_is_supported(PurpleMedia *media, const gchar *param) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
951 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
952 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
953 | const gchar **params; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
954 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
955 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
956 | g_return_val_if_fail(param != NULL, FALSE); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
957 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
958 | params = purple_media_backend_get_available_params(media->priv->backend); |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
959 | for (; *params != NULL; ++params) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
960 | if (!strcmp(*params, param)) |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
961 | return TRUE; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
962 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
963 | return FALSE; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
964 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
965 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
966 | #ifdef USE_VV |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
967 | static void |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
968 | purple_media_new_local_candidate_cb(PurpleMediaBackend *backend, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
969 | const gchar *sess_id, const gchar *participant, |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
970 | PurpleMediaCandidate *candidate, PurpleMedia *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
971 | { |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
972 | PurpleMediaSession *session = |
|
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
973 | purple_media_get_session(media, sess_id); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
974 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
975 | purple_media_insert_local_candidate(session, participant, |
|
29575
a9700491f857
Store local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29573
diff
changeset
|
976 | purple_media_candidate_copy(candidate)); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
977 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
978 | g_signal_emit(session->media, purple_media_signals[NEW_CANDIDATE], |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
979 | 0, session->id, participant, candidate); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
980 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
981 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
982 | static void |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
983 | purple_media_candidates_prepared_cb(PurpleMediaBackend *backend, |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
984 | const gchar *sess_id, const gchar *name, PurpleMedia *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
985 | { |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
986 | PurpleMediaStream *stream_data; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
987 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
988 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
989 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
990 | stream_data = purple_media_get_stream(media, sess_id, name); |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
991 | stream_data->candidates_prepared = TRUE; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
992 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
993 | g_signal_emit(media, purple_media_signals[CANDIDATES_PREPARED], |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
994 | 0, sess_id, name); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
995 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
996 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
997 | /* callback called when a pair of transport candidates (local and remote) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
998 | * has been established */ |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
999 | static void |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1000 | purple_media_candidate_pair_established_cb(PurpleMediaBackend *backend, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1001 | const gchar *sess_id, const gchar *name, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1002 | PurpleMediaCandidate *local_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1003 | PurpleMediaCandidate *remote_candidate, |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1004 | PurpleMedia *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1005 | { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1006 | PurpleMediaStream *stream; |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1007 | GList *iter; |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1008 | guint id; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1009 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1010 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1011 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1012 | stream = purple_media_get_stream(media, sess_id, name); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1013 | id = purple_media_candidate_get_component_id(local_candidate); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1014 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1015 | iter = stream->active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1016 | for(; iter; iter = g_list_next(iter)) { |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1017 | PurpleMediaCandidate *c = iter->data; |
|
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1018 | if (id == purple_media_candidate_get_component_id(c)) { |
|
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1019 | g_object_unref(c); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1020 | stream->active_local_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1021 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1022 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1023 | stream->active_local_candidates, |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1024 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1025 | local_candidate)); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1026 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1027 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1028 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1029 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1030 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1031 | stream->active_local_candidates, |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1032 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1033 | local_candidate)); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1034 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1035 | id = purple_media_candidate_get_component_id(local_candidate); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1036 | |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1037 | iter = stream->active_remote_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1038 | for(; iter; iter = g_list_next(iter)) { |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1039 | PurpleMediaCandidate *c = iter->data; |
|
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1040 | if (id == purple_media_candidate_get_component_id(c)) { |
|
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1041 | g_object_unref(c); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1042 | stream->active_remote_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1043 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1044 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1045 | stream->active_remote_candidates, |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1046 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1047 | remote_candidate)); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1048 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1049 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1050 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1051 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1052 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1053 | stream->active_remote_candidates, |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1054 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1055 | remote_candidate)); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1056 | |
|
36322
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1057 | g_signal_emit(media, purple_media_signals[CANDIDATE_PAIR_ESTABLISHED], |
|
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
1058 | 0, sess_id, name, local_candidate, remote_candidate); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1059 | purple_debug_info("media", "candidate pair established\n"); |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1060 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1061 | |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1062 | static void |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1063 | purple_media_codecs_changed_cb(PurpleMediaBackend *backend, |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1064 | const gchar *sess_id, PurpleMedia *media) |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1065 | { |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1066 | g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, sess_id); |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1067 | } |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1068 | #endif /* USE_VV */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1069 | |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1070 | gboolean |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1071 | purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1072 | const gchar *who, PurpleMediaSessionType type, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1073 | gboolean initiator, const gchar *transmitter, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1074 | guint num_params, GParameter *params) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1075 | { |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1076 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1077 | PurpleMediaSession *session; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1078 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1079 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1080 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1081 | if (!purple_media_backend_add_stream(media->priv->backend, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1082 | sess_id, who, type, initiator, transmitter, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1083 | num_params, params)) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1084 | purple_debug_error("media", "Error adding stream.\n"); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1085 | return FALSE; |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1086 | } |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1087 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1088 | session = purple_media_get_session(media, sess_id); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1089 | |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1090 | if (!session) { |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1091 | session = g_new0(PurpleMediaSession, 1); |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1092 | session->id = g_strdup(sess_id); |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1093 | session->media = media; |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1094 | session->type = type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1095 | session->initiator = initiator; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1096 | |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1097 | purple_media_add_session(media, session); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1098 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
1099 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1100 | session->id, NULL); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1101 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1102 | |
|
29618
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1103 | if (!g_list_find_custom(media->priv->participants, |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1104 | who, (GCompareFunc)strcmp)) { |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1105 | media->priv->participants = g_list_prepend( |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1106 | media->priv->participants, g_strdup(who)); |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1107 | |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1108 | g_signal_emit_by_name(media, "state-changed", |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1109 | PURPLE_MEDIA_STATE_NEW, NULL, who); |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1110 | } |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1111 | |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
1112 | if (purple_media_get_stream(media, sess_id, who) == NULL) { |
|
32109
811763ee9ec5
Remove an unused variable
Olivier Crête <olivier.crete@collabora.com>
parents:
31687
diff
changeset
|
1113 | purple_media_insert_stream(session, who, initiator); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1114 | |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1115 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
1116 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1117 | session->id, who); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1118 | } |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1119 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1120 | return TRUE; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1121 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1122 | return FALSE; |
|
26515
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1123 | #endif /* USE_VV */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1124 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1125 | |
|
26523
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1126 | PurpleMediaManager * |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1127 | purple_media_get_manager(PurpleMedia *media) |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1128 | { |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1129 | PurpleMediaManager *ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1130 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1131 | g_object_get(media, "manager", &ret, NULL); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1132 | return ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1133 | } |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1134 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
1135 | PurpleMediaSessionType |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1136 | purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1137 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1138 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1139 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1140 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), PURPLE_MEDIA_NONE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1141 | session = purple_media_get_session(media, sess_id); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1142 | return session->type; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1143 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1144 | return PURPLE_MEDIA_NONE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1145 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1146 | } |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1147 | /* XXX: Should wait until codecs-ready is TRUE before using this function */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1148 | GList * |
|
26160
46bc5e18d59c
Combine get_*_codecs functions to mirror Farsight 2.
Michael Ruprecht <maiku@pidgin.im>
parents:
26151
diff
changeset
|
1149 | purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1150 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1151 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1152 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1153 | |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29584
diff
changeset
|
1154 | return purple_media_backend_get_codecs(media->priv->backend, sess_id); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1155 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1156 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1157 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1158 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1159 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1160 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1161 | purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1162 | const gchar *participant) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1163 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1164 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1165 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
29587
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1166 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1167 | return purple_media_backend_get_local_candidates(media->priv->backend, |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1168 | sess_id, participant); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1169 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1170 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1171 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1172 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1173 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1174 | void |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1175 | purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1176 | const gchar *participant, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1177 | GList *remote_candidates) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1178 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1179 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1180 | PurpleMediaStream *stream; |
|
26258
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1181 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1182 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1183 | stream = purple_media_get_stream(media, sess_id, participant); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1184 | |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1185 | if (stream == NULL) { |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1186 | purple_debug_error("media", |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1187 | "purple_media_add_remote_candidates: " |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1188 | "couldn't find stream %s %s.\n", |
|
27974
2021706e911d
Fixes for some potential printf("%s", NULL) type of problems from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27971
diff
changeset
|
1189 | sess_id ? sess_id : "(null)", |
|
2021706e911d
Fixes for some potential printf("%s", NULL) type of problems from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27971
diff
changeset
|
1190 | participant ? participant : "(null)"); |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1191 | return; |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1192 | } |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1193 | |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
1194 | stream->remote_candidates = g_list_concat(stream->remote_candidates, |
|
29576
b6988ade0028
Store remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29575
diff
changeset
|
1195 | purple_media_candidate_list_copy(remote_candidates)); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1196 | |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1197 | purple_media_backend_add_remote_candidates(media->priv->backend, |
|
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1198 | sess_id, participant, remote_candidates); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1199 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1200 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1201 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1202 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1203 | purple_media_get_active_local_candidates(PurpleMedia *media, |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1204 | const gchar *sess_id, const gchar *participant) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1205 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1206 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1207 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1208 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1209 | stream = purple_media_get_stream(media, sess_id, participant); |
|
29577
f17bd178cb1f
Store active_local_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29576
diff
changeset
|
1210 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1211 | stream->active_local_candidates); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1212 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1213 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1214 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1215 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1216 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1217 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1218 | purple_media_get_active_remote_candidates(PurpleMedia *media, |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1219 | const gchar *sess_id, const gchar *participant) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1220 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1221 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1222 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1223 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1224 | stream = purple_media_get_stream(media, sess_id, participant); |
|
29578
3629e984a6b8
Store active_remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29577
diff
changeset
|
1225 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1226 | stream->active_remote_candidates); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1227 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1228 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1229 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1230 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1231 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1232 | gboolean |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1233 | purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1234 | const gchar *participant, GList *codecs) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1235 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1236 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1237 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1238 | |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
1239 | return purple_media_backend_set_remote_codecs(media->priv->backend, |
|
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
1240 | sess_id, participant, codecs); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1241 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1242 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1243 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1244 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1245 | |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1246 | gboolean |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1247 | purple_media_candidates_prepared(PurpleMedia *media, |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1248 | const gchar *session_id, const gchar *participant) |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1249 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1250 | #ifdef USE_VV |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1251 | GList *streams; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1252 | gboolean prepared = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1253 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1254 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1255 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1256 | streams = purple_media_get_streams(media, session_id, participant); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1257 | |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1258 | for (; streams; streams = g_list_delete_link(streams, streams)) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1259 | PurpleMediaStream *stream = streams->data; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1260 | if (stream->candidates_prepared == FALSE) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1261 | g_list_free(streams); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1262 | prepared = FALSE; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1263 | break; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1264 | } |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1265 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1266 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1267 | return prepared; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1268 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1269 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1270 | #endif |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1271 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1272 | |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1273 | gboolean |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1274 | purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec) |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1275 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1276 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1277 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1278 | |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
1279 | return purple_media_backend_set_send_codec( |
|
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
1280 | media->priv->backend, sess_id, codec); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1281 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1282 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1283 | #endif |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1284 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1285 | |
|
26137
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1286 | gboolean |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1287 | purple_media_set_encryption_parameters(PurpleMedia *media, const gchar *sess_id, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1288 | const gchar *cipher, const gchar *auth, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1289 | const gchar *key, gsize key_len) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1290 | { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1291 | #ifdef USE_VV |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1292 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1293 | return purple_media_backend_set_encryption_parameters(media->priv->backend, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1294 | sess_id, cipher, auth, key, key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1295 | #else |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1296 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1297 | #endif |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1298 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1299 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1300 | gboolean |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1301 | purple_media_set_decryption_parameters(PurpleMedia *media, const gchar *sess_id, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1302 | const gchar *participant, const gchar *cipher, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1303 | const gchar *auth, const gchar *key, gsize key_len) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1304 | { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1305 | #ifdef USE_VV |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1306 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1307 | return purple_media_backend_set_decryption_parameters(media->priv->backend, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1308 | sess_id, participant, cipher, auth, key, key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1309 | #else |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1310 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1311 | #endif |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1312 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1313 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1314 | gboolean |
|
26137
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1315 | purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id) |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1316 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1317 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1318 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1319 | |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29596
diff
changeset
|
1320 | return purple_media_backend_codecs_ready( |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29596
diff
changeset
|
1321 | media->priv->backend, sess_id); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1322 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1323 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1324 | #endif |
|
26137
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1325 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1326 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1327 | gboolean |
|
36321
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1328 | purple_media_set_send_rtcp_mux(PurpleMedia *media, const gchar *sess_id, |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1329 | const gchar *participant, gboolean send_rtcp_mux) |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1330 | { |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1331 | #ifdef USE_VV |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1332 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1333 | |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1334 | return purple_media_backend_set_send_rtcp_mux(media->priv->backend, |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1335 | sess_id, participant, send_rtcp_mux); |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1336 | #else |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1337 | return FALSE; |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1338 | #endif |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1339 | } |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1340 | |
|
5f5abd63c305
media: Add a send-rtcp-mux API to allow muxing of RTP and RTCP
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36318
diff
changeset
|
1341 | gboolean |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1342 | purple_media_is_initiator(PurpleMedia *media, |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1343 | const gchar *sess_id, const gchar *participant) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1344 | { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1345 | #ifdef USE_VV |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1346 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1347 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1348 | if (sess_id == NULL && participant == NULL) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1349 | return media->priv->initiator; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1350 | else if (sess_id != NULL && participant == NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1351 | PurpleMediaSession *session = |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1352 | purple_media_get_session(media, sess_id); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1353 | return session != NULL ? session->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1354 | } else if (sess_id != NULL && participant != NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1355 | PurpleMediaStream *stream = purple_media_get_stream( |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1356 | media, sess_id, participant); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1357 | return stream != NULL ? stream->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1358 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1359 | #endif |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1360 | return FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1361 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1362 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1363 | gboolean |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1364 | purple_media_accepted(PurpleMedia *media, const gchar *sess_id, |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1365 | const gchar *participant) |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1366 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1367 | #ifdef USE_VV |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1368 | gboolean accepted = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1369 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1370 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1371 | |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1372 | if (sess_id == NULL && participant == NULL) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1373 | GList *streams = media->priv->streams; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1374 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1375 | for (; streams; streams = g_list_next(streams)) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1376 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1377 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1378 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1379 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1380 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1381 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1382 | } else if (sess_id != NULL && participant == NULL) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1383 | GList *streams = purple_media_get_streams( |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1384 | media, sess_id, NULL); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1385 | for (; streams; streams = |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1386 | g_list_delete_link(streams, streams)) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1387 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1388 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1389 | g_list_free(streams); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1390 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1391 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1392 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1393 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1394 | } else if (sess_id != NULL && participant != NULL) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1395 | PurpleMediaStream *stream = purple_media_get_stream( |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1396 | media, sess_id, participant); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1397 | if (stream == NULL || stream->accepted == FALSE) |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1398 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1399 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1400 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1401 | return accepted; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1402 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1403 | return FALSE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1404 | #endif |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1405 | } |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1406 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1407 | void purple_media_set_input_volume(PurpleMedia *media, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1408 | const gchar *session_id, double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1409 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1410 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1411 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1412 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1413 | |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1414 | purple_media_backend_fs2_set_input_volume( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1415 | PURPLE_MEDIA_BACKEND_FS2( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1416 | media->priv->backend), |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1417 | session_id, level); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1418 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1419 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1420 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1421 | void purple_media_set_output_volume(PurpleMedia *media, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1422 | const gchar *session_id, const gchar *participant, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1423 | double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1424 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1425 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1426 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1427 | g_return_if_fail(PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1428 | |
|
29601
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1429 | purple_media_backend_fs2_set_output_volume( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1430 | PURPLE_MEDIA_BACKEND_FS2( |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1431 | media->priv->backend), |
|
fb1168d4ee6b
Move volume setting functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29600
diff
changeset
|
1432 | session_id, participant, level); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1433 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1434 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1435 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1436 | gulong |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1437 | purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1438 | const gchar *participant, gulong window_id) |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1439 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1440 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1441 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1442 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1443 | return purple_media_manager_set_output_window(media->priv->manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1444 | media, session_id, participant, window_id); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1445 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1446 | return 0; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1447 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1448 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1449 | |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1450 | void |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1451 | purple_media_remove_output_windows(PurpleMedia *media) |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1452 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1453 | #ifdef USE_VV |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1454 | GList *iter = media->priv->streams; |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1455 | for (; iter; iter = g_list_next(iter)) { |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1456 | PurpleMediaStream *stream = iter->data; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1457 | purple_media_manager_remove_output_windows( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1458 | media->priv->manager, media, |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1459 | stream->session->id, stream->participant); |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1460 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1461 | |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1462 | iter = purple_media_get_session_ids(media); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1463 | for (; iter; iter = g_list_delete_link(iter, iter)) { |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1464 | gchar *session_name = iter->data; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1465 | purple_media_manager_remove_output_windows( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1466 | media->priv->manager, media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1467 | session_name, NULL); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1468 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1469 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1470 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1471 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1472 | #ifdef USE_GSTREAMER |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1473 | GstElement * |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1474 | purple_media_get_tee(PurpleMedia *media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1475 | const gchar *session_id, const gchar *participant) |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1476 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1477 | #ifdef USE_VV |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1478 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1479 | |
|
29599
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1480 | if (PURPLE_IS_MEDIA_BACKEND_FS2(media->priv->backend)) |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1481 | return purple_media_backend_fs2_get_tee( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1482 | PURPLE_MEDIA_BACKEND_FS2( |
|
24e1d49a6fce
Move all src and sink creation in PurpleMedia to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29598
diff
changeset
|
1483 | media->priv->backend), |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1484 | session_id, participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1485 | g_return_val_if_reached(NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1486 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1487 | return NULL; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1488 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1489 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1490 | #endif /* USE_GSTREAMER */ |
|
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1491 | |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1492 | gboolean |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1493 | purple_media_send_dtmf(PurpleMedia *media, const gchar *session_id, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1494 | gchar dtmf, guint8 volume, guint16 duration) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1495 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1496 | #ifdef USE_VV |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1497 | PurpleAccount *account = NULL; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1498 | PurpleConnection *gc = NULL; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1499 | PurplePlugin *prpl = NULL; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1500 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1501 | PurpleMediaBackendIface *backend_iface = NULL; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1502 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1503 | if (media) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1504 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1505 | account = purple_media_get_account(media); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1506 | backend_iface = PURPLE_MEDIA_BACKEND_GET_INTERFACE(media->priv->backend); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1507 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1508 | if (account) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1509 | gc = purple_account_get_connection(account); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1510 | if (gc) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1511 | prpl = purple_connection_get_prpl(gc); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1512 | if (prpl) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1513 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1514 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1515 | if (dtmf == 'a') |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1516 | dtmf = 'A'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1517 | else if (dtmf == 'b') |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1518 | dtmf = 'B'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1519 | else if (dtmf == 'c') |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1520 | dtmf = 'C'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1521 | else if (dtmf == 'd') |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1522 | dtmf = 'D'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1523 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1524 | g_return_val_if_fail(strchr("0123456789ABCD#*", dtmf), FALSE); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1525 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1526 | if (backend_iface && backend_iface->send_dtmf |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1527 | && backend_iface->send_dtmf(media->priv->backend, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1528 | session_id, dtmf, volume, duration)) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1529 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1530 | return TRUE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1531 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1532 | #endif |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1533 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1534 | } |