Thu, 13 Jan 2022 23:09:47 -0600
Remove farstream.
This has been a long time coming as we need to overhaul the media api. Removing
this now, will make it that much easier later.
Testing Done:
* verified voice and video testing still works in preferences
* verified that an XMPP voice call failed silently instead of crashing
* ran `ninja pidgin-pot`
* built the docs
Reviewed at https://reviews.imfreedom.org/r/1215/
|
26105
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
1 | /* purple |
| 19883 | 2 | * |
| 3 | * Purple is the legal property of its developers, whose names are too numerous | |
| 4 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * 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
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 19883 | 20 | */ |
| 19889 | 21 | #include "internal.h" |
| 22 | ||
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
23 | #include "account.h" |
| 19883 | 24 | #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
|
25 | #include "media/backend-iface.h" |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26112
diff
changeset
|
26 | #include "mediamanager.h" |
| 19883 | 27 | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
28 | #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
|
29 | |
|
26771
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
30 | #include "media-gst.h" |
|
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
31 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
32 | #ifdef USE_VV |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
33 | /** @copydoc _PurpleMediaSession */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
34 | typedef struct _PurpleMediaSession PurpleMediaSession; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
35 | /** @copydoc _PurpleMediaStream */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
36 | typedef struct _PurpleMediaStream PurpleMediaStream; |
|
26613
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
37 | |
|
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
|
38 | 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
|
39 | { |
|
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
|
40 | 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
|
41 | PurpleMedia *media; |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
42 | PurpleMediaSessionType type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
43 | 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
|
44 | }; |
|
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
|
45 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
46 | struct _PurpleMediaStream |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
47 | { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
48 | PurpleMediaSession *session; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
49 | gchar *participant; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
50 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
51 | GList *local_candidates; |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
52 | GList *remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
53 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
54 | gboolean initiator; |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
55 | gboolean accepted; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
56 | gboolean candidates_prepared; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
57 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
58 | GList *active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
59 | GList *active_remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
60 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
61 | #endif |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
62 | |
| 19883 | 63 | struct _PurpleMediaPrivate |
| 64 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
65 | #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
|
66 | PurpleMediaManager *manager; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
67 | PurpleAccount *account; |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
68 | PurpleMediaBackend *backend; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
69 | gchar *conference_type; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
70 | gboolean initiator; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
71 | gpointer protocol_data; |
| 19883 | 72 | |
|
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
|
73 | GHashTable *sessions; /* PurpleMediaSession table */ |
|
29615
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
74 | GList *participants; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
75 | 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
|
76 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
77 | 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
|
78 | #endif |
| 19883 | 79 | }; |
| 80 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
81 | #ifdef USE_VV |
| 19883 | 82 | static void purple_media_class_init (PurpleMediaClass *klass); |
| 83 | static void purple_media_init (PurpleMedia *media); | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
84 | static void purple_media_dispose (GObject *object); |
| 19883 | 85 | static void purple_media_finalize (GObject *object); |
| 86 | static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 87 | static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
| 88 | ||
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
89 | 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
|
90 | 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
|
91 | 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
|
92 | 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
|
93 | 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
|
94 | 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
|
95 | 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
|
96 | 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
|
97 | 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
|
98 | 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
|
99 | 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
|
100 | 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
|
101 | const gchar *sess_id, PurpleMedia *media); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
102 | |
| 19883 | 103 | |
| 104 | enum { | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
105 | S_ERROR, |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
106 | CANDIDATES_PREPARED, |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
107 | CODECS_CHANGED, |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
108 | 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
|
109 | NEW_CANDIDATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
110 | STATE_CHANGED, |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
111 | STREAM_INFO, |
|
36322
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
112 | CANDIDATE_PAIR_ESTABLISHED, |
| 19883 | 113 | LAST_SIGNAL |
| 114 | }; | |
| 115 | static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
| 116 | ||
| 117 | enum { | |
| 118 | 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
|
119 | 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
|
120 | PROP_BACKEND, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
121 | PROP_ACCOUNT, |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
122 | PROP_CONFERENCE_TYPE, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
123 | PROP_INITIATOR, |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
124 | PROP_PROTOCOL_DATA, |
| 19883 | 125 | }; |
| 126 | ||
|
39259
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
127 | G_DEFINE_TYPE_WITH_PRIVATE(PurpleMedia, purple_media, G_TYPE_OBJECT); |
|
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
128 | #else |
| 19883 | 129 | GType |
| 130 | purple_media_get_type() | |
| 131 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
132 | return G_TYPE_NONE; |
| 19883 | 133 | } |
|
39259
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
134 | #endif /* USE_VV */ |
| 19883 | 135 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
136 | #ifdef USE_VV |
| 19883 | 137 | static void |
| 138 | purple_media_class_init (PurpleMediaClass *klass) | |
| 139 | { | |
| 140 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
141 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
142 | gobject_class->dispose = purple_media_dispose; |
| 19883 | 143 | gobject_class->finalize = purple_media_finalize; |
| 144 | gobject_class->set_property = purple_media_set_property; | |
| 145 | gobject_class->get_property = purple_media_get_property; | |
| 146 | ||
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
147 | 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
|
148 | 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
|
149 | "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
|
150 | "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
|
151 | PURPLE_TYPE_MEDIA_MANAGER, |
|
35063
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
152 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | |
|
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
153 | G_PARAM_STATIC_STRINGS)); |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
154 | |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
155 | /* |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
156 | * 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
|
157 | * 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
|
158 | */ |
|
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
159 | 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
|
160 | 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
|
161 | "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
|
162 | "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
|
163 | G_TYPE_OBJECT, |
|
35063
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
164 | G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
165 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
166 | g_object_class_install_property(gobject_class, PROP_ACCOUNT, |
|
37525
808e60da793c
Fix PurpleMedia account property to be defined as an object
Mike Ruprecht <cmaiku@gmail.com>
parents:
37170
diff
changeset
|
167 | g_param_spec_object("account", "PurpleAccount", |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
168 | "The account this media session is on.", |
|
37525
808e60da793c
Fix PurpleMedia account property to be defined as an object
Mike Ruprecht <cmaiku@gmail.com>
parents:
37170
diff
changeset
|
169 | PURPLE_TYPE_ACCOUNT, |
|
35063
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
170 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | |
|
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
171 | G_PARAM_STATIC_STRINGS)); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
172 | |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
173 | 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
|
174 | g_param_spec_string("conference-type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
175 | "Conference Type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
176 | "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
|
177 | "has been created to provide.", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
178 | NULL, |
|
35063
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
179 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | |
|
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
180 | G_PARAM_STATIC_STRINGS)); |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
181 | |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
182 | g_object_class_install_property(gobject_class, PROP_INITIATOR, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
183 | g_param_spec_boolean("initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
184 | "initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
185 | "If the local user initiated the conference.", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
186 | FALSE, |
|
35063
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
187 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | |
|
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
188 | G_PARAM_STATIC_STRINGS)); |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
189 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
190 | g_object_class_install_property(gobject_class, PROP_PROTOCOL_DATA, |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
191 | g_param_spec_pointer("protocol-data", |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
192 | "gpointer", |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
193 | "Data the protocol set on the media session.", |
|
35063
8ac1510a27ae
media: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34923
diff
changeset
|
194 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
195 | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
196 | purple_media_signals[S_ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
197 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
198 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
199 | purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
200 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
201 | G_TYPE_NONE, 2, G_TYPE_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
202 | G_TYPE_STRING); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
203 | purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
204 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
205 | 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
|
206 | purple_media_signals[LEVEL] = g_signal_new("level", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
207 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
208 | 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
|
209 | 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
|
210 | purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
211 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, 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
|
212 | G_TYPE_NONE, 3, G_TYPE_POINTER, |
|
40890
631788774f96
Use PurpleMedia/PURPLE_MEDIA prefix for everything in libpurple/media.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40547
diff
changeset
|
213 | G_TYPE_POINTER, PURPLE_MEDIA_TYPE_CANDIDATE); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
214 | purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
215 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
216 | 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
|
217 | G_TYPE_STRING, G_TYPE_STRING); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
218 | purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
219 | G_SIGNAL_RUN_LAST, 0, NULL, 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
|
220 | 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
|
221 | 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
|
222 | purple_media_signals[CANDIDATE_PAIR_ESTABLISHED] = g_signal_new("candidate-pair-established", G_TYPE_FROM_CLASS(klass), |
|
38365
2ee19fb5fb0d
libpurple: Use default marshaller for GObject signals
Mike Ruprecht <cmaiku@gmail.com>
parents:
37952
diff
changeset
|
223 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, |
|
36322
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
224 | G_TYPE_NONE, 4, G_TYPE_POINTER, G_TYPE_POINTER, |
|
40890
631788774f96
Use PurpleMedia/PURPLE_MEDIA prefix for everything in libpurple/media.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40547
diff
changeset
|
225 | PURPLE_MEDIA_TYPE_CANDIDATE, PURPLE_MEDIA_TYPE_CANDIDATE); |
| 19883 | 226 | } |
| 227 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
228 | |
| 19883 | 229 | static void |
| 230 | purple_media_init (PurpleMedia *media) | |
| 231 | { | |
|
39259
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
232 | media->priv = purple_media_get_instance_private(media); |
|
26406
9cd3c72d787d
Zero out the proper size for the PurpleMediaPrivate structure.
Michael Ruprecht <maiku@pidgin.im>
parents:
26340
diff
changeset
|
233 | memset(media->priv, 0, sizeof(*media->priv)); |
| 19883 | 234 | } |
| 235 | ||
| 236 | static void | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
237 | purple_media_stream_free(PurpleMediaStream *stream) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
238 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
239 | if (stream == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
240 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
241 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
242 | g_free(stream->participant); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
243 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
244 | 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
|
245 | 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
|
246 | 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
|
247 | purple_media_candidate_list_free(stream->remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
248 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
249 | 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
|
250 | 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
|
251 | stream->active_local_candidates); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
252 | 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
|
253 | 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
|
254 | stream->active_remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
255 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
256 | g_free(stream); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
257 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
258 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
259 | static void |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
260 | purple_media_session_free(PurpleMediaSession *session) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
261 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
262 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
263 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
264 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
265 | g_free(session->id); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
266 | g_free(session); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
267 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
268 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
269 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
270 | purple_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
271 | { |
|
39259
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
272 | PurpleMediaPrivate *priv = |
|
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
273 | purple_media_get_instance_private(PURPLE_MEDIA(media)); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
274 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
275 | purple_debug_info("media","purple_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
276 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
277 | 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
|
278 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
279 | if (priv->backend) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
280 | 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
|
281 | priv->backend = NULL; |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
282 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
283 | |
|
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
|
284 | 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
|
285 | 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
|
286 | 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
|
287 | } |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
288 | |
|
40264
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
289 | if (priv->conference_type) { |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
290 | g_free(priv->conference_type); |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
291 | priv->conference_type = NULL; |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
292 | } |
|
d253f767f6cc
fix various memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
293 | |
|
39259
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
294 | G_OBJECT_CLASS(purple_media_parent_class)->dispose(media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
295 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
296 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
297 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
298 | purple_media_finalize(GObject *media) |
| 19883 | 299 | { |
|
39259
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
300 | PurpleMediaPrivate *priv = |
|
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
301 | purple_media_get_instance_private(PURPLE_MEDIA(media)); |
|
23711
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
302 | 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
|
303 | |
|
40062
d25228fc7b8e
Use g_list_free_full instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39757
diff
changeset
|
304 | g_list_free_full(priv->streams, (GDestroyNotify)purple_media_stream_free); |
|
d25228fc7b8e
Use g_list_free_full instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39757
diff
changeset
|
305 | g_list_free_full(priv->participants, g_free); |
|
29615
0aca2e93ae36
Add a list of participants back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29613
diff
changeset
|
306 | |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
307 | if (priv->sessions) { |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
308 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
40062
d25228fc7b8e
Use g_list_free_full instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39757
diff
changeset
|
309 | g_list_free_full(sessions, (GDestroyNotify)purple_media_session_free); |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
310 | g_hash_table_destroy(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
311 | } |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
312 | |
|
39259
bd13faf0172b
Port purple media code away from deprecated g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38813
diff
changeset
|
313 | G_OBJECT_CLASS(purple_media_parent_class)->finalize(media); |
| 19883 | 314 | } |
| 315 | ||
| 316 | static void | |
| 317 | purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
| 318 | { | |
| 319 | PurpleMedia *media; | |
| 320 | 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
|
321 | |
| 19883 | 322 | media = PURPLE_MEDIA(object); |
| 323 | ||
| 324 | 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
|
325 | 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
|
326 | 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
|
327 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
328 | case PROP_ACCOUNT: |
|
34780
3cf3800ed151
changed _pointer GValue calls to _object for PurpleAccount
Ankit Vani <a@nevitus.org>
parents:
34532
diff
changeset
|
329 | media->priv->account = g_value_get_object(value); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
330 | break; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
331 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
332 | media->priv->conference_type = |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
333 | 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
|
334 | 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
|
335 | 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
|
336 | 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
|
337 | "conference-type", |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
338 | 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
|
339 | "media", media, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
340 | 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
|
341 | 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
|
342 | "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
|
343 | 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
|
344 | 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
|
345 | media); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
346 | 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
|
347 | "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
|
348 | 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
|
349 | 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
|
350 | media); |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
351 | 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
|
352 | "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
|
353 | 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
|
354 | 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
|
355 | media); |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
356 | 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
|
357 | "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
|
358 | 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
|
359 | 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
|
360 | media); |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
361 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
362 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
363 | media->priv->initiator = g_value_get_boolean(value); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
364 | break; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
365 | case PROP_PROTOCOL_DATA: |
|
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
366 | media->priv->protocol_data = g_value_get_pointer(value); |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
367 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
368 | default: |
| 19883 | 369 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 370 | break; | |
| 371 | } | |
| 372 | } | |
| 373 | ||
| 374 | static void | |
| 375 | purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 376 | { | |
| 377 | PurpleMedia *media; | |
| 378 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
379 | |
| 19883 | 380 | media = PURPLE_MEDIA(object); |
| 381 | ||
| 382 | 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
|
383 | 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
|
384 | 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
|
385 | break; |
|
29624
bb4169591b6c
Add a read only property to PurpleMedia to retrieve the MediaBackend object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29620
diff
changeset
|
386 | 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
|
387 | 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
|
388 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
389 | case PROP_ACCOUNT: |
|
34780
3cf3800ed151
changed _pointer GValue calls to _object for PurpleAccount
Ankit Vani <a@nevitus.org>
parents:
34532
diff
changeset
|
390 | g_value_set_object(value, media->priv->account); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
391 | break; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
392 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
393 | g_value_set_string(value, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
394 | media->priv->conference_type); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
395 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
396 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
397 | g_value_set_boolean(value, media->priv->initiator); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
398 | break; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
399 | case PROP_PROTOCOL_DATA: |
|
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
400 | g_value_set_pointer(value, media->priv->protocol_data); |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
401 | break; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
402 | default: |
|
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
403 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 19883 | 404 | break; |
| 405 | } | |
| 406 | ||
| 407 | } | |
| 408 | ||
|
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
|
409 | 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
|
410 | 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
|
411 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
412 | 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
|
413 | 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
|
414 | 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
|
415 | } |
|
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
|
416 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
417 | static PurpleMediaStream* |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
418 | 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
|
419 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
420 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
421 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
422 | 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
|
423 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
424 | streams = media->priv->streams; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
425 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
426 | for (; streams; streams = g_list_next(streams)) { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
427 | PurpleMediaStream *stream = streams->data; |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
36322
diff
changeset
|
428 | if (purple_strequal(stream->session->id, session) && |
|
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
36322
diff
changeset
|
429 | purple_strequal(stream->participant, participant)) |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
430 | return stream; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
431 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
432 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
433 | 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
|
434 | } |
|
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
|
435 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
436 | static GList * |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
437 | 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
|
438 | const gchar *participant) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
439 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
440 | GList *streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
441 | GList *ret = NULL; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
442 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
443 | 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
|
444 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
445 | streams = media->priv->streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
446 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
447 | 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
|
448 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
449 | if ((session == NULL || |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
36322
diff
changeset
|
450 | purple_strequal(stream->session->id, session)) && |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
451 | (participant == NULL || |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
36322
diff
changeset
|
452 | purple_strequal(stream->participant, participant))) |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
453 | 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
|
454 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
455 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
456 | return ret; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
457 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
458 | |
|
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
|
459 | 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
|
460 | 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
|
461 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
462 | 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
|
463 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
464 | |
|
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
|
465 | 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
|
466 | 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
|
467 | 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
|
468 | 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
|
469 | } |
|
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 | 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
|
471 | } |
|
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 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
473 | static PurpleMediaStream * |
|
29596
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
474 | purple_media_insert_stream(PurpleMediaSession *session, |
|
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
475 | 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
|
476 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
477 | PurpleMediaStream *media_stream; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30715
diff
changeset
|
478 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
479 | 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
|
480 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
481 | media_stream = g_new0(PurpleMediaStream, 1); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
482 | media_stream->participant = g_strdup(name); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
483 | media_stream->session = session; |
|
29596
68839041e678
Remove FsStream from PurpleMedia stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
29595
diff
changeset
|
484 | 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
|
485 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
486 | session->media->priv->streams = |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
487 | 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
|
488 | |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
489 | 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
|
490 | } |
|
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 | 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
|
493 | 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
|
494 | 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
|
495 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
496 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
497 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
498 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
499 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
500 | 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
|
501 | 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
|
502 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
503 | #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
|
504 | |
|
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
|
505 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
506 | 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
|
507 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
508 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
509 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
| 26332 | 510 | return media->priv->sessions != NULL ? |
| 511 | 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
|
512 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
513 | 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
|
514 | #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
|
515 | } |
|
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 | |
|
37911
4a3d2c5fc856
media: clear USE_GSTREAMER macro from V&V source files
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37525
diff
changeset
|
517 | #ifdef USE_VV |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
518 | 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
|
519 | 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
|
520 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
521 | 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
|
522 | |
| 41247 | 523 | return NULL; |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
524 | } |
|
37911
4a3d2c5fc856
media: clear USE_GSTREAMER macro from V&V source files
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37525
diff
changeset
|
525 | #endif /* USE_VV */ |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
526 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
527 | PurpleAccount * |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
528 | purple_media_get_account(PurpleMedia *media) |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
529 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
530 | #ifdef USE_VV |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
531 | PurpleAccount *account; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
532 | 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
|
533 | 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
|
534 | 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
|
535 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
536 | 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
|
537 | #endif |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
538 | } |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
539 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
540 | gpointer |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
541 | purple_media_get_protocol_data(PurpleMedia *media) |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
542 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
543 | #ifdef USE_VV |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
544 | gpointer protocol_data; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
545 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
546 | g_object_get(G_OBJECT(media), "protocol-data", &protocol_data, NULL); |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
547 | return protocol_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
|
548 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
549 | 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
|
550 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
551 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
552 | |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
553 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
34780
diff
changeset
|
554 | purple_media_set_protocol_data(PurpleMedia *media, gpointer protocol_data) |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
555 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
556 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
557 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36545
diff
changeset
|
558 | g_object_set(G_OBJECT(media), "protocol-data", protocol_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
|
559 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
560 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
561 | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
562 | void |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
563 | purple_media_error(PurpleMedia *media, const gchar *error, ...) |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
564 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
565 | #ifdef USE_VV |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
566 | va_list args; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
567 | gchar *message; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
568 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
569 | 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
|
570 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
571 | va_start(args, error); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
572 | message = g_strdup_vprintf(error, args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
573 | va_end(args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
574 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
575 | 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
|
576 | 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
|
577 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
578 | 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
|
579 | #endif |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
580 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
581 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
582 | void |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
583 | 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
|
584 | 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
|
585 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
586 | #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
|
587 | 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
|
588 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
589 | 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
|
590 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
591 | 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
|
592 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
593 | /* 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
|
594 | 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
|
595 | 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
|
596 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
597 | 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
|
598 | 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
|
599 | 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
|
600 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
601 | 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
|
602 | 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
|
603 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
604 | 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
|
605 | 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
|
606 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
607 | 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
|
608 | (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
|
609 | 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
|
610 | 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
|
611 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
612 | 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
|
613 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
614 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
615 | 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
|
616 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
617 | /* 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
|
618 | 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
|
619 | 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
|
620 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
621 | 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
|
622 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
623 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
624 | /* 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
|
625 | 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
|
626 | 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
|
627 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
628 | 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
|
629 | 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
|
630 | 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
|
631 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
632 | 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
|
633 | 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
|
634 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
635 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
636 | 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
|
637 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
638 | /* 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
|
639 | 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
|
640 | 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
|
641 | GList *tmp; |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
642 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
643 | 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
|
644 | 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
|
645 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
646 | 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
|
647 | 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
|
648 | 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
|
649 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
650 | } |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
651 | |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
652 | /* 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
|
653 | 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
|
654 | 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
|
655 | gchar *participant = participants->data; |
|
29616
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
656 | 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
|
657 | participant, (GCompareFunc)strcmp); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
658 | |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
659 | 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
|
660 | 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
|
661 | NULL, participant); |
|
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
662 | |
|
29616
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
663 | if (link != NULL) { |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
664 | g_free(link->data); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
665 | media->priv->participants = g_list_delete_link( |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
666 | media->priv->participants, link); |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
667 | } |
|
a1de7592cbeb
Free participants properly in purple_media_end.
Michael Ruprecht <maiku@pidgin.im>
parents:
29615
diff
changeset
|
668 | |
|
29611
5db091a5ecba
Emit PURPLE_MEDIA_END state-changed signals for each stream, session, and
Michael Ruprecht <maiku@pidgin.im>
parents:
29610
diff
changeset
|
669 | 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
|
670 | } |
|
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 | /* 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
|
673 | 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
|
674 | 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
|
675 | 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
|
676 | 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
|
677 | NULL, NULL); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
678 | 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
|
679 | return; |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
680 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
681 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
682 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
683 | |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
684 | void |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
685 | 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
|
686 | 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
|
687 | gboolean local) |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
688 | { |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
689 | #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
|
690 | 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
|
691 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
692 | 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
|
693 | GList *streams, *sessions = NULL, *participants = NULL; |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
694 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
695 | 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
|
696 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
697 | streams = purple_media_get_streams(media, |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
698 | session_id, participant); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
699 | |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
700 | /* Emit stream acceptance */ |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
701 | for (; streams; streams = |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
702 | g_list_delete_link(streams, streams)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
703 | 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
|
704 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
705 | 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
|
706 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
707 | 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
|
708 | 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
|
709 | 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
|
710 | 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
|
711 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
712 | 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
|
713 | 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
|
714 | 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
|
715 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
716 | 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
|
717 | 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
|
718 | (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
|
719 | 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
|
720 | g_strdup(stream->participant)); |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
721 | } |
|
29612
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
722 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
723 | /* 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
|
724 | 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
|
725 | 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
|
726 | 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
|
727 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
728 | 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
|
729 | 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
|
730 | 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
|
731 | 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
|
732 | 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
|
733 | } |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
734 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
735 | /* 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
|
736 | 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
|
737 | 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
|
738 | 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
|
739 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
740 | 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
|
741 | 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
|
742 | 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
|
743 | 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
|
744 | 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
|
745 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
746 | 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
|
747 | } |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
748 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
749 | /* 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
|
750 | 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
|
751 | 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
|
752 | 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
|
753 | 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
|
754 | 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
|
755 | |
|
16566d534681
Have PURPLE_MEDIA_INFO_ACCEPT in stream-info emit for each accepted stream,
Michael Ruprecht <maiku@pidgin.im>
parents:
29611
diff
changeset
|
756 | return; |
|
29613
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
757 | } 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
|
758 | 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
|
759 | 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
|
760 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
761 | 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
|
762 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
763 | 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
|
764 | 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
|
765 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
766 | /* 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
|
767 | 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
|
768 | 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
|
769 | 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
|
770 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
771 | 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
|
772 | 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
|
773 | 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
|
774 | 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
|
775 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
776 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
777 | 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
|
778 | /* 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
|
779 | } 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
|
780 | /* 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
|
781 | 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
|
782 | 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
|
783 | |
|
1050e4cac667
Fix two assertions related to no sessions being created for the media object.
Michael Ruprecht <maiku@pidgin.im>
parents:
29624
diff
changeset
|
784 | 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
|
785 | 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
|
786 | 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
|
787 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
788 | /* 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
|
789 | 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
|
790 | sessions, sessions)) { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
791 | 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
|
792 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
793 | 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
|
794 | 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
|
795 | 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
|
796 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
797 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
798 | /* 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
|
799 | for (; participants; participants = |
|
29617
3cc3d60ee573
Keep track of participants better in purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
29616
diff
changeset
|
800 | 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
|
801 | 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
|
802 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
803 | 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
|
804 | 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
|
805 | 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
|
806 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
807 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
808 | /* 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
|
809 | 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
|
810 | 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
|
811 | 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
|
812 | } 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
|
813 | /* 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
|
814 | PurpleMediaSession *session = |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
815 | 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
|
816 | 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
|
817 | |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
818 | 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
|
819 | 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
|
820 | "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
|
821 | " 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
|
822 | } else { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
823 | 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
|
824 | 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
|
825 | 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
|
826 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
827 | } 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
|
828 | /* 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
|
829 | 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
|
830 | 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
|
831 | 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
|
832 | "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
|
833 | " 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
|
834 | } else { |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
835 | 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
|
836 | 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
|
837 | participant, local); |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
838 | } |
|
1f9726246a7c
Emit stream-info for each stream, session, and participant for hangup and
Michael Ruprecht <maiku@pidgin.im>
parents:
29612
diff
changeset
|
839 | } |
|
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 | 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
|
842 | return; |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
843 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
844 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
845 | 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
|
846 | 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
|
847 | #endif |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
848 | } |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
849 | |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
850 | void |
|
41146
d1a4975ae036
Use fs_stream_set_transmitter_ht
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40890
diff
changeset
|
851 | purple_media_set_params(PurpleMedia *media, GHashTable *params) |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
852 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
853 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
854 | 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
|
855 | |
|
41146
d1a4975ae036
Use fs_stream_set_transmitter_ht
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40890
diff
changeset
|
856 | purple_media_backend_set_params(media->priv->backend, params); |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
857 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
858 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
859 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
860 | const gchar ** |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
861 | 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
|
862 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
863 | 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
|
864 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
865 | 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
|
866 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
867 | 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
|
868 | #else |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
869 | return NULL_ARRAY; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
870 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
871 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
872 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
873 | gboolean |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
874 | 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
|
875 | { |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
876 | #ifdef USE_VV |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
877 | const gchar **params; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
878 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
879 | 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
|
880 | 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
|
881 | |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
882 | 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
|
883 | for (; *params != NULL; ++params) |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
36322
diff
changeset
|
884 | if (purple_strequal(*params, param)) |
|
31687
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
885 | return TRUE; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
886 | #endif |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
887 | return FALSE; |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
888 | } |
|
4877d06f3234
media: Allow setting SDES properties of RTP conferences. Fixes #12981.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31318
diff
changeset
|
889 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
890 | #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
|
891 | 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
|
892 | 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
|
893 | 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
|
894 | 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
|
895 | { |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
896 | 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
|
897 | 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
|
898 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
899 | 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
|
900 | 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
|
901 | |
|
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
|
902 | 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
|
903 | 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
|
904 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
905 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
906 | 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
|
907 | 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
|
908 | 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
|
909 | { |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
910 | PurpleMediaStream *stream_data; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
911 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
912 | 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
|
913 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
914 | 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
|
915 | stream_data->candidates_prepared = TRUE; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
916 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
917 | 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
|
918 | 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
|
919 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
920 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
921 | /* 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
|
922 | * 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
|
923 | 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
|
924 | 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
|
925 | 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
|
926 | 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
|
927 | 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
|
928 | 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
|
929 | { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
930 | PurpleMediaStream *stream; |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
931 | 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
|
932 | guint id; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
933 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
934 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
935 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
936 | 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
|
937 | id = purple_media_candidate_get_component_id(local_candidate); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
938 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
939 | iter = stream->active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
940 | 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
|
941 | 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
|
942 | 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
|
943 | g_object_unref(c); |
|
40265
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
944 | stream->active_local_candidates = g_list_delete_link( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
945 | stream->active_local_candidates, |
|
40265
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
946 | iter); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
947 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
948 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
949 | } |
|
40265
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
950 | stream->active_local_candidates = g_list_prepend( |
|
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
951 | stream->active_local_candidates, |
|
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
952 | purple_media_candidate_copy( |
|
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
953 | local_candidate)); |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
954 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
955 | 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
|
956 | |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
957 | iter = stream->active_remote_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
958 | 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
|
959 | 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
|
960 | 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
|
961 | g_object_unref(c); |
|
40265
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
962 | stream->active_remote_candidates = g_list_delete_link( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
963 | stream->active_remote_candidates, |
|
40265
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
964 | iter); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
965 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
966 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
967 | } |
|
40265
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
968 | stream->active_remote_candidates = g_list_prepend( |
|
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
969 | stream->active_remote_candidates, |
|
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
970 | purple_media_candidate_copy( |
|
03bafaff77dd
fix some other memory leaks
Fabrice Bellet <fabrice@bellet.info>
parents:
40264
diff
changeset
|
971 | 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
|
972 | |
|
36322
88b09a22b7c4
media: Send a signal when a candidate pair is established
Youness Alaoui <kakaroto@kakaroto.homelinux.net>
parents:
36321
diff
changeset
|
973 | 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
|
974 | 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
|
975 | 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
|
976 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
977 | |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
978 | 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
|
979 | 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
|
980 | 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
|
981 | { |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
982 | 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
|
983 | } |
|
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
|
984 | #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
|
985 | |
|
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
|
986 | 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
|
987 | purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, |
|
41146
d1a4975ae036
Use fs_stream_set_transmitter_ht
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40890
diff
changeset
|
988 | const gchar *who, PurpleMediaSessionType type, gboolean initiator, |
|
d1a4975ae036
Use fs_stream_set_transmitter_ht
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40890
diff
changeset
|
989 | const gchar *transmitter, GHashTable *params) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
990 | { |
|
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
|
991 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
992 | 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
|
993 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
994 | 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
|
995 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
996 | if (!purple_media_backend_add_stream(media->priv->backend, |
|
41146
d1a4975ae036
Use fs_stream_set_transmitter_ht
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40890
diff
changeset
|
997 | sess_id, who, type, initiator, transmitter, params)) |
|
d1a4975ae036
Use fs_stream_set_transmitter_ht
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40890
diff
changeset
|
998 | { |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
999 | 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
|
1000 | return FALSE; |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1001 | } |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1002 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1003 | 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
|
1004 | |
|
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
|
1005 | 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
|
1006 | 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
|
1007 | 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
|
1008 | 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
|
1009 | session->type = type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1010 | 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
|
1011 | |
|
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
|
1012 | purple_media_add_session(media, session); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1013 | 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
|
1014 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1015 | 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
|
1016 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1017 | |
|
29618
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1018 | 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
|
1019 | who, (GCompareFunc)strcmp)) { |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1020 | media->priv->participants = g_list_prepend( |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1021 | media->priv->participants, g_strdup(who)); |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1022 | |
|
33840
3d6440551829
Remove unnecessary signal name lookup.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32109
diff
changeset
|
1023 | g_signal_emit(media, purple_media_signals[STATE_CHANGED], 0, |
|
29618
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1024 | PURPLE_MEDIA_STATE_NEW, NULL, who); |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1025 | } |
|
8a6d81118ec6
Move new stream emission back to media.c
Michael Ruprecht <maiku@pidgin.im>
parents:
29617
diff
changeset
|
1026 | |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
1027 | 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
|
1028 | purple_media_insert_stream(session, who, initiator); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1029 | |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1030 | 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
|
1031 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1032 | 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
|
1033 | } |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1034 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1035 | 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
|
1036 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1037 | 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
|
1038 | #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
|
1039 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1040 | |
|
26523
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1041 | PurpleMediaManager * |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1042 | purple_media_get_manager(PurpleMedia *media) |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1043 | { |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1044 | PurpleMediaManager *ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1045 | 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
|
1046 | g_object_get(media, "manager", &ret, NULL); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1047 | return ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1048 | } |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1049 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
1050 | 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
|
1051 | 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
|
1052 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1053 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1054 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1055 | 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
|
1056 | 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
|
1057 | 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
|
1058 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1059 | 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
|
1060 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1061 | } |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1062 | /* 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
|
1063 | GList * |
|
26160
46bc5e18d59c
Combine get_*_codecs functions to mirror Farsight 2.
Michael Ruprecht <maiku@pidgin.im>
parents:
26151
diff
changeset
|
1064 | 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
|
1065 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1066 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1067 | 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
|
1068 | |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29584
diff
changeset
|
1069 | 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
|
1070 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1071 | 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
|
1072 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1073 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1074 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1075 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1076 | 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
|
1077 | 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
|
1078 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1079 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1080 | 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
|
1081 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1082 | 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
|
1083 | 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
|
1084 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1085 | 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
|
1086 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1087 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1088 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1089 | 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
|
1090 | 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
|
1091 | const gchar *participant, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1092 | 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
|
1093 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1094 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1095 | PurpleMediaStream *stream; |
|
26258
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1096 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1097 | 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
|
1098 | 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
|
1099 | |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1100 | 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
|
1101 | 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
|
1102 | "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
|
1103 | "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
|
1104 | 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
|
1105 | 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
|
1106 | return; |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1107 | } |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1108 | |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
1109 | 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
|
1110 | purple_media_candidate_list_copy(remote_candidates)); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1111 | |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1112 | 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
|
1113 | 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
|
1114 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1115 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1116 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1117 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1118 | 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
|
1119 | 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
|
1120 | { |
|
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 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1122 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1123 | 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
|
1124 | 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
|
1125 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1126 | 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
|
1127 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1128 | 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
|
1129 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1130 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1131 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1132 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1133 | 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
|
1134 | 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
|
1135 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1136 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1137 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1138 | 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
|
1139 | 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
|
1140 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1141 | 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
|
1142 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1143 | 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
|
1144 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1145 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1146 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1147 | gboolean |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1148 | 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
|
1149 | 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
|
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), FALSE); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1153 | |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
1154 | 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
|
1155 | 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
|
1156 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1157 | 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
|
1158 | #endif |
|
23697
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 | |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1161 | gboolean |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1162 | purple_media_candidates_prepared(PurpleMedia *media, |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1163 | 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
|
1164 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1165 | #ifdef USE_VV |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1166 | GList *streams; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1167 | gboolean prepared = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1168 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1169 | 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
|
1170 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1171 | 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
|
1172 | |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1173 | 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
|
1174 | PurpleMediaStream *stream = streams->data; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1175 | if (stream->candidates_prepared == FALSE) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1176 | g_list_free(streams); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1177 | prepared = FALSE; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1178 | break; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1179 | } |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1180 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1181 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1182 | 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
|
1183 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1184 | 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
|
1185 | #endif |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1186 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1187 | |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1188 | gboolean |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1189 | 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
|
1190 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1191 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1192 | 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
|
1193 | |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
1194 | 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
|
1195 | 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
|
1196 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1197 | 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
|
1198 | #endif |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1199 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1200 | |
|
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
|
1201 | gboolean |
|
36318
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1202 | 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
|
1203 | const gchar *cipher, const gchar *auth, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1204 | const gchar *key, gsize key_len) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1205 | { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1206 | #ifdef USE_VV |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1207 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1208 | return purple_media_backend_set_encryption_parameters(media->priv->backend, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1209 | sess_id, cipher, auth, key, key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1210 | #else |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1211 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1212 | #endif |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1213 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1214 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1215 | gboolean |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1216 | 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
|
1217 | const gchar *participant, const gchar *cipher, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1218 | const gchar *auth, const gchar *key, gsize key_len) |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1219 | { |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1220 | #ifdef USE_VV |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1221 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1222 | return purple_media_backend_set_decryption_parameters(media->priv->backend, |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1223 | sess_id, participant, cipher, auth, key, key_len); |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1224 | #else |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1225 | return FALSE; |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1226 | #endif |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1227 | } |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1228 | |
|
a0906e7a6bae
Implement media encryption
Jakub Adam <jakub.adam@ktknet.cz>
parents:
36312
diff
changeset
|
1229 | gboolean |
|
40268
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1230 | purple_media_set_require_encryption(PurpleMedia *media, const gchar *sess_id, |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1231 | const gchar *participant, gboolean require_encryption) |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1232 | { |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1233 | #ifdef USE_VV |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1234 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1235 | return purple_media_backend_set_require_encryption(media->priv->backend, |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1236 | sess_id, participant, require_encryption); |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1237 | #else |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1238 | return FALSE; |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1239 | #endif |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1240 | } |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1241 | |
|
a7be471404ba
Port purple_media_set_require_encryption api
Fabrice Bellet <fabrice@bellet.info>
parents:
40062
diff
changeset
|
1242 | 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
|
1243 | 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
|
1244 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1245 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1246 | 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
|
1247 | |
|
29597
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29596
diff
changeset
|
1248 | return purple_media_backend_codecs_ready( |
|
22843326ee22
Add codecs_ready to the media backend interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
29596
diff
changeset
|
1249 | 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
|
1250 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1251 | 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
|
1252 | #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
|
1253 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1254 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1255 | 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
|
1256 | 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
|
1257 | 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
|
1258 | { |
|
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
|
1259 | #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
|
1260 | 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
|
1261 | |
|
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
|
1262 | 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
|
1263 | 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
|
1264 | #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
|
1265 | 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
|
1266 | #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
|
1267 | } |
|
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
|
1268 | |
|
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
|
1269 | gboolean |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1270 | purple_media_is_initiator(PurpleMedia *media, |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1271 | const gchar *sess_id, const gchar *participant) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1272 | { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1273 | #ifdef USE_VV |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1274 | 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
|
1275 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1276 | if (sess_id == NULL && participant == NULL) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1277 | return media->priv->initiator; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1278 | else if (sess_id != NULL && participant == NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1279 | PurpleMediaSession *session = |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1280 | purple_media_get_session(media, sess_id); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1281 | return session != NULL ? session->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1282 | } else if (sess_id != NULL && participant != NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1283 | PurpleMediaStream *stream = purple_media_get_stream( |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1284 | media, sess_id, participant); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1285 | return stream != NULL ? stream->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1286 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1287 | #endif |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1288 | return FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1289 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1290 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1291 | gboolean |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1292 | 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
|
1293 | 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
|
1294 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1295 | #ifdef USE_VV |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1296 | gboolean accepted = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1297 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1298 | 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
|
1299 | |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1300 | 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
|
1301 | GList *streams = media->priv->streams; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1302 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1303 | 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
|
1304 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1305 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1306 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1307 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1308 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1309 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1310 | } 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
|
1311 | 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
|
1312 | media, sess_id, NULL); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1313 | for (; streams; streams = |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1314 | 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
|
1315 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1316 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1317 | g_list_free(streams); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1318 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1319 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1320 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1321 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1322 | } 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
|
1323 | 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
|
1324 | media, sess_id, participant); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1325 | 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
|
1326 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1327 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1328 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1329 | 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
|
1330 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1331 | 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
|
1332 | #endif |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1333 | } |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1334 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1335 | 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
|
1336 | 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
|
1337 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1338 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1339 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1340 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1341 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1342 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1343 | 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
|
1344 | 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
|
1345 | double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1346 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1347 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1348 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1349 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1350 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1351 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1352 | gulong |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1353 | purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, |
|
40547
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40523
diff
changeset
|
1354 | const gchar *participant) |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1355 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1356 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1357 | 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
|
1358 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1359 | return purple_media_manager_set_output_window(media->priv->manager, |
|
40547
86e0c5080a58
vv: Switch to GTK sinks by default.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40523
diff
changeset
|
1360 | media, session_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
|
1361 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1362 | 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
|
1363 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1364 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1365 | |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1366 | void |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1367 | 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
|
1368 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1369 | #ifdef USE_VV |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1370 | GList *iter = media->priv->streams; |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1371 | 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
|
1372 | 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
|
1373 | 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
|
1374 | media->priv->manager, media, |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1375 | stream->session->id, stream->participant); |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1376 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1377 | |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1378 | 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
|
1379 | 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
|
1380 | 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
|
1381 | 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
|
1382 | 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
|
1383 | session_name, NULL); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1384 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1385 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1386 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1387 | |
|
37911
4a3d2c5fc856
media: clear USE_GSTREAMER macro from V&V source files
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37525
diff
changeset
|
1388 | #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
|
1389 | GstElement * |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1390 | 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
|
1391 | 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
|
1392 | { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1393 | 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
|
1394 | |
| 41247 | 1395 | return NULL; |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1396 | } |
|
37911
4a3d2c5fc856
media: clear USE_GSTREAMER macro from V&V source files
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37525
diff
changeset
|
1397 | #endif /* USE_VV */ |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1398 | |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1399 | gboolean |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1400 | 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
|
1401 | 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
|
1402 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1403 | #ifdef USE_VV |
|
39757
4a5ba806d8c9
Rename *Iface to more standard names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39259
diff
changeset
|
1404 | PurpleMediaBackendInterface *backend_iface = NULL; |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1405 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1406 | if (media) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1407 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1408 | 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
|
1409 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1410 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1411 | 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
|
1412 | dtmf = 'A'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1413 | 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
|
1414 | dtmf = 'B'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1415 | 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
|
1416 | dtmf = 'C'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1417 | 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
|
1418 | dtmf = 'D'; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1419 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1420 | 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
|
1421 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1422 | 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
|
1423 | && 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
|
1424 | 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
|
1425 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1426 | return TRUE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1427 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1428 | #endif |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1429 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32109
diff
changeset
|
1430 | } |