Tue, 27 Oct 2009 18:34:46 +0000
Move odd direction changing functionality to the Fs2 media backend.
| 19883 | 1 | /** |
| 19889 | 2 | * @file media.c Media API |
| 19883 | 3 | * @ingroup core |
|
26105
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
4 | */ |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
5 | |
|
7647c0dcf202
* Added documentation to media.h and mediamanager.h
Michael Ruprecht <maiku@pidgin.im>
parents:
26103
diff
changeset
|
6 | /* purple |
| 19883 | 7 | * |
| 8 | * Purple is the legal property of its developers, whose names are too numerous | |
| 9 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 10 | * source distribution. | |
| 11 | * | |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
28321
c8d617c408ab
Update various header copyrights thanks to licensecheck.
Paul Aurich <darkrain42@pidgin.im>
parents:
28162
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 19883 | 25 | */ |
| 26 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
27 | #include <string.h> |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
28 | |
| 19889 | 29 | #include "internal.h" |
| 30 | ||
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
31 | #include "account.h" |
| 19883 | 32 | #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
|
33 | #include "media/backend-fs2.h" |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
34 | #include "media/backend-iface.h" |
|
26115
5f0500efc781
* Added input/output volume preferences for voice conversations.
Michael Ruprecht <maiku@pidgin.im>
parents:
26112
diff
changeset
|
35 | #include "mediamanager.h" |
|
26256
d2673c935184
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <malu@pidgin.im>
parents:
26253
diff
changeset
|
36 | #include "network.h" |
| 19883 | 37 | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22071
diff
changeset
|
38 | #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
|
39 | |
|
26771
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
40 | #ifdef USE_GSTREAMER |
|
26792
17140fe8c2f6
Include the media API on win32 even though it isn't actually enabled.
Daniel Atallah <datallah@pidgin.im>
parents:
26771
diff
changeset
|
41 | #include "marshallers.h" |
|
26771
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
42 | #include "media-gst.h" |
|
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
43 | #endif |
|
8c52ced3620c
Fix build with --disable-vv --enable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26760
diff
changeset
|
44 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
45 | #ifdef USE_VV |
| 19883 | 46 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
47 | #include <gst/farsight/fs-conference-iface.h> |
|
27202
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
48 | #include <gst/farsight/fs-element-added-notifier.h> |
| 19883 | 49 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
50 | /** @copydoc _PurpleMediaSession */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
51 | typedef struct _PurpleMediaSession PurpleMediaSession; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
52 | /** @copydoc _PurpleMediaStream */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
53 | typedef struct _PurpleMediaStream PurpleMediaStream; |
|
26621
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
54 | /** @copydoc _PurpleMediaClass */ |
|
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
55 | typedef struct _PurpleMediaClass PurpleMediaClass; |
|
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
56 | /** @copydoc _PurpleMediaPrivate */ |
|
e23e3a6d7140
Hide these typedefs too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26620
diff
changeset
|
57 | typedef struct _PurpleMediaPrivate PurpleMediaPrivate; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
58 | |
|
26613
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
59 | /** The media class */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
60 | struct _PurpleMediaClass |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
61 | { |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
62 | GObjectClass parent_class; /**< The parent class. */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
63 | }; |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
64 | |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
65 | /** The media class's private data */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
66 | struct _PurpleMedia |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
67 | { |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
68 | GObject parent; /**< The parent of this object. */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
69 | PurpleMediaPrivate *priv; /**< The private data of this object. */ |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
70 | }; |
|
6918ed4d1e4c
Hide the easy structs in media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
71 | |
|
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
|
72 | 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
|
73 | { |
|
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
|
74 | 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
|
75 | PurpleMedia *media; |
|
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
|
76 | GstElement *src; |
|
26321
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
77 | GstElement *tee; |
|
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
|
78 | FsSession *session; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
79 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
80 | PurpleMediaSessionType type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
81 | 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
|
82 | }; |
|
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
|
83 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
84 | struct _PurpleMediaStream |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
85 | { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
86 | PurpleMediaSession *session; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
87 | gchar *participant; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
88 | FsStream *stream; |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
89 | GstElement *src; |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
90 | GstElement *tee; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
91 | GstElement *volume; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
92 | GstElement *level; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
93 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
94 | GList *local_candidates; |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
95 | GList *remote_candidates; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
96 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
97 | gboolean initiator; |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
98 | gboolean accepted; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
99 | gboolean candidates_prepared; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
100 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
101 | GList *active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
102 | GList *active_remote_candidates; |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
103 | |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
104 | guint connected_cb_id; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
105 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
106 | #endif |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
107 | |
| 19883 | 108 | struct _PurpleMediaPrivate |
| 109 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
110 | #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
|
111 | PurpleMediaManager *manager; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
112 | PurpleAccount *account; |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
113 | PurpleMediaBackend *backend; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
114 | FsConference *conference; |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
115 | gchar *conference_type; |
|
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
|
116 | gulong gst_bus_handler_id; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
117 | gboolean initiator; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
118 | gpointer prpl_data; |
| 19883 | 119 | |
|
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
|
120 | GHashTable *sessions; /* PurpleMediaSession table */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
121 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
122 | GList *streams; /* PurpleMediaStream table */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
123 | |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
124 | GstElement *confbin; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
125 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
126 | 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
|
127 | #endif |
| 19883 | 128 | }; |
| 129 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
130 | #ifdef USE_VV |
| 19883 | 131 | #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) |
| 132 | ||
| 133 | static void purple_media_class_init (PurpleMediaClass *klass); | |
| 134 | static void purple_media_init (PurpleMedia *media); | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
135 | static void purple_media_dispose (GObject *object); |
| 19883 | 136 | static void purple_media_finalize (GObject *object); |
| 137 | static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 138 | static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
| 139 | ||
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
140 | 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
|
141 | 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
|
142 | 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
|
143 | 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
|
144 | 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
|
145 | 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
|
146 | 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
|
147 | 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
|
148 | 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
|
149 | 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
|
150 | 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
|
151 | 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
|
152 | const gchar *sess_id, PurpleMedia *media); |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
153 | static gboolean media_bus_call(GstBus *bus, |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
154 | GstMessage *msg, PurpleMedia *media); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
155 | |
| 19883 | 156 | static GObjectClass *parent_class = NULL; |
| 157 | ||
| 158 | ||
| 159 | ||
| 160 | enum { | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
161 | S_ERROR, |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
162 | CANDIDATES_PREPARED, |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
163 | CODECS_CHANGED, |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
164 | 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
|
165 | NEW_CANDIDATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
166 | STATE_CHANGED, |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
167 | STREAM_INFO, |
| 19883 | 168 | LAST_SIGNAL |
| 169 | }; | |
| 170 | static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
| 171 | ||
| 172 | enum { | |
| 173 | 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
|
174 | PROP_MANAGER, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
175 | PROP_ACCOUNT, |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
176 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
177 | PROP_CONFERENCE, |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
178 | #endif |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
179 | PROP_CONFERENCE_TYPE, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
180 | PROP_INITIATOR, |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
181 | PROP_PRPL_DATA, |
| 19883 | 182 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
183 | #endif |
| 19883 | 184 | |
|
26618
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
185 | |
| 19883 | 186 | GType |
| 187 | purple_media_get_type() | |
| 188 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
189 | #ifdef USE_VV |
| 19883 | 190 | static GType type = 0; |
| 191 | ||
| 192 | if (type == 0) { | |
| 193 | static const GTypeInfo info = { | |
| 194 | sizeof(PurpleMediaClass), | |
| 195 | NULL, | |
| 196 | NULL, | |
| 197 | (GClassInitFunc) purple_media_class_init, | |
| 198 | NULL, | |
| 199 | NULL, | |
| 200 | sizeof(PurpleMedia), | |
| 201 | 0, | |
|
22071
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
202 | (GInstanceInitFunc) purple_media_init, |
|
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
203 | NULL |
| 19883 | 204 | }; |
| 205 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
| 206 | } | |
| 207 | return type; | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
208 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
209 | return G_TYPE_NONE; |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
210 | #endif |
| 19883 | 211 | } |
| 212 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
213 | #ifdef USE_VV |
| 19883 | 214 | static void |
| 215 | purple_media_class_init (PurpleMediaClass *klass) | |
| 216 | { | |
| 217 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
| 218 | parent_class = g_type_class_peek_parent(klass); | |
| 219 | ||
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
220 | gobject_class->dispose = purple_media_dispose; |
| 19883 | 221 | gobject_class->finalize = purple_media_finalize; |
| 222 | gobject_class->set_property = purple_media_set_property; | |
| 223 | gobject_class->get_property = purple_media_get_property; | |
| 224 | ||
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
225 | 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
|
226 | 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
|
227 | "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
|
228 | "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
|
229 | PURPLE_TYPE_MEDIA_MANAGER, |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
230 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
231 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
232 | g_object_class_install_property(gobject_class, PROP_ACCOUNT, |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
233 | g_param_spec_pointer("account", |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
234 | "PurpleAccount", |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
235 | "The account this media session is on.", |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
236 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
237 | |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
238 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
239 | g_object_class_install_property(gobject_class, PROP_CONFERENCE, |
|
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
240 | g_param_spec_object("conference", |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
241 | "Farsight conference", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
242 | "The FsConference associated with this media.", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
243 | FS_TYPE_CONFERENCE, |
|
26518
12a92156965d
Make the conference property write only.
Michael Ruprecht <maiku@pidgin.im>
parents:
26517
diff
changeset
|
244 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE)); |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
245 | #endif |
| 19883 | 246 | |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
247 | 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
|
248 | g_param_spec_string("conference-type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
249 | "Conference Type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
250 | "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
|
251 | "has been created to provide.", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
252 | NULL, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
253 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
254 | |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
255 | g_object_class_install_property(gobject_class, PROP_INITIATOR, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
256 | g_param_spec_boolean("initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
257 | "initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
258 | "If the local user initiated the conference.", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
259 | FALSE, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
260 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
261 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
262 | g_object_class_install_property(gobject_class, PROP_PRPL_DATA, |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
263 | g_param_spec_pointer("prpl-data", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
264 | "gpointer", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
265 | "Data the prpl plugin set on the media session.", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
266 | G_PARAM_READWRITE)); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
267 | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
268 | purple_media_signals[S_ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
269 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
270 | g_cclosure_marshal_VOID__STRING, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
271 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
272 | purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
273 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
274 | purple_smarshal_VOID__STRING_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
275 | G_TYPE_NONE, 2, G_TYPE_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
276 | G_TYPE_STRING); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
277 | purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass), |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
278 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
279 | g_cclosure_marshal_VOID__STRING, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
280 | 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
|
281 | purple_media_signals[LEVEL] = g_signal_new("level", G_TYPE_FROM_CLASS(klass), |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
282 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
283 | purple_smarshal_VOID__STRING_STRING_DOUBLE, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
284 | 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
|
285 | 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
|
286 | purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass), |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
287 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
288 | purple_smarshal_VOID__POINTER_POINTER_OBJECT, |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
289 | G_TYPE_NONE, 3, G_TYPE_POINTER, |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
290 | G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
291 | purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
292 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
293 | purple_smarshal_VOID__ENUM_STRING_STRING, |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
294 | 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
|
295 | G_TYPE_STRING, G_TYPE_STRING); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
296 | purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass), |
|
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
297 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
298 | purple_smarshal_VOID__ENUM_STRING_STRING_BOOLEAN, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
299 | 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
|
300 | G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
301 | g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
| 19883 | 302 | } |
| 303 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
304 | |
| 19883 | 305 | static void |
| 306 | purple_media_init (PurpleMedia *media) | |
| 307 | { | |
| 308 | media->priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
|
26406
9cd3c72d787d
Zero out the proper size for the PurpleMediaPrivate structure.
Michael Ruprecht <maiku@pidgin.im>
parents:
26340
diff
changeset
|
309 | memset(media->priv, 0, sizeof(*media->priv)); |
| 19883 | 310 | } |
| 311 | ||
| 312 | static void | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
313 | purple_media_stream_free(PurpleMediaStream *stream) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
314 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
315 | if (stream == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
316 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
317 | |
|
26280
9c7d0dc8268e
Set the purple_media_connected_cb timeout to a high priority and remove
Michael Ruprecht <maiku@pidgin.im>
parents:
26279
diff
changeset
|
318 | /* Remove the connected_cb timeout */ |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
319 | if (stream->connected_cb_id != 0) |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
320 | purple_timeout_remove(stream->connected_cb_id); |
|
26280
9c7d0dc8268e
Set the purple_media_connected_cb timeout to a high priority and remove
Michael Ruprecht <maiku@pidgin.im>
parents:
26279
diff
changeset
|
321 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
322 | g_free(stream->participant); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
323 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
324 | 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
|
325 | 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
|
326 | 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
|
327 | purple_media_candidate_list_free(stream->remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
328 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
329 | 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
|
330 | 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
|
331 | stream->active_local_candidates); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
332 | 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
|
333 | 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
|
334 | stream->active_remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
335 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
336 | g_free(stream); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
337 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
338 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
339 | static void |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
340 | purple_media_session_free(PurpleMediaSession *session) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
341 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
342 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
343 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
344 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
345 | g_free(session->id); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
346 | g_free(session); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
347 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
348 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
349 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
350 | purple_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
351 | { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
352 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
353 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
354 | purple_debug_info("media","purple_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
355 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
356 | 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
|
357 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
358 | if (priv->backend) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
359 | 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
|
360 | priv->backend = NULL; |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
361 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
362 | |
|
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
|
363 | if (priv->gst_bus_handler_id != 0) { |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
364 | GstElement *pipeline = purple_media_manager_get_pipeline( |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
365 | priv->manager); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
366 | GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
|
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
|
367 | g_signal_handler_disconnect(bus, priv->gst_bus_handler_id); |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
368 | gst_object_unref(bus); |
|
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
|
369 | priv->gst_bus_handler_id = 0; |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
370 | } |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
371 | |
|
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
|
372 | 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
|
373 | 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
|
374 | 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
|
375 | } |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
376 | |
| 26412 | 377 | G_OBJECT_CLASS(parent_class)->dispose(media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
378 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
379 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
380 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
381 | purple_media_finalize(GObject *media) |
| 19883 | 382 | { |
|
23711
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
383 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
384 | 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
|
385 | |
|
26181
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
386 | for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams)) |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
387 | purple_media_stream_free(priv->streams->data); |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
388 | |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
389 | if (priv->sessions) { |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
390 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
391 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
392 | purple_media_session_free(sessions->data); |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
393 | } |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
394 | g_hash_table_destroy(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
395 | } |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
396 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
397 | G_OBJECT_CLASS(parent_class)->finalize(media); |
| 19883 | 398 | } |
| 399 | ||
| 400 | static void | |
| 401 | purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
| 402 | { | |
| 403 | PurpleMedia *media; | |
| 404 | 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
|
405 | |
| 19883 | 406 | media = PURPLE_MEDIA(object); |
| 407 | ||
| 408 | 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
|
409 | 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
|
410 | 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
|
411 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
412 | case PROP_ACCOUNT: |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
413 | media->priv->account = g_value_get_pointer(value); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
414 | break; |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
415 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
416 | case PROP_CONFERENCE: { |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
417 | if (media->priv->conference) |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
418 | gst_object_unref(media->priv->conference); |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
419 | media->priv->conference = g_value_dup_object(value); |
| 19883 | 420 | break; |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
421 | } |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
422 | #endif |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
423 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
424 | media->priv->conference_type = |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
425 | 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
|
426 | /* Will eventually get this type from the media manager */ |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
427 | media->priv->backend = g_object_new( |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
428 | PURPLE_TYPE_MEDIA_BACKEND_FS2, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
429 | "conference-type", |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
430 | 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
|
431 | "media", media, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
432 | 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
|
433 | 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
|
434 | "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
|
435 | 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
|
436 | 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
|
437 | media); |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
438 | 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
|
439 | "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
|
440 | 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
|
441 | 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
|
442 | media); |
|
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
443 | 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
|
444 | "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
|
445 | 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
|
446 | 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
|
447 | media); |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
448 | 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
|
449 | "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
|
450 | 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
|
451 | 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
|
452 | media); |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
453 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
454 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
455 | media->priv->initiator = g_value_get_boolean(value); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
456 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
457 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
458 | media->priv->prpl_data = g_value_get_pointer(value); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
459 | break; |
| 19883 | 460 | default: |
| 461 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
| 462 | break; | |
| 463 | } | |
| 464 | } | |
| 465 | ||
| 466 | static void | |
| 467 | purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 468 | { | |
| 469 | PurpleMedia *media; | |
| 470 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
| 471 | ||
| 472 | media = PURPLE_MEDIA(object); | |
| 473 | ||
| 474 | 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
|
475 | 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
|
476 | 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
|
477 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
478 | case PROP_ACCOUNT: |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
479 | g_value_set_pointer(value, media->priv->account); |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
480 | break; |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
481 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
482 | case PROP_CONFERENCE: |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
483 | g_value_set_object(value, media->priv->conference); |
| 19883 | 484 | break; |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
485 | #endif |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
486 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
487 | g_value_set_string(value, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
488 | media->priv->conference_type); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
489 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
490 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
491 | g_value_set_boolean(value, media->priv->initiator); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
492 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
493 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
494 | g_value_set_pointer(value, media->priv->prpl_data); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
495 | break; |
| 19883 | 496 | default: |
| 497 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
| 498 | break; | |
| 499 | } | |
| 500 | ||
| 501 | } | |
| 502 | ||
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
503 | static FsMediaType |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
504 | purple_media_to_fs_media_type(PurpleMediaSessionType type) |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
505 | { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
506 | if (type & PURPLE_MEDIA_AUDIO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
507 | return FS_MEDIA_TYPE_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
508 | else if (type & PURPLE_MEDIA_VIDEO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
509 | return FS_MEDIA_TYPE_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
510 | else |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
511 | return 0; |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
512 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
513 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
514 | static FsStreamDirection |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
515 | purple_media_to_fs_stream_direction(PurpleMediaSessionType type) |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
516 | { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
517 | if ((type & PURPLE_MEDIA_AUDIO) == PURPLE_MEDIA_AUDIO || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
518 | (type & PURPLE_MEDIA_VIDEO) == PURPLE_MEDIA_VIDEO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
519 | return FS_DIRECTION_BOTH; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
520 | else if ((type & PURPLE_MEDIA_SEND_AUDIO) || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
521 | (type & PURPLE_MEDIA_SEND_VIDEO)) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
522 | return FS_DIRECTION_SEND; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
523 | else if ((type & PURPLE_MEDIA_RECV_AUDIO) || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
524 | (type & PURPLE_MEDIA_RECV_VIDEO)) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
525 | return FS_DIRECTION_RECV; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
526 | else |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
527 | return FS_DIRECTION_NONE; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
528 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
529 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
530 | static PurpleMediaSessionType |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
531 | purple_media_from_fs(FsMediaType type, FsStreamDirection direction) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
532 | { |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
533 | PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
534 | if (type == FS_MEDIA_TYPE_AUDIO) { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
535 | if (direction & FS_DIRECTION_SEND) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
536 | result |= PURPLE_MEDIA_SEND_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
537 | if (direction & FS_DIRECTION_RECV) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
538 | result |= PURPLE_MEDIA_RECV_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
539 | } else if (type == FS_MEDIA_TYPE_VIDEO) { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
540 | if (direction & FS_DIRECTION_SEND) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
541 | result |= PURPLE_MEDIA_SEND_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
542 | if (direction & FS_DIRECTION_RECV) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
543 | result |= PURPLE_MEDIA_RECV_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
544 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
545 | return result; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
546 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
547 | |
|
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
|
548 | 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
|
549 | 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
|
550 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
551 | 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
|
552 | 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
|
553 | 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
|
554 | } |
|
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
|
555 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
556 | static PurpleMediaStream* |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
557 | 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
|
558 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
559 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
560 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
561 | 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
|
562 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
563 | streams = media->priv->streams; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
564 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
565 | for (; streams; streams = g_list_next(streams)) { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
566 | PurpleMediaStream *stream = streams->data; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
567 | if (!strcmp(stream->session->id, session) && |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
568 | !strcmp(stream->participant, participant)) |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
569 | return stream; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
570 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
571 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
572 | 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
|
573 | } |
|
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
|
574 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
575 | static GList * |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
576 | 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
|
577 | const gchar *participant) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
578 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
579 | GList *streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
580 | GList *ret = NULL; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
581 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
582 | 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
|
583 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
584 | streams = media->priv->streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
585 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
586 | 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
|
587 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
588 | if ((session == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
589 | !strcmp(stream->session->id, session)) && |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
590 | (participant == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
591 | !strcmp(stream->participant, participant))) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
592 | 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
|
593 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
594 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
595 | return ret; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
596 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
597 | |
|
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
|
598 | 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
|
599 | 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
|
600 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
601 | 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
|
602 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
603 | |
|
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
|
604 | 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
|
605 | purple_debug_info("media", "Creating hash table for sessions\n"); |
|
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
|
606 | media->priv->sessions = g_hash_table_new(g_str_hash, g_str_equal); |
|
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
|
607 | } |
|
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
|
608 | 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
|
609 | } |
|
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
|
610 | |
| 29584 | 611 | #if 0 |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
612 | static gboolean |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
613 | purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
614 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
615 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
616 | return g_hash_table_remove(media->priv->sessions, session->id); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
617 | } |
| 29584 | 618 | #endif |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
619 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
620 | static PurpleMediaStream * |
|
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
|
621 | purple_media_insert_stream(PurpleMediaSession *session, const gchar *name, FsStream *stream) |
|
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
|
622 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
623 | PurpleMediaStream *media_stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
624 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
625 | 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
|
626 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
627 | media_stream = g_new0(PurpleMediaStream, 1); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
628 | media_stream->stream = stream; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
629 | media_stream->participant = g_strdup(name); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
630 | media_stream->session = session; |
|
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
|
631 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
632 | session->media->priv->streams = |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
633 | 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
|
634 | |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
635 | 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
|
636 | } |
|
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
|
637 | |
|
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
|
638 | 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
|
639 | 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
|
640 | 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
|
641 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
642 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
643 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
644 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
645 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
646 | 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
|
647 | 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
|
648 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
649 | #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
|
650 | |
|
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
|
651 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
652 | 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
|
653 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
654 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
655 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
| 26332 | 656 | return media->priv->sessions != NULL ? |
| 657 | 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
|
658 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
659 | 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
|
660 | #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
|
661 | } |
|
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
|
662 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
663 | #ifdef USE_VV |
|
26452
825493ce644e
Remove purple_media_set_src/sink from the public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26451
diff
changeset
|
664 | static 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
|
665 | purple_media_set_src(PurpleMedia *media, const gchar *sess_id, GstElement *src) |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
666 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
667 | PurpleMediaSession *session; |
|
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
|
668 | GstPad *sinkpad; |
|
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
|
669 | GstPad *srcpad; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
670 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
671 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
672 | g_return_if_fail(GST_IS_ELEMENT(src)); |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
673 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
674 | 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
|
675 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
676 | if (session == NULL) { |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
677 | purple_debug_warning("media", "purple_media_set_src: trying" |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
678 | " to set src on non-existent session\n"); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
679 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
680 | } |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
681 | |
|
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
|
682 | if (session->src) |
|
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
|
683 | gst_object_unref(session->src); |
|
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
|
684 | session->src = src; |
|
26426
4909c56fe88e
Fix some GStreamer timing issues.
Michael Ruprecht <maiku@pidgin.im>
parents:
26425
diff
changeset
|
685 | gst_element_set_locked_state(session->src, TRUE); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
686 | |
|
26321
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
687 | session->tee = gst_element_factory_make("tee", NULL); |
|
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
688 | gst_bin_add(GST_BIN(session->media->priv->confbin), session->tee); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
689 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
690 | /* This supposedly isn't necessary, but it silences some warnings */ |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
691 | if (GST_ELEMENT_PARENT(session->media->priv->confbin) |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
692 | == GST_ELEMENT_PARENT(session->src)) { |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
693 | GstPad *pad = gst_element_get_static_pad(session->tee, "sink"); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
694 | GstPad *ghost = gst_ghost_pad_new(NULL, pad); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
695 | gst_object_unref(pad); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
696 | gst_pad_set_active(ghost, TRUE); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
697 | gst_element_add_pad(session->media->priv->confbin, ghost); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
698 | } |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
699 | |
|
28162
ae64a0a0fb19
Let's keep this working right.
Michael Ruprecht <maiku@pidgin.im>
parents:
28161
diff
changeset
|
700 | gst_element_set_state(session->tee, GST_STATE_PLAYING); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
701 | gst_element_link(session->src, session->media->priv->confbin); |
|
26321
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
702 | |
|
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
|
703 | g_object_get(session->session, "sink-pad", &sinkpad, NULL); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
704 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
705 | gchar *name = g_strdup_printf("volume_%s", session->id); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
706 | GstElement *level; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
707 | GstElement *volume = gst_element_factory_make("volume", name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
708 | double input_volume = purple_prefs_get_int( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
709 | "/purple/media/audio/volume/input")/10.0; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
710 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
711 | name = g_strdup_printf("sendlevel_%s", session->id); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
712 | level = gst_element_factory_make("level", name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
713 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
714 | gst_bin_add(GST_BIN(session->media->priv->confbin), volume); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
715 | gst_bin_add(GST_BIN(session->media->priv->confbin), level); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
716 | gst_element_set_state(level, GST_STATE_PLAYING); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
717 | gst_element_set_state(volume, GST_STATE_PLAYING); |
|
28162
ae64a0a0fb19
Let's keep this working right.
Michael Ruprecht <maiku@pidgin.im>
parents:
28161
diff
changeset
|
718 | gst_element_link(volume, level); |
|
ae64a0a0fb19
Let's keep this working right.
Michael Ruprecht <maiku@pidgin.im>
parents:
28161
diff
changeset
|
719 | gst_element_link(session->tee, volume); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
720 | srcpad = gst_element_get_static_pad(level, "src"); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
721 | g_object_set(volume, "volume", input_volume, NULL); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
722 | } else { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
723 | srcpad = gst_element_get_request_pad(session->tee, "src%d"); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
724 | } |
|
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
|
725 | purple_debug_info("media", "connecting pad: %s\n", |
|
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
|
726 | gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK |
|
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
|
727 | ? "success" : "failure"); |
|
26426
4909c56fe88e
Fix some GStreamer timing issues.
Michael Ruprecht <maiku@pidgin.im>
parents:
26425
diff
changeset
|
728 | gst_element_set_locked_state(session->src, FALSE); |
|
26511
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
729 | gst_object_unref(session->src); |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
730 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
731 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
732 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
733 | #ifdef USE_GSTREAMER |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
734 | 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
|
735 | 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
|
736 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
737 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
738 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
739 | 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
|
740 | 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
|
741 | return (session != NULL) ? session->src : 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
|
742 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
743 | 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
|
744 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
745 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
746 | #endif /* USE_GSTREAMER */ |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
747 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
748 | #ifdef USE_VV |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
749 | static gboolean |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
750 | media_bus_call(GstBus *bus, GstMessage *msg, PurpleMedia *media) |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
751 | { |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
752 | switch(GST_MESSAGE_TYPE(msg)) { |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
753 | case GST_MESSAGE_ELEMENT: { |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
754 | if (g_signal_has_handler_pending(media, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
755 | purple_media_signals[LEVEL], 0, FALSE) |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
756 | && gst_structure_has_name( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
757 | gst_message_get_structure(msg), "level")) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
758 | GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
759 | gchar *name; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
760 | gchar *participant = NULL; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
761 | PurpleMediaSession *session = NULL; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
762 | gdouble rms_db; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
763 | gdouble percent; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
764 | const GValue *list; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
765 | const GValue *value; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
766 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
767 | if (!PURPLE_IS_MEDIA(media) || |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
768 | GST_ELEMENT_PARENT(src) != |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
769 | media->priv->confbin) |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
770 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
771 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
772 | name = gst_element_get_name(src); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
773 | if (!strncmp(name, "sendlevel_", 10)) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
774 | session = purple_media_get_session( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
775 | media, name+10); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
776 | } else { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
777 | GList *iter = media->priv->streams; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
778 | for (; iter; iter = g_list_next(iter)) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
779 | PurpleMediaStream *stream = iter->data; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
780 | if (stream->level == src) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
781 | session = stream->session; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
782 | participant = stream->participant; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
783 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
784 | } |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
785 | } |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
786 | } |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
787 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
788 | if (!session) |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
789 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
790 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
791 | list = gst_structure_get_value( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
792 | gst_message_get_structure(msg), "rms"); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
793 | value = gst_value_list_get_value(list, 0); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
794 | rms_db = g_value_get_double(value); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
795 | percent = pow(10, rms_db / 20) * 5; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
796 | if(percent > 1.0) |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
797 | percent = 1.0; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
798 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
799 | g_signal_emit(media, purple_media_signals[LEVEL], |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
800 | 0, session->id, participant, percent); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
801 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
802 | } |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
803 | break; |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
804 | } |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
805 | default: |
|
26120
b4ab036ab9fe
Remove a bunch of extraneous GstBus messages from the debug output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26119
diff
changeset
|
806 | break; |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
807 | } |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
808 | |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
809 | return TRUE; |
|
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
810 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
811 | #endif |
|
23742
a3eda57d01b5
Move the main voice and video pipeline into media.c and display more debug info.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
812 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
813 | PurpleAccount * |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
814 | purple_media_get_account(PurpleMedia *media) |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
815 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
816 | #ifdef USE_VV |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
817 | PurpleAccount *account; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
818 | 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
|
819 | 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
|
820 | 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
|
821 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
822 | 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
|
823 | #endif |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
824 | } |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
825 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
826 | gpointer |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
827 | purple_media_get_prpl_data(PurpleMedia *media) |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
828 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
829 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
830 | gpointer prpl_data; |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
831 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
832 | g_object_get(G_OBJECT(media), "prpl-data", &prpl_data, NULL); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
833 | return prpl_data; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
834 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
835 | 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
|
836 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
837 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
838 | |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
839 | void |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
840 | purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data) |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
841 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
842 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
843 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
844 | g_object_set(G_OBJECT(media), "prpl-data", prpl_data, NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
845 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
846 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
847 | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
848 | void |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
849 | purple_media_error(PurpleMedia *media, const gchar *error, ...) |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
850 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
851 | #ifdef USE_VV |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
852 | va_list args; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
853 | gchar *message; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
854 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
855 | 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
|
856 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
857 | va_start(args, error); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
858 | message = g_strdup_vprintf(error, args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
859 | va_end(args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
860 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
861 | 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
|
862 | 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
|
863 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
864 | 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
|
865 | #endif |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
866 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
867 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
868 | void |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
869 | 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
|
870 | 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
|
871 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
872 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
873 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
874 | if (session_id == NULL && participant == NULL) { |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
875 | 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
|
876 | 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
|
877 | NULL, NULL); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
878 | g_object_unref(media); |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
879 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
880 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
881 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
882 | |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
883 | void |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
884 | 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
|
885 | 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
|
886 | gboolean local) |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
887 | { |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
888 | #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
|
889 | 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
|
890 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
891 | if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
892 | GList *streams; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
893 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
894 | 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
|
895 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
896 | streams = purple_media_get_streams(media, |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
897 | session_id, participant); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
898 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
899 | for (; streams; streams = |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
900 | g_list_delete_link(streams, streams)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
901 | 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
|
902 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
903 | stream->accepted = TRUE; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
904 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
905 | } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE || |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
906 | type == PURPLE_MEDIA_INFO_UNMUTE)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
907 | GList *sessions; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
908 | gboolean active = (type == PURPLE_MEDIA_INFO_MUTE); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
909 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
910 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
911 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
912 | if (session_id == NULL) |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
913 | sessions = g_hash_table_get_values( |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
914 | media->priv->sessions); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
915 | else |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
916 | sessions = g_list_prepend(NULL, |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
917 | purple_media_get_session( |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
918 | media, session_id)); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
919 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
920 | purple_debug_info("media", "Turning mute %s\n", |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
921 | active ? "on" : "off"); |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
922 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
923 | for (; sessions; sessions = g_list_delete_link( |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
924 | sessions, sessions)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
925 | PurpleMediaSession *session = sessions->data; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
926 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
927 | gchar *name = g_strdup_printf("volume_%s", |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
928 | session->id); |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
929 | GstElement *volume = gst_bin_get_by_name( |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
930 | GST_BIN(session->media-> |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
931 | priv->confbin), name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
932 | g_free(name); |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
933 | g_object_set(volume, "mute", active, NULL); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
934 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
935 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
936 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
937 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
938 | 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
|
939 | 0, type, session_id, participant, local); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
940 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
941 | if (type == PURPLE_MEDIA_INFO_HANGUP || |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
942 | type == PURPLE_MEDIA_INFO_REJECT) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
943 | purple_media_end(media, session_id, participant); |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
944 | } |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
945 | #endif |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
946 | } |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
947 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
948 | #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
|
949 | 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
|
950 | 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
|
951 | 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
|
952 | 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
|
953 | { |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
954 | 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
|
955 | 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
|
956 | |
|
29570
3c71157baa81
Move handling Farsight 2's new-local-candidate signal in Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29569
diff
changeset
|
957 | 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
|
958 | 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
|
959 | |
|
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
|
960 | 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
|
961 | 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
|
962 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
963 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
964 | 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
|
965 | 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
|
966 | 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
|
967 | { |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
968 | PurpleMediaStream *stream_data; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
969 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
970 | 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
|
971 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
972 | 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
|
973 | stream_data->candidates_prepared = TRUE; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
974 | |
|
29573
2377156c8bed
Move Farsight 2's local-candidates-prepared signal to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29572
diff
changeset
|
975 | 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
|
976 | 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
|
977 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
978 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
979 | /* 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
|
980 | * 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
|
981 | 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
|
982 | 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
|
983 | 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
|
984 | 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
|
985 | 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
|
986 | 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
|
987 | { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
988 | PurpleMediaStream *stream; |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
989 | 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
|
990 | guint id; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
991 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
992 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
993 | |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
994 | 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
|
995 | id = purple_media_candidate_get_component_id(local_candidate); |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
996 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
997 | iter = stream->active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
998 | 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
|
999 | 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
|
1000 | 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
|
1001 | g_object_unref(c); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1002 | stream->active_local_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1003 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1004 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1005 | 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
|
1006 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1007 | local_candidate)); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1008 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1009 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1010 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1011 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1012 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1013 | 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
|
1014 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1015 | 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
|
1016 | |
|
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1017 | 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
|
1018 | |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1019 | iter = stream->active_remote_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1020 | 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
|
1021 | 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
|
1022 | 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
|
1023 | g_object_unref(c); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1024 | stream->active_remote_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1025 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1026 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1027 | 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
|
1028 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1029 | remote_candidate)); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1030 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1031 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1032 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1033 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1034 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1035 | 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
|
1036 | purple_media_candidate_copy( |
|
29572
4e4dbdcf5281
Move Farsight 2's new-active-candidate-pair into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29571
diff
changeset
|
1037 | 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
|
1038 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1039 | 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
|
1040 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1041 | |
|
29571
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1042 | 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
|
1043 | 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
|
1044 | 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
|
1045 | { |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1046 | 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
|
1047 | } |
|
f5b8fe67c87f
Move handling Farsight 2's codecs-changed signal into the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29570
diff
changeset
|
1048 | |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1049 | static gboolean |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1050 | purple_media_connected_cb(PurpleMediaStream *stream) |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1051 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1052 | g_return_val_if_fail(stream != NULL, FALSE); |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1053 | |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1054 | stream->connected_cb_id = 0; |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1055 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1056 | purple_media_manager_create_output_window( |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1057 | stream->session->media->priv->manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1058 | stream->session->media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1059 | stream->session->id, stream->participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1060 | |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1061 | g_signal_emit(stream->session->media, |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1062 | purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
1063 | 0, PURPLE_MEDIA_STATE_CONNECTED, |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1064 | stream->session->id, stream->participant); |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1065 | return FALSE; |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1066 | } |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1067 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1068 | static void |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1069 | purple_media_src_pad_added_cb(FsStream *fsstream, GstPad *srcpad, |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1070 | FsCodec *codec, PurpleMediaStream *stream) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1071 | { |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1072 | PurpleMediaPrivate *priv; |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1073 | GstPad *sinkpad; |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1074 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1075 | g_return_if_fail(FS_IS_STREAM(fsstream)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1076 | g_return_if_fail(stream != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1077 | |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1078 | priv = stream->session->media->priv; |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1079 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1080 | if (stream->src == NULL) { |
| 26340 | 1081 | GstElement *sink = NULL; |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1082 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1083 | if (codec->media_type == FS_MEDIA_TYPE_AUDIO) { |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1084 | GstElement *queue = NULL; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1085 | double output_volume = purple_prefs_get_int( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1086 | "/purple/media/audio/volume/output")/10.0; |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1087 | /* |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1088 | * Should this instead be: |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1089 | * audioconvert ! audioresample ! liveadder ! |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1090 | * audioresample ! audioconvert ! realsink |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1091 | */ |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1092 | queue = gst_element_factory_make("queue", NULL); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1093 | stream->volume = gst_element_factory_make( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1094 | "volume", NULL); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1095 | g_object_set(stream->volume, "volume", |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1096 | output_volume, NULL); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1097 | stream->level = gst_element_factory_make( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1098 | "level", NULL); |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1099 | stream->src = gst_element_factory_make( |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1100 | "liveadder", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1101 | sink = purple_media_manager_get_element(priv->manager, |
|
26522
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26519
diff
changeset
|
1102 | PURPLE_MEDIA_RECV_AUDIO, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26519
diff
changeset
|
1103 | stream->session->media, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26519
diff
changeset
|
1104 | stream->session->id, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26519
diff
changeset
|
1105 | stream->participant); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1106 | gst_bin_add(GST_BIN(priv->confbin), queue); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1107 | gst_bin_add(GST_BIN(priv->confbin), stream->volume); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1108 | gst_bin_add(GST_BIN(priv->confbin), stream->level); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1109 | gst_bin_add(GST_BIN(priv->confbin), sink); |
|
28140
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28133
diff
changeset
|
1110 | gst_element_set_state(sink, GST_STATE_PLAYING); |
|
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28133
diff
changeset
|
1111 | gst_element_set_state(stream->level, GST_STATE_PLAYING); |
|
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28133
diff
changeset
|
1112 | gst_element_set_state(stream->volume, GST_STATE_PLAYING); |
|
28162
ae64a0a0fb19
Let's keep this working right.
Michael Ruprecht <maiku@pidgin.im>
parents:
28161
diff
changeset
|
1113 | gst_element_set_state(queue, GST_STATE_PLAYING); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1114 | gst_element_link(stream->level, sink); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1115 | gst_element_link(stream->volume, stream->level); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1116 | gst_element_link(queue, stream->volume); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1117 | sink = queue; |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1118 | } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) { |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1119 | stream->src = gst_element_factory_make( |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1120 | "fsfunnel", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1121 | sink = gst_element_factory_make( |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1122 | "fakesink", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1123 | g_object_set(G_OBJECT(sink), "async", FALSE, NULL); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1124 | gst_bin_add(GST_BIN(priv->confbin), sink); |
|
28162
ae64a0a0fb19
Let's keep this working right.
Michael Ruprecht <maiku@pidgin.im>
parents:
28161
diff
changeset
|
1125 | gst_element_set_state(sink, GST_STATE_PLAYING); |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1126 | } |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1127 | stream->tee = gst_element_factory_make("tee", NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1128 | gst_bin_add_many(GST_BIN(priv->confbin), |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1129 | stream->src, stream->tee, NULL); |
|
28140
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28133
diff
changeset
|
1130 | gst_element_set_state(stream->tee, GST_STATE_PLAYING); |
|
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28133
diff
changeset
|
1131 | gst_element_set_state(stream->src, GST_STATE_PLAYING); |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1132 | gst_element_link_many(stream->src, stream->tee, sink, NULL); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1133 | } |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1134 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1135 | sinkpad = gst_element_get_request_pad(stream->src, "sink%d"); |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1136 | gst_pad_link(srcpad, sinkpad); |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1137 | gst_object_unref(sinkpad); |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1138 | |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1139 | stream->connected_cb_id = purple_timeout_add(0, |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1140 | (GSourceFunc)purple_media_connected_cb, stream); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1141 | } |
|
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
|
1142 | #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
|
1143 | |
|
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
|
1144 | 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
|
1145 | purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1146 | const gchar *who, PurpleMediaSessionType type, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1147 | gboolean initiator, const gchar *transmitter, |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1148 | guint num_params, GParameter *params) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1149 | { |
|
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
|
1150 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1151 | 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
|
1152 | FsParticipant *participant = NULL; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1153 | PurpleMediaStream *stream = NULL; |
|
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
|
1154 | FsMediaType media_type = purple_media_to_fs_media_type(type); |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1155 | FsStreamDirection type_direction = |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1156 | purple_media_to_fs_stream_direction(type); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1157 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1158 | 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
|
1159 | |
|
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
|
1160 | if (media->priv->gst_bus_handler_id == 0) { |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1161 | GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE( |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1162 | purple_media_manager_get_pipeline( |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1163 | purple_media_manager_get()))); |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1164 | media->priv->gst_bus_handler_id = |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1165 | g_signal_connect(G_OBJECT(bus), "message", |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1166 | G_CALLBACK(media_bus_call), media); |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1167 | gst_object_unref(bus); |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1168 | } |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1169 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1170 | if (!purple_media_backend_add_stream(media->priv->backend, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1171 | sess_id, who, type, initiator, transmitter, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1172 | num_params, params)) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1173 | 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
|
1174 | return FALSE; |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1175 | } |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1176 | |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1177 | /* XXX: Temporary call while integrating with backend */ |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1178 | if (media->priv->conference == NULL) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1179 | media->priv->conference = |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1180 | purple_media_backend_fs2_get_conference( |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1181 | PURPLE_MEDIA_BACKEND_FS2( |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1182 | media->priv->backend)); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1183 | media->priv->confbin = GST_ELEMENT_PARENT( |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1184 | media->priv->conference); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1185 | } |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1186 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1187 | 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
|
1188 | |
|
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
|
1189 | if (!session) { |
|
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
|
1190 | PurpleMediaSessionType session_type; |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1191 | GstElement *src = 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
|
1192 | |
|
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
|
1193 | session = g_new0(PurpleMediaSession, 1); |
|
29569
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1194 | session->session = purple_media_backend_fs2_get_session( |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1195 | PURPLE_MEDIA_BACKEND_FS2(media->priv->backend), |
|
03db05b81c5c
Begin transferring FsSession over to the Farsight 2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29568
diff
changeset
|
1196 | 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
|
1197 | 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
|
1198 | 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
|
1199 | session->type = type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1200 | 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
|
1201 | |
|
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
|
1202 | purple_media_add_session(media, session); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1203 | 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
|
1204 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1205 | session->id, NULL); |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1206 | |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1207 | if (type_direction & FS_DIRECTION_SEND) { |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1208 | session_type = purple_media_from_fs(media_type, |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1209 | FS_DIRECTION_SEND); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1210 | src = purple_media_manager_get_element( |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1211 | media->priv->manager, session_type, |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1212 | media, session->id, who); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1213 | if (!GST_IS_ELEMENT(src)) { |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1214 | purple_debug_error("media", |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1215 | "Error creating src for session %s\n", |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1216 | session->id); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1217 | purple_media_end(media, session->id, NULL); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1218 | return FALSE; |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1219 | } |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1220 | |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1221 | purple_media_set_src(media, session->id, src); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1222 | gst_element_set_state(session->src, GST_STATE_PLAYING); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1223 | purple_media_manager_create_output_window( |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1224 | media->priv->manager, |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1225 | session->media, |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1226 | session->id, 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
|
1227 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1228 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1229 | |
|
29581
0fe9e3b7e6e6
Remove the list of participants from PurpleMedia and use the Fs2 backend's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29578
diff
changeset
|
1230 | participant = purple_media_backend_fs2_get_participant( |
|
0fe9e3b7e6e6
Remove the list of participants from PurpleMedia and use the Fs2 backend's.
Michael Ruprecht <maiku@pidgin.im>
parents:
29578
diff
changeset
|
1231 | PURPLE_MEDIA_BACKEND_FS2(media->priv->backend), who); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1232 | |
|
29595
f7e57d58c8be
Move odd direction changing functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29594
diff
changeset
|
1233 | if (purple_media_get_stream(media, sess_id, who) == NULL) { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1234 | FsStream *fsstream = NULL; |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1235 | |
|
29582
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29581
diff
changeset
|
1236 | fsstream = purple_media_backend_fs2_get_stream( |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29581
diff
changeset
|
1237 | PURPLE_MEDIA_BACKEND_FS2( |
|
c4ef3aed1366
Transfer creating Farsight 2 streams to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29581
diff
changeset
|
1238 | media->priv->backend), sess_id, who); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1239 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1240 | stream = purple_media_insert_stream(session, who, fsstream); |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1241 | stream->initiator = initiator; |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1242 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1243 | /* callback for source pad added (new stream source ready) */ |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1244 | g_signal_connect(G_OBJECT(fsstream), |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1245 | "src-pad-added", G_CALLBACK(purple_media_src_pad_added_cb), stream); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1246 | |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1247 | 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
|
1248 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1249 | 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
|
1250 | } |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1251 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1252 | 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
|
1253 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1254 | 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
|
1255 | #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
|
1256 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1257 | |
|
26523
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1258 | PurpleMediaManager * |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1259 | purple_media_get_manager(PurpleMedia *media) |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1260 | { |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1261 | PurpleMediaManager *ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1262 | 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
|
1263 | g_object_get(media, "manager", &ret, NULL); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1264 | return ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1265 | } |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1266 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
1267 | 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
|
1268 | 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
|
1269 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1270 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1271 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1272 | 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
|
1273 | 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
|
1274 | 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
|
1275 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1276 | 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
|
1277 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1278 | } |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1279 | /* 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
|
1280 | GList * |
|
26160
46bc5e18d59c
Combine get_*_codecs functions to mirror Farsight 2.
Michael Ruprecht <maiku@pidgin.im>
parents:
26151
diff
changeset
|
1281 | 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
|
1282 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1283 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1284 | 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
|
1285 | |
|
29585
37a79cc62b55
Transfer get_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29584
diff
changeset
|
1286 | 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
|
1287 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1288 | 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
|
1289 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1290 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1291 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1292 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1293 | 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
|
1294 | 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
|
1295 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1296 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1297 | 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
|
1298 | |
|
9bf09e3031b0
Move get_local_candidates functionality over to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29585
diff
changeset
|
1299 | 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
|
1300 | 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
|
1301 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1302 | 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
|
1303 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1304 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1305 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1306 | 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
|
1307 | 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
|
1308 | const gchar *participant, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1309 | 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
|
1310 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1311 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1312 | PurpleMediaStream *stream; |
|
26258
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1313 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1314 | 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
|
1315 | 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
|
1316 | |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1317 | 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
|
1318 | 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
|
1319 | "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
|
1320 | "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
|
1321 | 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
|
1322 | 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
|
1323 | return; |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1324 | } |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1325 | |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
1326 | 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
|
1327 | purple_media_candidate_list_copy(remote_candidates)); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1328 | |
|
29592
eac0dd44f441
Handle part of accepting a stream in the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29591
diff
changeset
|
1329 | 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
|
1330 | 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
|
1331 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1332 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1333 | |
|
26516
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1334 | #if 0 |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1335 | /* |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1336 | * These two functions aren't being used and I'd rather not lock in the API |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1337 | * until they are needed. If they ever are. |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1338 | */ |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1339 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1340 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1341 | 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
|
1342 | 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
|
1343 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1344 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1345 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1346 | 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
|
1347 | 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
|
1348 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1349 | 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
|
1350 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1351 | 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
|
1352 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1353 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1354 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1355 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1356 | 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
|
1357 | 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
|
1358 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1359 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1360 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1361 | 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
|
1362 | 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
|
1363 | return purple_media_candidate_list_copy( |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1364 | 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
|
1365 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1366 | 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
|
1367 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1368 | } |
|
26516
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1369 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1370 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1371 | gboolean |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1372 | 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
|
1373 | 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
|
1374 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1375 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1376 | 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
|
1377 | |
|
29589
3ff2d4b37b1f
Move set_remote_codecs functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29587
diff
changeset
|
1378 | 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
|
1379 | 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
|
1380 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1381 | 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
|
1382 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1383 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1384 | |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1385 | gboolean |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1386 | purple_media_candidates_prepared(PurpleMedia *media, |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1387 | 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
|
1388 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1389 | #ifdef USE_VV |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1390 | GList *streams; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1391 | gboolean prepared = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1392 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1393 | 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
|
1394 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1395 | 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
|
1396 | |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1397 | 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
|
1398 | PurpleMediaStream *stream = streams->data; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1399 | if (stream->candidates_prepared == FALSE) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1400 | g_list_free(streams); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1401 | prepared = FALSE; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1402 | break; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1403 | } |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1404 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1405 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
1406 | 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
|
1407 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1408 | 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
|
1409 | #endif |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1410 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1411 | |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1412 | gboolean |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1413 | 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
|
1414 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1415 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1416 | 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
|
1417 | |
|
29591
fe94e4516832
Move set_remote_codec functionality to the Fs2 media backend.
Michael Ruprecht <maiku@pidgin.im>
parents:
29589
diff
changeset
|
1418 | 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
|
1419 | 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
|
1420 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1421 | 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
|
1422 | #endif |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1423 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
1424 | |
|
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
|
1425 | gboolean |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1426 | 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
|
1427 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1428 | #ifdef USE_VV |
|
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
|
1429 | gboolean ret; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1430 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1431 | 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
|
1432 | |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1433 | if (sess_id != NULL) { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1434 | PurpleMediaSession *session; |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1435 | session = purple_media_get_session(media, sess_id); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1436 | |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1437 | if (session == NULL) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1438 | return FALSE; |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1439 | if (session->type & (PURPLE_MEDIA_SEND_AUDIO | |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1440 | PURPLE_MEDIA_SEND_VIDEO)) |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1441 | g_object_get(session->session, |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1442 | "codecs-ready", &ret, NULL); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1443 | else |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1444 | ret = TRUE; |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1445 | } else { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1446 | GList *values = g_hash_table_get_values(media->priv->sessions); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1447 | for (; values; values = g_list_delete_link(values, values)) { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1448 | PurpleMediaSession *session = values->data; |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1449 | if (session->type & (PURPLE_MEDIA_SEND_AUDIO | |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1450 | PURPLE_MEDIA_SEND_VIDEO)) |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1451 | g_object_get(session->session, |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1452 | "codecs-ready", &ret, NULL); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1453 | else |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1454 | ret = TRUE; |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1455 | |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1456 | if (ret == FALSE) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1457 | break; |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1458 | } |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1459 | if (values != NULL) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1460 | g_list_free(values); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
1461 | } |
|
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
|
1462 | return ret; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1463 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1464 | 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
|
1465 | #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
|
1466 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1467 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1468 | gboolean |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1469 | purple_media_is_initiator(PurpleMedia *media, |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1470 | const gchar *sess_id, const gchar *participant) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1471 | { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1472 | #ifdef USE_VV |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1473 | 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
|
1474 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1475 | if (sess_id == NULL && participant == NULL) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1476 | return media->priv->initiator; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1477 | else if (sess_id != NULL && participant == NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1478 | PurpleMediaSession *session = |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1479 | purple_media_get_session(media, sess_id); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1480 | return session != NULL ? session->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1481 | } else if (sess_id != NULL && participant != NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1482 | PurpleMediaStream *stream = purple_media_get_stream( |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1483 | media, sess_id, participant); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1484 | return stream != NULL ? stream->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1485 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1486 | #endif |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1487 | return FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1488 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1489 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1490 | gboolean |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1491 | 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
|
1492 | 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
|
1493 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1494 | #ifdef USE_VV |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1495 | gboolean accepted = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1496 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1497 | 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
|
1498 | |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1499 | 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
|
1500 | GList *streams = media->priv->streams; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1501 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1502 | 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
|
1503 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1504 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1505 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1506 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1507 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1508 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1509 | } 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
|
1510 | 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
|
1511 | media, sess_id, NULL); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1512 | for (; streams; streams = |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1513 | 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
|
1514 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1515 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1516 | g_list_free(streams); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1517 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1518 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1519 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1520 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1521 | } 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
|
1522 | 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
|
1523 | media, sess_id, participant); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1524 | 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
|
1525 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1526 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1527 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
1528 | 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
|
1529 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1530 | 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
|
1531 | #endif |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1532 | } |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
1533 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1534 | 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
|
1535 | 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
|
1536 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1537 | #ifdef USE_VV |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1538 | GList *sessions; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1539 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1540 | 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
|
1541 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1542 | purple_prefs_set_int("/purple/media/audio/volume/input", level); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1543 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1544 | if (session_id == NULL) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1545 | sessions = g_hash_table_get_values(media->priv->sessions); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1546 | else |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1547 | sessions = g_list_append(NULL, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1548 | purple_media_get_session(media, session_id)); |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1549 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1550 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1551 | PurpleMediaSession *session = sessions->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1552 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1553 | if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1554 | gchar *name = g_strdup_printf("volume_%s", |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1555 | session->id); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1556 | GstElement *volume = gst_bin_get_by_name( |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1557 | GST_BIN(session->media->priv->confbin), |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1558 | name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1559 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1560 | g_object_set(volume, "volume", level/10.0, NULL); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1561 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1562 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1563 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1564 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1565 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1566 | 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
|
1567 | 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
|
1568 | double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1569 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1570 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1571 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1572 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1573 | 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
|
1574 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1575 | purple_prefs_set_int("/purple/media/audio/volume/output", level); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1576 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1577 | streams = purple_media_get_streams(media, |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1578 | session_id, participant); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1579 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1580 | for (; streams; streams = g_list_delete_link(streams, streams)) { |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1581 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1582 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1583 | if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1584 | && GST_IS_ELEMENT(stream->volume)) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1585 | g_object_set(stream->volume, "volume", level/10.0, NULL); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1586 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1587 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1588 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1589 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
1590 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1591 | gulong |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1592 | purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1593 | const gchar *participant, gulong window_id) |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
1594 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1595 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1596 | 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
|
1597 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1598 | return purple_media_manager_set_output_window(media->priv->manager, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1599 | media, session_id, participant, window_id); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1600 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1601 | 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
|
1602 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1603 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1604 | |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1605 | void |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1606 | 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
|
1607 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1608 | #ifdef USE_VV |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1609 | GList *iter = media->priv->streams; |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1610 | 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
|
1611 | 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
|
1612 | 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
|
1613 | media->priv->manager, media, |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1614 | stream->session->id, stream->participant); |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1615 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1616 | |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1617 | 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
|
1618 | 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
|
1619 | 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
|
1620 | 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
|
1621 | 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
|
1622 | session_name, NULL); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1623 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1624 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1625 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
1626 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1627 | #ifdef USE_GSTREAMER |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1628 | GstElement * |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1629 | 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
|
1630 | 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
|
1631 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1632 | #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
|
1633 | 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
|
1634 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1635 | if (session_id != NULL && participant == NULL) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1636 | PurpleMediaSession *session = |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1637 | purple_media_get_session(media, session_id); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1638 | return (session != NULL) ? session->tee : NULL; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1639 | } else if (session_id != NULL && participant != NULL) { |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1640 | PurpleMediaStream *stream = |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1641 | purple_media_get_stream(media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1642 | session_id, participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1643 | return (stream != NULL) ? stream->tee : NULL; |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1644 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1645 | g_return_val_if_reached(NULL); |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1646 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1647 | 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
|
1648 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1649 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1650 | #endif /* USE_GSTREAMER */ |
|
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
1651 |