Fri, 23 Oct 2009 18:20:54 +0000
Decouple the media_bus_call from the backend. It will still be needed even
after integration with the backend is finished.
| 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 */ |
|
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
|
121 | GHashTable *participants; /* FsParticipant table */ |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
122 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
123 | GList *streams; /* PurpleMediaStream table */ |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
124 | |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
125 | 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
|
126 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
127 | 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
|
128 | #endif |
| 19883 | 129 | }; |
| 130 | ||
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
131 | #ifdef USE_VV |
| 19883 | 132 | #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) |
| 133 | ||
| 134 | static void purple_media_class_init (PurpleMediaClass *klass); | |
| 135 | static void purple_media_init (PurpleMedia *media); | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
136 | static void purple_media_dispose (GObject *object); |
| 19883 | 137 | static void purple_media_finalize (GObject *object); |
| 138 | static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 139 | static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
| 140 | ||
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
141 | static void purple_media_new_local_candidate_cb(FsStream *stream, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
142 | FsCandidate *local_candidate, PurpleMediaSession *session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
143 | static void purple_media_candidates_prepared_cb(FsStream *stream, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
144 | PurpleMediaSession *session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
145 | static void purple_media_candidate_pair_established_cb(FsStream *stream, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
146 | FsCandidate *native_candidate, FsCandidate *remote_candidate, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
147 | PurpleMediaSession *session); |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
148 | static gboolean media_bus_call(GstBus *bus, |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
149 | GstMessage *msg, PurpleMedia *media); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
150 | |
| 19883 | 151 | static GObjectClass *parent_class = NULL; |
| 152 | ||
| 153 | ||
| 154 | ||
| 155 | enum { | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
156 | S_ERROR, |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
157 | CANDIDATES_PREPARED, |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
158 | CODECS_CHANGED, |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
159 | 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
|
160 | NEW_CANDIDATE, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
161 | STATE_CHANGED, |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
162 | STREAM_INFO, |
| 19883 | 163 | LAST_SIGNAL |
| 164 | }; | |
| 165 | static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
| 166 | ||
| 167 | enum { | |
| 168 | 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
|
169 | PROP_MANAGER, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
170 | PROP_ACCOUNT, |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
171 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
172 | PROP_CONFERENCE, |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
173 | #endif |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
174 | PROP_CONFERENCE_TYPE, |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
175 | PROP_INITIATOR, |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
176 | PROP_PRPL_DATA, |
| 19883 | 177 | }; |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
178 | #endif |
| 19883 | 179 | |
|
26618
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
180 | |
| 19883 | 181 | GType |
| 182 | purple_media_get_type() | |
| 183 | { | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
184 | #ifdef USE_VV |
| 19883 | 185 | static GType type = 0; |
| 186 | ||
| 187 | if (type == 0) { | |
| 188 | static const GTypeInfo info = { | |
| 189 | sizeof(PurpleMediaClass), | |
| 190 | NULL, | |
| 191 | NULL, | |
| 192 | (GClassInitFunc) purple_media_class_init, | |
| 193 | NULL, | |
| 194 | NULL, | |
| 195 | sizeof(PurpleMedia), | |
| 196 | 0, | |
|
22071
4c47e360e467
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19889
diff
changeset
|
197 | (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
|
198 | NULL |
| 19883 | 199 | }; |
| 200 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
| 201 | } | |
| 202 | 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
|
203 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
204 | 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
|
205 | #endif |
| 19883 | 206 | } |
| 207 | ||
|
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 | #ifdef USE_VV |
| 19883 | 209 | static void |
| 210 | purple_media_class_init (PurpleMediaClass *klass) | |
| 211 | { | |
| 212 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
| 213 | parent_class = g_type_class_peek_parent(klass); | |
| 214 | ||
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
215 | gobject_class->dispose = purple_media_dispose; |
| 19883 | 216 | gobject_class->finalize = purple_media_finalize; |
| 217 | gobject_class->set_property = purple_media_set_property; | |
| 218 | gobject_class->get_property = purple_media_get_property; | |
| 219 | ||
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
220 | 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
|
221 | 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
|
222 | "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
|
223 | "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
|
224 | 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
|
225 | 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
|
226 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
227 | 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
|
228 | g_param_spec_pointer("account", |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
229 | "PurpleAccount", |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
230 | "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
|
231 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
232 | |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
233 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
234 | g_object_class_install_property(gobject_class, PROP_CONFERENCE, |
|
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
235 | 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
|
236 | "Farsight conference", |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
237 | "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
|
238 | FS_TYPE_CONFERENCE, |
|
26518
12a92156965d
Make the conference property write only.
Michael Ruprecht <maiku@pidgin.im>
parents:
26517
diff
changeset
|
239 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE)); |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
240 | #endif |
| 19883 | 241 | |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
242 | 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
|
243 | g_param_spec_string("conference-type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
244 | "Conference Type", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
245 | "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
|
246 | "has been created to provide.", |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
247 | NULL, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
248 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
249 | |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
250 | g_object_class_install_property(gobject_class, PROP_INITIATOR, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
251 | g_param_spec_boolean("initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
252 | "initiator", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
253 | "If the local user initiated the conference.", |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
254 | FALSE, |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
255 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
256 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
257 | 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
|
258 | g_param_spec_pointer("prpl-data", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
259 | "gpointer", |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
260 | "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
|
261 | G_PARAM_READWRITE)); |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
262 | |
|
27971
77a0e74c8385
Make media.c compilable on Windows following guidance from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27205
diff
changeset
|
263 | 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
|
264 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
265 | g_cclosure_marshal_VOID__STRING, |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
266 | G_TYPE_NONE, 1, G_TYPE_STRING); |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
267 | 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
|
268 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
269 | purple_smarshal_VOID__STRING_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
270 | G_TYPE_NONE, 2, G_TYPE_STRING, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
271 | G_TYPE_STRING); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
272 | 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
|
273 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
274 | g_cclosure_marshal_VOID__STRING, |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
275 | 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
|
276 | 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
|
277 | 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
|
278 | 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
|
279 | 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
|
280 | 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
|
281 | 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
|
282 | 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
|
283 | 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
|
284 | 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
|
285 | G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
286 | 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
|
287 | G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
288 | purple_smarshal_VOID__ENUM_STRING_STRING, |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
289 | 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
|
290 | G_TYPE_STRING, G_TYPE_STRING); |
|
26440
1ece473ab51a
Add stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
291 | 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
|
292 | 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
|
293 | 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
|
294 | 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
|
295 | 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
|
296 | g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
| 19883 | 297 | } |
| 298 | ||
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
299 | |
| 19883 | 300 | static void |
| 301 | purple_media_init (PurpleMedia *media) | |
| 302 | { | |
| 303 | 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
|
304 | memset(media->priv, 0, sizeof(*media->priv)); |
| 19883 | 305 | } |
| 306 | ||
| 307 | static void | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
308 | purple_media_stream_free(PurpleMediaStream *stream) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
309 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
310 | if (stream == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
311 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
312 | |
|
26280
9c7d0dc8268e
Set the purple_media_connected_cb timeout to a high priority and remove
Michael Ruprecht <maiku@pidgin.im>
parents:
26279
diff
changeset
|
313 | /* Remove the connected_cb timeout */ |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
314 | if (stream->connected_cb_id != 0) |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
315 | 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
|
316 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
317 | g_free(stream->participant); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
318 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
319 | if (stream->local_candidates) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
320 | fs_candidate_list_destroy(stream->local_candidates); |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
321 | if (stream->remote_candidates) |
|
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
322 | fs_candidate_list_destroy(stream->remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
323 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
324 | if (stream->active_local_candidates) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
325 | fs_candidate_list_destroy(stream->active_local_candidates); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
326 | if (stream->active_remote_candidates) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
327 | fs_candidate_list_destroy(stream->active_remote_candidates); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
328 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
329 | g_free(stream); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
330 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
331 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
332 | static void |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
333 | purple_media_session_free(PurpleMediaSession *session) |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
334 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
335 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
336 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
337 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
338 | g_free(session->id); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
339 | g_free(session); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
340 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
341 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
342 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
343 | purple_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
344 | { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
345 | PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
346 | GList *iter = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
347 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
348 | purple_debug_info("media","purple_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
349 | |
|
26315
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
350 | 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
|
351 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
352 | if (priv->backend) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
353 | 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
|
354 | priv->backend = NULL; |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
355 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
356 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
357 | for (iter = priv->streams; iter; iter = g_list_next(iter)) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
358 | PurpleMediaStream *stream = iter->data; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
359 | if (stream->stream) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
360 | g_object_unref(stream->stream); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
361 | stream->stream = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
362 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
363 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
364 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
365 | if (priv->sessions) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
366 | GList *sessions = g_hash_table_get_values(priv->sessions); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
367 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
368 | PurpleMediaSession *session = sessions->data; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
369 | if (session->session) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
370 | g_object_unref(session->session); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
371 | session->session = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
372 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
373 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
374 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
375 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
376 | if (priv->participants) { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
377 | GList *participants = g_hash_table_get_values(priv->participants); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
378 | for (; participants; participants = g_list_delete_link(participants, participants)) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
379 | g_object_unref(participants->data); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
380 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
381 | |
|
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
|
382 | 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
|
383 | GstElement *pipeline = purple_media_manager_get_pipeline( |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
384 | priv->manager); |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
385 | 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
|
386 | 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
|
387 | 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
|
388 | 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
|
389 | } |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
390 | |
|
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
|
391 | 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
|
392 | 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
|
393 | 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
|
394 | } |
|
c72d67da93eb
Use the media manager that created the media session in media.c.
Michael Ruprecht <maiku@pidgin.im>
parents:
26309
diff
changeset
|
395 | |
| 26412 | 396 | G_OBJECT_CLASS(parent_class)->dispose(media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
397 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
398 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
399 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
400 | purple_media_finalize(GObject *media) |
| 19883 | 401 | { |
|
23711
c5058fc31d26
Free the PurpleMedia object when the media session ends and fix ending
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
402 | 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
|
403 | 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
|
404 | |
|
26181
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
405 | 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
|
406 | purple_media_stream_free(priv->streams->data); |
|
8dd52c56abc0
Free Farsight objects better.
Michael Ruprecht <maiku@pidgin.im>
parents:
26180
diff
changeset
|
407 | |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
408 | if (priv->sessions) { |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
409 | 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
|
410 | 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
|
411 | 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
|
412 | } |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
413 | g_hash_table_destroy(priv->sessions); |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
414 | } |
|
26096
7249fdfc2eab
Set the media pipeline to PLAYING immediately after initialization
Michael Ruprecht <maiku@pidgin.im>
parents:
23752
diff
changeset
|
415 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26209
diff
changeset
|
416 | G_OBJECT_CLASS(parent_class)->finalize(media); |
| 19883 | 417 | } |
| 418 | ||
| 419 | static void | |
| 420 | purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) | |
| 421 | { | |
| 422 | PurpleMedia *media; | |
| 423 | 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
|
424 | |
| 19883 | 425 | media = PURPLE_MEDIA(object); |
| 426 | ||
| 427 | 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
|
428 | 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
|
429 | 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
|
430 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
431 | case PROP_ACCOUNT: |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
432 | 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
|
433 | break; |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
434 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
435 | 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
|
436 | if (media->priv->conference) |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
437 | 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
|
438 | media->priv->conference = g_value_dup_object(value); |
| 19883 | 439 | break; |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
440 | } |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
441 | #endif |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
442 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
443 | media->priv->conference_type = |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
444 | 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
|
445 | /* 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
|
446 | 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
|
447 | 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
|
448 | "conference-type", |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
449 | 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
|
450 | "media", media, |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
451 | NULL); |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
452 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
453 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
454 | media->priv->initiator = g_value_get_boolean(value); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
455 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
456 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
457 | 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
|
458 | break; |
| 19883 | 459 | default: |
| 460 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
| 461 | break; | |
| 462 | } | |
| 463 | } | |
| 464 | ||
| 465 | static void | |
| 466 | purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 467 | { | |
| 468 | PurpleMedia *media; | |
| 469 | g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
| 470 | ||
| 471 | media = PURPLE_MEDIA(object); | |
| 472 | ||
| 473 | 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
|
474 | 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
|
475 | 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
|
476 | break; |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
477 | case PROP_ACCOUNT: |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
478 | 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
|
479 | break; |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
480 | #ifndef PURPLE_DISABLE_DEPRECATED |
|
26185
6061487f59a7
Rename "fs-conference" to "conference".
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
481 | 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
|
482 | g_value_set_object(value, media->priv->conference); |
| 19883 | 483 | break; |
|
29566
3a36a4b5d4e9
Deprecate the conference property of PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29565
diff
changeset
|
484 | #endif |
|
29561
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
485 | case PROP_CONFERENCE_TYPE: |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
486 | g_value_set_string(value, |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
487 | media->priv->conference_type); |
|
487ab1de8666
Add a conference-type parameter to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
29554
diff
changeset
|
488 | break; |
|
26187
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
489 | case PROP_INITIATOR: |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
490 | g_value_set_boolean(value, media->priv->initiator); |
|
3b3059a7c091
Add initiator property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26185
diff
changeset
|
491 | break; |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
492 | case PROP_PRPL_DATA: |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
493 | 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
|
494 | break; |
| 19883 | 495 | default: |
| 496 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
| 497 | break; | |
| 498 | } | |
| 499 | ||
| 500 | } | |
| 501 | ||
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
502 | static FsCandidate * |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
503 | purple_media_candidate_to_fs(PurpleMediaCandidate *candidate) |
|
26620
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
504 | { |
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
505 | FsCandidate *fscandidate; |
|
26620
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
506 | gchar *foundation; |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
507 | guint component_id; |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
508 | gchar *ip; |
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
509 | guint port; |
|
26620
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
510 | gchar *base_ip; |
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
511 | guint base_port; |
|
26620
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
512 | PurpleMediaNetworkProtocol proto; |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
513 | guint32 priority; |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
514 | PurpleMediaCandidateType type; |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
515 | gchar *username; |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
516 | gchar *password; |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
517 | guint ttl; |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
518 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
519 | if (candidate == NULL) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
520 | return NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
521 | |
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
522 | g_object_get(G_OBJECT(candidate), |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
523 | "foundation", &foundation, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
524 | "component-id", &component_id, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
525 | "ip", &ip, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
526 | "port", &port, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
527 | "base-ip", &base_ip, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
528 | "base-port", &base_port, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
529 | "protocol", &proto, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
530 | "priority", &priority, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
531 | "type", &type, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
532 | "username", &username, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
533 | "password", &password, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
534 | "ttl", &ttl, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
535 | NULL); |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
536 | |
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
537 | fscandidate = fs_candidate_new(foundation, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
538 | component_id, type, |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
539 | proto, ip, port); |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
540 | |
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
541 | fscandidate->base_ip = base_ip; |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
542 | fscandidate->base_port = base_port; |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
543 | fscandidate->priority = priority; |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
544 | fscandidate->username = username; |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
545 | fscandidate->password = password; |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
546 | fscandidate->ttl = ttl; |
|
26620
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
547 | |
|
29552
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
548 | g_free(foundation); |
|
a2ad7335a7a4
Split out PurpleMediaCandidate into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29551
diff
changeset
|
549 | g_free(ip); |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
550 | return fscandidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
551 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
552 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
553 | static PurpleMediaCandidate * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
554 | purple_media_candidate_from_fs(FsCandidate *fscandidate) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
555 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
556 | PurpleMediaCandidate *candidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
557 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
558 | if (fscandidate == NULL) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
559 | return NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
560 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
561 | candidate = purple_media_candidate_new(fscandidate->foundation, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
562 | fscandidate->component_id, fscandidate->type, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
563 | fscandidate->proto, fscandidate->ip, fscandidate->port); |
|
26620
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
564 | g_object_set(candidate, |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
565 | "base-ip", fscandidate->base_ip, |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
566 | "base-port", fscandidate->base_port, |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
567 | "priority", fscandidate->priority, |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
568 | "username", fscandidate->username, |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
569 | "password", fscandidate->password, |
|
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
570 | "ttl", fscandidate->ttl, NULL); |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
571 | return candidate; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
572 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
573 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
574 | static GList * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
575 | purple_media_candidate_list_from_fs(GList *candidates) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
576 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
577 | GList *new_list = NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
578 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
579 | for (; candidates; candidates = g_list_next(candidates)) { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
580 | new_list = g_list_prepend(new_list, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
581 | purple_media_candidate_from_fs( |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
582 | candidates->data)); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
583 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
584 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
585 | new_list = g_list_reverse(new_list); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
586 | return new_list; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
587 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
588 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
589 | static GList * |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
590 | purple_media_candidate_list_to_fs(GList *candidates) |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
591 | { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
592 | GList *new_list = NULL; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
593 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
594 | for (; candidates; candidates = g_list_next(candidates)) { |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
595 | new_list = g_list_prepend(new_list, |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
596 | purple_media_candidate_to_fs( |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
597 | candidates->data)); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
598 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
599 | |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
600 | new_list = g_list_reverse(new_list); |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
601 | return new_list; |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
602 | } |
|
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
603 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
604 | static FsMediaType |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
605 | 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
|
606 | { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
607 | if (type & PURPLE_MEDIA_AUDIO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
608 | return FS_MEDIA_TYPE_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
609 | else if (type & PURPLE_MEDIA_VIDEO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
610 | return FS_MEDIA_TYPE_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
611 | else |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
612 | return 0; |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
613 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
614 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
615 | static FsStreamDirection |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
616 | 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
|
617 | { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
618 | 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
|
619 | (type & PURPLE_MEDIA_VIDEO) == PURPLE_MEDIA_VIDEO) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
620 | return FS_DIRECTION_BOTH; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
621 | else if ((type & PURPLE_MEDIA_SEND_AUDIO) || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
622 | (type & PURPLE_MEDIA_SEND_VIDEO)) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
623 | return FS_DIRECTION_SEND; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
624 | else if ((type & PURPLE_MEDIA_RECV_AUDIO) || |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
625 | (type & PURPLE_MEDIA_RECV_VIDEO)) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
626 | return FS_DIRECTION_RECV; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
627 | else |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
628 | return FS_DIRECTION_NONE; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
629 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
630 | |
|
26226
dcb05990f479
Make FsStreamDirection and FsMediaType conversion functions static.
Michael Ruprecht <maiku@pidgin.im>
parents:
26217
diff
changeset
|
631 | static PurpleMediaSessionType |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
632 | 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
|
633 | { |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
634 | PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
|
23724
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
635 | if (type == FS_MEDIA_TYPE_AUDIO) { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
636 | if (direction & FS_DIRECTION_SEND) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
637 | result |= PURPLE_MEDIA_SEND_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
638 | if (direction & FS_DIRECTION_RECV) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
639 | result |= PURPLE_MEDIA_RECV_AUDIO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
640 | } else if (type == FS_MEDIA_TYPE_VIDEO) { |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
641 | if (direction & FS_DIRECTION_SEND) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
642 | result |= PURPLE_MEDIA_SEND_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
643 | if (direction & FS_DIRECTION_RECV) |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
644 | result |= PURPLE_MEDIA_RECV_VIDEO; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
645 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
646 | return result; |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
647 | } |
|
5d3300ffacad
Added some utility functions to convert PurpleMediaStreamType
Michael Ruprecht <maiku@pidgin.im>
parents:
23721
diff
changeset
|
648 | |
|
29554
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
649 | static FsCodec * |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
650 | purple_media_codec_to_fs(const PurpleMediaCodec *codec) |
|
26618
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
651 | { |
|
29554
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
652 | FsCodec *new_codec; |
|
26618
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
653 | gint id; |
|
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
654 | char *encoding_name; |
|
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
655 | PurpleMediaSessionType media_type; |
|
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
656 | guint clock_rate; |
|
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
657 | guint channels; |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
658 | GList *iter; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
659 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
660 | if (codec == NULL) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
661 | return NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
662 | |
|
29554
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
663 | g_object_get(G_OBJECT(codec), |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
664 | "id", &id, |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
665 | "encoding-name", &encoding_name, |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
666 | "media-type", &media_type, |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
667 | "clock-rate", &clock_rate, |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
668 | "channels", &channels, |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
669 | "optional-params", &iter, |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
670 | NULL); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
671 | |
|
29554
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
672 | new_codec = fs_codec_new(id, encoding_name, |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
673 | purple_media_to_fs_media_type(media_type), |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
674 | clock_rate); |
|
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
675 | new_codec->channels = channels; |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
676 | |
|
29554
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
677 | for (; iter; iter = g_list_next(iter)) { |
|
26617
514bdfc137d5
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26613
diff
changeset
|
678 | PurpleKeyValuePair *param = (PurpleKeyValuePair*)iter->data; |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
679 | fs_codec_add_optional_parameter(new_codec, |
|
26617
514bdfc137d5
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26613
diff
changeset
|
680 | param->key, param->value); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
681 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
682 | |
|
29554
f6ea03b38873
Break PurpleMediaCodec out into its own file.
Michael Ruprecht <maiku@pidgin.im>
parents:
29552
diff
changeset
|
683 | g_free(encoding_name); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
684 | return new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
685 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
686 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
687 | static PurpleMediaCodec * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
688 | purple_media_codec_from_fs(const FsCodec *codec) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
689 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
690 | PurpleMediaCodec *new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
691 | GList *iter; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
692 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
693 | if (codec == NULL) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
694 | return NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
695 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
696 | new_codec = purple_media_codec_new(codec->id, codec->encoding_name, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
697 | purple_media_from_fs(codec->media_type, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
698 | FS_DIRECTION_BOTH), codec->clock_rate); |
|
26618
9e9e610ca1a1
Hide and gobjectify PurpleMediaCodec.
Michael Ruprecht <maiku@pidgin.im>
parents:
26617
diff
changeset
|
699 | g_object_set(new_codec, "channels", codec->channels, NULL); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
700 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
701 | for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
|
26235
10cecb64ea88
Manipulate optional parameters properly.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
702 | FsCodecParameter *param = (FsCodecParameter*)iter->data; |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
703 | purple_media_codec_add_optional_parameter(new_codec, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
704 | param->name, param->value); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
705 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
706 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
707 | return new_codec; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
708 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
709 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
710 | static GList * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
711 | purple_media_codec_list_from_fs(GList *codecs) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
712 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
713 | GList *new_list = NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
714 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
715 | for (; codecs; codecs = g_list_next(codecs)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
716 | new_list = g_list_prepend(new_list, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
717 | purple_media_codec_from_fs( |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
718 | codecs->data)); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
719 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
720 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
721 | new_list = g_list_reverse(new_list); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
722 | return new_list; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
723 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
724 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
725 | static GList * |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
726 | purple_media_codec_list_to_fs(GList *codecs) |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
727 | { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
728 | GList *new_list = NULL; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
729 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
730 | for (; codecs; codecs = g_list_next(codecs)) { |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
731 | new_list = g_list_prepend(new_list, |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
732 | purple_media_codec_to_fs( |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
733 | codecs->data)); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
734 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
735 | |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
736 | new_list = g_list_reverse(new_list); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
737 | return new_list; |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
738 | } |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
739 | |
|
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
|
740 | 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
|
741 | 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
|
742 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
743 | 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
|
744 | 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
|
745 | 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
|
746 | } |
|
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
|
747 | |
|
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
|
748 | static FsParticipant* |
|
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
|
749 | purple_media_get_participant(PurpleMedia *media, const gchar *name) |
|
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
|
750 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
751 | 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
|
752 | return (FsParticipant*) (media->priv->participants) ? |
|
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
|
753 | g_hash_table_lookup(media->priv->participants, name) : 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
|
754 | } |
|
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
|
755 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
756 | static PurpleMediaStream* |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
757 | 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
|
758 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
759 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
760 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
761 | 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
|
762 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
763 | streams = media->priv->streams; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
764 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
765 | for (; streams; streams = g_list_next(streams)) { |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
766 | PurpleMediaStream *stream = streams->data; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
767 | if (!strcmp(stream->session->id, session) && |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
768 | !strcmp(stream->participant, participant)) |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
769 | return stream; |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
770 | } |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
771 | |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
772 | 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
|
773 | } |
|
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
|
774 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
775 | static GList * |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
776 | 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
|
777 | const gchar *participant) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
778 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
779 | GList *streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
780 | GList *ret = NULL; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
781 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
782 | 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
|
783 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
784 | streams = media->priv->streams; |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
785 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
786 | 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
|
787 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
788 | if ((session == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
789 | !strcmp(stream->session->id, session)) && |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
790 | (participant == NULL || |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
791 | !strcmp(stream->participant, participant))) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
792 | 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
|
793 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
794 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
795 | return ret; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
796 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
797 | |
|
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
|
798 | 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
|
799 | 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
|
800 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
801 | 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
|
802 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
803 | |
|
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
|
804 | 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
|
805 | 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
|
806 | 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
|
807 | } |
|
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
|
808 | 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
|
809 | } |
|
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
|
810 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
811 | static gboolean |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
812 | purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
813 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
814 | 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
|
815 | 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
|
816 | } |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
817 | |
|
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
|
818 | static FsParticipant * |
|
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
|
819 | purple_media_add_participant(PurpleMedia *media, const gchar *name) |
|
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
|
820 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
821 | FsParticipant *participant; |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
822 | GError *err = 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
|
823 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
824 | 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
|
825 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
826 | participant = purple_media_get_participant(media, name); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
827 | |
|
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
|
828 | if (participant) |
|
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
|
829 | return participant; |
|
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
|
830 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
831 | participant = fs_conference_new_participant(media->priv->conference, |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
832 | (gchar*)name, &err); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
833 | |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
834 | if (err) { |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
835 | purple_debug_error("media", "Error creating participant: %s\n", |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
836 | err->message); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
837 | g_error_free(err); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
838 | return NULL; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
839 | } |
|
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
|
840 | |
|
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
|
841 | if (!media->priv->participants) { |
|
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
|
842 | purple_debug_info("media", "Creating hash table for participants\n"); |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
843 | media->priv->participants = g_hash_table_new_full(g_str_hash, |
|
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
844 | g_str_equal, g_free, NULL); |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
845 | } |
|
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
|
846 | |
|
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
|
847 | g_hash_table_insert(media->priv->participants, g_strdup(name), participant); |
|
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
|
848 | |
|
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
|
849 | return participant; |
|
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
|
850 | } |
|
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
|
851 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
852 | 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
|
853 | 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
|
854 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
855 | PurpleMediaStream *media_stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
856 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
857 | 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
|
858 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
859 | media_stream = g_new0(PurpleMediaStream, 1); |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
860 | media_stream->stream = stream; |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
861 | media_stream->participant = g_strdup(name); |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
862 | 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
|
863 | |
|
26162
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
864 | session->media->priv->streams = |
|
5089efd94a64
Added PurpleMediaStream to wrap FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26160
diff
changeset
|
865 | 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
|
866 | |
|
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
867 | 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
|
868 | } |
|
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
|
869 | |
|
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
|
870 | 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
|
871 | purple_media_insert_local_candidate(PurpleMediaSession *session, const gchar *name, |
|
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
|
872 | FsCandidate *candidate) |
|
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
|
873 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
874 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
875 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
876 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
877 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
878 | 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
|
879 | 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
|
880 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
881 | #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
|
882 | |
|
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
|
883 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
884 | 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
|
885 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
886 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
887 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
| 26332 | 888 | return media->priv->sessions != NULL ? |
| 889 | 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
|
890 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
891 | 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
|
892 | #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
|
893 | } |
|
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
|
894 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
895 | #ifdef USE_VV |
|
26452
825493ce644e
Remove purple_media_set_src/sink from the public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26451
diff
changeset
|
896 | 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
|
897 | 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
|
898 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
899 | 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
|
900 | 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
|
901 | GstPad *srcpad; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
902 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
903 | 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
|
904 | 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
|
905 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
906 | 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
|
907 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
908 | if (session == NULL) { |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
909 | 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
|
910 | " 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
|
911 | return; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
912 | } |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
913 | |
|
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
|
914 | 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
|
915 | 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
|
916 | session->src = src; |
|
26426
4909c56fe88e
Fix some GStreamer timing issues.
Michael Ruprecht <maiku@pidgin.im>
parents:
26425
diff
changeset
|
917 | 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
|
918 | |
|
26321
a1d92d85cb34
Handle the session tee in the session rather than the src bin.
Michael Ruprecht <maiku@pidgin.im>
parents:
26320
diff
changeset
|
919 | 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
|
920 | 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
|
921 | |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
922 | /* 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
|
923 | 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
|
924 | == GST_ELEMENT_PARENT(session->src)) { |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
925 | 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
|
926 | 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
|
927 | gst_object_unref(pad); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
928 | gst_pad_set_active(ghost, TRUE); |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
929 | 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
|
930 | } |
|
764632d560ee
Make sharing sources between media sessions work.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
931 | |
|
28162
ae64a0a0fb19
Let's keep this working right.
Michael Ruprecht <maiku@pidgin.im>
parents:
28161
diff
changeset
|
932 | 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
|
933 | 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
|
934 | |
|
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
|
935 | 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
|
936 | 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
|
937 | 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
|
938 | GstElement *level; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
939 | 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
|
940 | 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
|
941 | "/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
|
942 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
943 | 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
|
944 | 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
|
945 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
946 | 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
|
947 | 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
|
948 | 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
|
949 | 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
|
950 | gst_element_link(volume, level); |
|
ae64a0a0fb19
Let's keep this working right.
Michael Ruprecht <maiku@pidgin.im>
parents:
28161
diff
changeset
|
951 | 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
|
952 | 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
|
953 | 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
|
954 | } else { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
955 | 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
|
956 | } |
|
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
|
957 | 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
|
958 | 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
|
959 | ? "success" : "failure"); |
|
26426
4909c56fe88e
Fix some GStreamer timing issues.
Michael Ruprecht <maiku@pidgin.im>
parents:
26425
diff
changeset
|
960 | 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
|
961 | 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
|
962 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
963 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
964 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
965 | #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
|
966 | 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
|
967 | 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
|
968 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
969 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
970 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
971 | 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
|
972 | 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
|
973 | 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
|
974 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
975 | 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
|
976 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
977 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
978 | #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
|
979 | |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
980 | #ifdef USE_VV |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
981 | static PurpleMediaSession * |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
982 | purple_media_session_from_fs_stream(PurpleMedia *media, FsStream *stream) |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
983 | { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
984 | FsSession *fssession; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
985 | GList *values; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
986 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
987 | 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
|
988 | g_return_val_if_fail(FS_IS_STREAM(stream), NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
989 | |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
990 | g_object_get(stream, "session", &fssession, NULL); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
991 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
992 | values = g_hash_table_get_values(media->priv->sessions); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
993 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
994 | for (; values; values = g_list_delete_link(values, values)) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
995 | PurpleMediaSession *session = values->data; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
996 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
997 | if (session->session == fssession) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
998 | g_list_free(values); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
999 | g_object_unref(fssession); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1000 | return session; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1001 | } |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1002 | } |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1003 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1004 | g_object_unref(fssession); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1005 | return NULL; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1006 | } |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1007 | |
|
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
|
1008 | static gboolean |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1009 | 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
|
1010 | { |
|
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
|
1011 | 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
|
1012 | case GST_MESSAGE_ELEMENT: { |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1013 | 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
|
1014 | 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
|
1015 | && gst_structure_has_name( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1016 | 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
|
1017 | 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
|
1018 | gchar *name; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1019 | gchar *participant = NULL; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1020 | PurpleMediaSession *session = NULL; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1021 | gdouble rms_db; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1022 | gdouble percent; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1023 | const GValue *list; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1024 | const GValue *value; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1025 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1026 | if (!PURPLE_IS_MEDIA(media) || |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1027 | GST_ELEMENT_PARENT(src) != |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1028 | media->priv->confbin) |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1029 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1030 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1031 | 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
|
1032 | if (!strncmp(name, "sendlevel_", 10)) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1033 | session = purple_media_get_session( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1034 | media, name+10); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1035 | } else { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1036 | GList *iter = media->priv->streams; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1037 | 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
|
1038 | PurpleMediaStream *stream = iter->data; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1039 | if (stream->level == src) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1040 | session = stream->session; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1041 | participant = stream->participant; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1042 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1043 | } |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1044 | } |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1045 | } |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1046 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1047 | if (!session) |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1048 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1049 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1050 | list = gst_structure_get_value( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1051 | 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
|
1052 | 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
|
1053 | 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
|
1054 | 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
|
1055 | if(percent > 1.0) |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1056 | percent = 1.0; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1057 | |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1058 | 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
|
1059 | 0, session->id, participant, percent); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1060 | break; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1061 | } |
|
26320
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1062 | if (!FS_IS_CONFERENCE(GST_MESSAGE_SRC(msg)) || |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1063 | !PURPLE_IS_MEDIA(media) || |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1064 | media->priv->conference != |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1065 | FS_CONFERENCE(GST_MESSAGE_SRC(msg))) |
|
2e9c1e8391f4
Move pipeline creation into the media manager.
Michael Ruprecht <maiku@pidgin.im>
parents:
26317
diff
changeset
|
1066 | break; |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26270
diff
changeset
|
1067 | |
|
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
|
1068 | if (gst_structure_has_name(msg->structure, "farsight-error")) { |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1069 | FsError error_no; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1070 | gst_structure_get_enum(msg->structure, "error-no", |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1071 | FS_TYPE_ERROR, (gint*)&error_no); |
|
28399
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1072 | switch (error_no) { |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1073 | case FS_ERROR_NO_CODECS: |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1074 | purple_media_error(media, _("No codecs found. Install some GStreamer codecs found in GStreamer plugins packages.")); |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1075 | purple_media_end(media, NULL, NULL); |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1076 | break; |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1077 | case FS_ERROR_NO_CODECS_LEFT: |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1078 | purple_media_error(media, _("No codecs left. Your codec preferences in fs-codecs.conf are too strict.")); |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1079 | purple_media_end(media, NULL, NULL); |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1080 | break; |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1081 | case FS_ERROR_UNKNOWN_CNAME: |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1082 | /* |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1083 | * Unknown CName is only a problem for the |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1084 | * multicast transmitter which isn't used. |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1085 | * It is also deprecated. |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1086 | */ |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1087 | break; |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1088 | default: |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1089 | purple_debug_error("media", "farsight-error: %i: %s\n", error_no, |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1090 | gst_structure_get_string(msg->structure, "error-msg")); |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1091 | break; |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1092 | } |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1093 | |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1094 | if (FS_ERROR_IS_FATAL(error_no)) { |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1095 | purple_media_error(media, _("A non-recoverable Farsight2 error has occurred.")); |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1096 | purple_media_end(media, NULL, NULL); |
|
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1097 | } |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1098 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1099 | "farsight-new-local-candidate")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1100 | FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1101 | FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "candidate")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1102 | PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1103 | purple_media_new_local_candidate_cb(stream, local_candidate, session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1104 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1105 | "farsight-local-candidates-prepared")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1106 | FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1107 | PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1108 | purple_media_candidates_prepared_cb(stream, session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1109 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1110 | "farsight-new-active-candidate-pair")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1111 | FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1112 | FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "local-candidate")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1113 | FsCandidate *remote_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "remote-candidate")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1114 | PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1115 | purple_media_candidate_pair_established_cb(stream, local_candidate, remote_candidate, session); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1116 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1117 | "farsight-recv-codecs-changed")) { |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1118 | GList *codecs = g_value_get_boxed(gst_structure_get_value(msg->structure, "codecs")); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1119 | FsCodec *codec = codecs->data; |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1120 | purple_debug_info("media", "farsight-recv-codecs-changed: %s\n", codec->encoding_name); |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1121 | |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1122 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1123 | "farsight-component-state-changed")) { |
|
26297
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1124 | FsStreamState fsstate = g_value_get_enum(gst_structure_get_value(msg->structure, "state")); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1125 | guint component = g_value_get_uint(gst_structure_get_value(msg->structure, "component")); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1126 | const gchar *state; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1127 | switch (fsstate) { |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1128 | case FS_STREAM_STATE_FAILED: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1129 | state = "FAILED"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1130 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1131 | case FS_STREAM_STATE_DISCONNECTED: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1132 | state = "DISCONNECTED"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1133 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1134 | case FS_STREAM_STATE_GATHERING: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1135 | state = "GATHERING"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1136 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1137 | case FS_STREAM_STATE_CONNECTING: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1138 | state = "CONNECTING"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1139 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1140 | case FS_STREAM_STATE_CONNECTED: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1141 | state = "CONNECTED"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1142 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1143 | case FS_STREAM_STATE_READY: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1144 | state = "READY"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1145 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1146 | default: |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1147 | state = "UNKNOWN"; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1148 | break; |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1149 | } |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1150 | purple_debug_info("media", "farsight-component-state-changed: component: %u state: %s\n", component, state); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1151 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1152 | "farsight-send-codec-changed")) { |
|
26297
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1153 | FsCodec *codec = g_value_get_boxed(gst_structure_get_value(msg->structure, "codec")); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1154 | gchar *codec_str = fs_codec_to_string(codec); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1155 | purple_debug_info("media", "farsight-send-codec-changed: codec: %s\n", codec_str); |
|
7150ea9de94b
Add some debug messages for the remaining Farsight signals.
Michael Ruprecht <maiku@pidgin.im>
parents:
26296
diff
changeset
|
1156 | g_free(codec_str); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1157 | } else if (gst_structure_has_name(msg->structure, |
|
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1158 | "farsight-codecs-changed")) { |
|
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
|
1159 | GList *sessions = g_hash_table_get_values(PURPLE_MEDIA(media)->priv->sessions); |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1160 | FsSession *fssession = g_value_get_object(gst_structure_get_value(msg->structure, "session")); |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1161 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1162 | PurpleMediaSession *session = sessions->data; |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1163 | if (session->session == fssession) { |
|
26436
2e5e9f45924c
Remove the ready-new signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26434
diff
changeset
|
1164 | gchar *session_id = g_strdup(session->id); |
|
26265
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
1165 | g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, session_id); |
|
66aee93241e2
Added codecs-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26264
diff
changeset
|
1166 | g_free(session_id); |
|
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
|
1167 | g_list_free(sessions); |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1168 | break; |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1169 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
1170 | } |
|
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
|
1171 | } |
|
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
|
1172 | 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
|
1173 | } |
|
28359
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1174 | case GST_MESSAGE_ERROR: { |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1175 | GstElement *element = GST_ELEMENT(GST_MESSAGE_SRC(msg)); |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1176 | GstElement *lastElement = NULL; |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1177 | while (!GST_IS_PIPELINE(element)) { |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1178 | if (element == media->priv->confbin) { |
|
28547
39f45fd83caa
I can't see why dots should be usefull here:
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
28419
diff
changeset
|
1179 | purple_media_error(media, _("Conference error")); |
|
28359
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1180 | purple_media_end(media, NULL, NULL); |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1181 | break; |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1182 | } |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1183 | lastElement = element; |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1184 | element = GST_ELEMENT_PARENT(element); |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1185 | } |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1186 | if (GST_IS_PIPELINE(element)) { |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1187 | GList *sessions = g_hash_table_get_values(media->priv->sessions); |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1188 | for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1189 | PurpleMediaSession *session = sessions->data; |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1190 | |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1191 | if (session->src == lastElement) { |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1192 | if (session->type & PURPLE_MEDIA_AUDIO) |
|
28547
39f45fd83caa
I can't see why dots should be usefull here:
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
28419
diff
changeset
|
1193 | purple_media_error(media, _("Error with your microphone")); |
|
28359
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1194 | else |
|
28547
39f45fd83caa
I can't see why dots should be usefull here:
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
28419
diff
changeset
|
1195 | purple_media_error(media, _("Error with your webcam")); |
|
28359
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1196 | purple_media_end(media, NULL, NULL); |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1197 | break; |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1198 | } |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1199 | } |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1200 | g_list_free(sessions); |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1201 | } |
|
109d57b2591f
Detect that there has been an error in the GStreamer pipeline, output an
Michael Ruprecht <maiku@pidgin.im>
parents:
28331
diff
changeset
|
1202 | } |
|
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
|
1203 | default: |
|
26120
b4ab036ab9fe
Remove a bunch of extraneous GstBus messages from the debug output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26119
diff
changeset
|
1204 | 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
|
1205 | } |
|
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
|
1206 | |
|
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
|
1207 | 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
|
1208 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1209 | #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
|
1210 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
1211 | PurpleAccount * |
|
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
1212 | purple_media_get_account(PurpleMedia *media) |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1213 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1214 | #ifdef USE_VV |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26640
diff
changeset
|
1215 | PurpleAccount *account; |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1216 | 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
|
1217 | 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
|
1218 | 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
|
1219 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1220 | 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
|
1221 | #endif |
|
26327
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1222 | } |
|
6a436310d508
Added the connection property back to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26324
diff
changeset
|
1223 | |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1224 | gpointer |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1225 | purple_media_get_prpl_data(PurpleMedia *media) |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1226 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1227 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1228 | gpointer prpl_data; |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1229 | 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
|
1230 | 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
|
1231 | 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
|
1232 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1233 | 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
|
1234 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1235 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1236 | |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1237 | void |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1238 | 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
|
1239 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1240 | #ifdef USE_VV |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1241 | 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
|
1242 | 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
|
1243 | #endif |
|
26328
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1244 | } |
|
9c15d3c83e24
Add a prpl-data property to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26327
diff
changeset
|
1245 | |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1246 | void |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1247 | purple_media_error(PurpleMedia *media, const gchar *error, ...) |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1248 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1249 | #ifdef USE_VV |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1250 | va_list args; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1251 | gchar *message; |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1252 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1253 | 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
|
1254 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1255 | va_start(args, error); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1256 | message = g_strdup_vprintf(error, args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1257 | va_end(args); |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1258 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1259 | 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
|
1260 | 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
|
1261 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1262 | 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
|
1263 | #endif |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1264 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1265 | |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26181
diff
changeset
|
1266 | void |
|
26264
c062fc1f212f
Added purple_media_end and removed the purple_media_got_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26263
diff
changeset
|
1267 | 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
|
1268 | 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
|
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 | g_return_if_fail(PURPLE_IS_MEDIA(media)); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1272 | 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
|
1273 | 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
|
1274 | 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
|
1275 | NULL, NULL); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1276 | g_object_unref(media); |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1277 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1278 | #endif |
|
19885
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1279 | } |
|
593613a22e57
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@pidgin.im>
parents:
19883
diff
changeset
|
1280 | |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
1281 | void |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
1282 | 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
|
1283 | 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
|
1284 | gboolean local) |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
1285 | { |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
1286 | #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
|
1287 | 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
|
1288 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1289 | if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1290 | GList *streams; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1291 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1292 | 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
|
1293 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1294 | streams = purple_media_get_streams(media, |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1295 | session_id, participant); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1296 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1297 | for (; streams; streams = |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1298 | g_list_delete_link(streams, streams)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1299 | PurpleMediaStream *stream = streams->data; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1300 | g_object_set(G_OBJECT(stream->stream), "direction", |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1301 | purple_media_to_fs_stream_direction( |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1302 | stream->session->type), NULL); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1303 | stream->accepted = TRUE; |
|
28419
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1304 | |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1305 | if (stream->remote_candidates != NULL) { |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1306 | GError *err = NULL; |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1307 | fs_stream_set_remote_candidates(stream->stream, |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1308 | stream->remote_candidates, &err); |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1309 | |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1310 | if (err) { |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1311 | purple_debug_error("media", "Error adding remote" |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1312 | " candidates: %s\n", err->message); |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1313 | g_error_free(err); |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1314 | } |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1315 | } |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1316 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1317 | } 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
|
1318 | type == PURPLE_MEDIA_INFO_UNMUTE)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1319 | GList *sessions; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1320 | gboolean active = (type == PURPLE_MEDIA_INFO_MUTE); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1321 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1322 | 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
|
1323 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1324 | if (session_id == NULL) |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1325 | sessions = g_hash_table_get_values( |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1326 | media->priv->sessions); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1327 | else |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1328 | sessions = g_list_prepend(NULL, |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1329 | purple_media_get_session( |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1330 | media, session_id)); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1331 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1332 | 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
|
1333 | 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
|
1334 | |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1335 | for (; sessions; sessions = g_list_delete_link( |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1336 | sessions, sessions)) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1337 | PurpleMediaSession *session = sessions->data; |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1338 | 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
|
1339 | 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
|
1340 | session->id); |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1341 | 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
|
1342 | GST_BIN(session->media-> |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1343 | priv->confbin), name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1344 | g_free(name); |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1345 | g_object_set(volume, "mute", active, NULL); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1346 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1347 | } |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1348 | } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_PAUSE || |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1349 | type == PURPLE_MEDIA_INFO_UNPAUSE)) { |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1350 | gboolean active = (type == PURPLE_MEDIA_INFO_PAUSE); |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1351 | GList *streams = purple_media_get_streams(media, |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1352 | session_id, participant); |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1353 | for (; streams; streams = g_list_delete_link(streams, streams)) { |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1354 | PurpleMediaStream *stream = streams->data; |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1355 | if (stream->session->type & PURPLE_MEDIA_SEND_VIDEO) { |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1356 | g_object_set(stream->stream, "direction", |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1357 | purple_media_to_fs_stream_direction( |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1358 | stream->session->type & ((active) ? |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1359 | ~PURPLE_MEDIA_SEND_VIDEO : |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1360 | PURPLE_MEDIA_VIDEO)), NULL); |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1361 | } |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
1362 | } |
|
26498
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1363 | } |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1364 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1365 | 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
|
1366 | 0, type, session_id, participant, local); |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1367 | |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1368 | if (type == PURPLE_MEDIA_INFO_HANGUP || |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1369 | type == PURPLE_MEDIA_INFO_REJECT) { |
|
645595d12ee8
Move functionality into purple_media_stream_info.
Michael Ruprecht <maiku@pidgin.im>
parents:
26497
diff
changeset
|
1370 | 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
|
1371 | } |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
1372 | #endif |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
diff
changeset
|
1373 | } |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26490
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 |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1376 | static void |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1377 | purple_media_new_local_candidate_cb(FsStream *stream, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1378 | FsCandidate *local_candidate, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1379 | 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
|
1380 | { |
|
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
|
1381 | gchar *name; |
|
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
|
1382 | FsParticipant *participant; |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1383 | PurpleMediaCandidate *candidate; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1384 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1385 | g_return_if_fail(FS_IS_STREAM(stream)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1386 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1387 | |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1388 | purple_debug_info("media", "got new local candidate: %s\n", local_candidate->foundation); |
|
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
|
1389 | g_object_get(stream, "participant", &participant, 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
|
1390 | g_object_get(participant, "cname", &name, 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
|
1391 | g_object_unref(participant); |
|
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
|
1392 | |
|
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
|
1393 | purple_media_insert_local_candidate(session, name, fs_candidate_copy(local_candidate)); |
|
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
|
1394 | |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1395 | candidate = purple_media_candidate_from_fs(local_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
|
1396 | g_signal_emit(session->media, purple_media_signals[NEW_CANDIDATE], |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
1397 | 0, session->id, name, candidate); |
|
26620
a34fb2386da5
Hide and GObjectify PurpleMediaCandidate.
Michael Ruprecht <maiku@pidgin.im>
parents:
26618
diff
changeset
|
1398 | g_object_unref(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
|
1399 | |
|
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
|
1400 | g_free(name); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1401 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1402 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1403 | static void |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1404 | purple_media_candidates_prepared_cb(FsStream *stream, 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
|
1405 | { |
|
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
|
1406 | gchar *name; |
|
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
|
1407 | FsParticipant *participant; |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1408 | PurpleMediaStream *stream_data; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1409 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1410 | g_return_if_fail(FS_IS_STREAM(stream)); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1411 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1412 | |
|
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
|
1413 | g_object_get(stream, "participant", &participant, 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
|
1414 | g_object_get(participant, "cname", &name, 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
|
1415 | g_object_unref(participant); |
|
26189
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1416 | |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1417 | stream_data = purple_media_get_stream(session->media, session->id, name); |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1418 | stream_data->candidates_prepared = TRUE; |
|
32cf2cf21fd6
Implement a new ready signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26187
diff
changeset
|
1419 | |
|
26417
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1420 | g_signal_emit(session->media, |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1421 | purple_media_signals[CANDIDATES_PREPARED], |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1422 | 0, session->id, name); |
|
b73b6e73abe6
Add candidates-prepared signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26412
diff
changeset
|
1423 | |
|
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
|
1424 | g_free(name); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1425 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1426 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1427 | /* 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
|
1428 | * 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
|
1429 | static void |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1430 | purple_media_candidate_pair_established_cb(FsStream *fsstream, |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1431 | FsCandidate *native_candidate, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1432 | FsCandidate *remote_candidate, |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
1433 | 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
|
1434 | { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1435 | gchar *name; |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1436 | FsParticipant *participant; |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1437 | PurpleMediaStream *stream; |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1438 | GList *iter; |
|
26116
41f7d4545566
Fixed a ton of memory leaks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26115
diff
changeset
|
1439 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1440 | 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
|
1441 | g_return_if_fail(session != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1442 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1443 | g_object_get(fsstream, "participant", &participant, NULL); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1444 | g_object_get(participant, "cname", &name, NULL); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1445 | g_object_unref(participant); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1446 | |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1447 | stream = purple_media_get_stream(session->media, session->id, name); |
|
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1448 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1449 | iter = stream->active_local_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1450 | for(; iter; iter = g_list_next(iter)) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1451 | FsCandidate *c = iter->data; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1452 | if (native_candidate->component_id == c->component_id) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1453 | fs_candidate_destroy(c); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1454 | stream->active_local_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1455 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1456 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1457 | stream->active_local_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1458 | fs_candidate_copy(native_candidate)); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1459 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1460 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1461 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1462 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1463 | stream->active_local_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1464 | stream->active_local_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1465 | fs_candidate_copy(native_candidate)); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1466 | |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1467 | iter = stream->active_remote_candidates; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1468 | for(; iter; iter = g_list_next(iter)) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1469 | FsCandidate *c = iter->data; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1470 | if (native_candidate->component_id == c->component_id) { |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1471 | fs_candidate_destroy(c); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1472 | stream->active_remote_candidates = |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1473 | g_list_delete_link(iter, iter); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1474 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1475 | stream->active_remote_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1476 | fs_candidate_copy(remote_candidate)); |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1477 | break; |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1478 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1479 | } |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1480 | if (iter == NULL) |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1481 | stream->active_remote_candidates = g_list_prepend( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1482 | stream->active_remote_candidates, |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1483 | fs_candidate_copy(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
|
1484 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1485 | 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
|
1486 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1487 | |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1488 | static gboolean |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1489 | 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
|
1490 | { |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1491 | 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
|
1492 | |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1493 | stream->connected_cb_id = 0; |
|
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1494 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1495 | 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
|
1496 | 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
|
1497 | stream->session->media, |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
1498 | 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
|
1499 | |
|
26234
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1500 | 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
|
1501 | purple_media_signals[STATE_CHANGED], |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26447
diff
changeset
|
1502 | 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
|
1503 | 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
|
1504 | return FALSE; |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1505 | } |
|
b94d1e8250a1
Fix some crashes from printing debug messages on a separate thread.
Michael Ruprecht <maiku@pidgin.im>
parents:
26232
diff
changeset
|
1506 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1507 | static void |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1508 | 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
|
1509 | 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
|
1510 | { |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1511 | 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
|
1512 | GstPad *sinkpad; |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1513 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1514 | 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
|
1515 | g_return_if_fail(stream != NULL); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1516 | |
|
26317
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1517 | 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
|
1518 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1519 | if (stream->src == NULL) { |
| 26340 | 1520 | 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
|
1521 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1522 | 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
|
1523 | GstElement *queue = NULL; |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1524 | 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
|
1525 | "/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
|
1526 | /* |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1527 | * 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
|
1528 | * 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
|
1529 | * 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
|
1530 | */ |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1531 | 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
|
1532 | 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
|
1533 | "volume", NULL); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1534 | 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
|
1535 | output_volume, NULL); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1536 | 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
|
1537 | "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
|
1538 | 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
|
1539 | "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
|
1540 | 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
|
1541 | PURPLE_MEDIA_RECV_AUDIO, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26519
diff
changeset
|
1542 | stream->session->media, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26519
diff
changeset
|
1543 | stream->session->id, |
|
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26519
diff
changeset
|
1544 | stream->participant); |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1545 | 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
|
1546 | 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
|
1547 | 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
|
1548 | 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
|
1549 | 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
|
1550 | 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
|
1551 | 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
|
1552 | 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
|
1553 | 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
|
1554 | 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
|
1555 | 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
|
1556 | 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
|
1557 | } 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
|
1558 | 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
|
1559 | "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
|
1560 | 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
|
1561 | "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
|
1562 | 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
|
1563 | 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
|
1564 | 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
|
1565 | } |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1566 | 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
|
1567 | 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
|
1568 | stream->src, stream->tee, NULL); |
|
28140
bbb3777dbe3e
Switch around some GStreamer linking and state setting.
Michael Ruprecht <maiku@pidgin.im>
parents:
28133
diff
changeset
|
1569 | 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
|
1570 | 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
|
1571 | 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
|
1572 | } |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1573 | |
|
ba0a648f53f9
Have all src_pads for a stream be funneled into the same stream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26315
diff
changeset
|
1574 | 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
|
1575 | 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
|
1576 | 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
|
1577 | |
|
26324
4100af381e4e
Use purple_timeout_* instead of g_timeout_*.
Michael Ruprecht <maiku@pidgin.im>
parents:
26323
diff
changeset
|
1578 | 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
|
1579 | (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
|
1580 | } |
|
27202
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1581 | |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1582 | static void |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1583 | purple_media_element_added_cb(FsElementAddedNotifier *self, |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1584 | GstBin *bin, GstElement *element, gpointer user_data) |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1585 | { |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1586 | /* |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1587 | * Hack to make H264 work with Gmail video. |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1588 | */ |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1589 | if (!strncmp(GST_ELEMENT_NAME(element), "x264", 4)) { |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1590 | g_object_set(GST_OBJECT(element), "cabac", FALSE, NULL); |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1591 | } |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1592 | } |
|
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
|
1593 | #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
|
1594 | |
|
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
|
1595 | 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
|
1596 | 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
|
1597 | 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
|
1598 | 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
|
1599 | 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
|
1600 | { |
|
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
|
1601 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1602 | 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
|
1603 | FsParticipant *participant = NULL; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1604 | 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
|
1605 | 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
|
1606 | 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
|
1607 | purple_media_to_fs_stream_direction(type); |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1608 | gboolean is_nice = !strcmp(transmitter, "nice"); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1609 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1610 | 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
|
1611 | |
|
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
|
1612 | 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
|
1613 | 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
|
1614 | 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
|
1615 | 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
|
1616 | 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
|
1617 | 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
|
1618 | 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
|
1619 | 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
|
1620 | } |
|
125fcb01d1ac
Decouple the media_bus_call from the backend. It will still be needed even
Michael Ruprecht <maiku@pidgin.im>
parents:
29566
diff
changeset
|
1621 | |
|
29565
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1622 | 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
|
1623 | 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
|
1624 | num_params, params)) { |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1625 | 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
|
1626 | return FALSE; |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1627 | } |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1628 | |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1629 | /* 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
|
1630 | 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
|
1631 | media->priv->conference = |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1632 | 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
|
1633 | 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
|
1634 | media->priv->backend)); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1635 | 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
|
1636 | media->priv->conference); |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1637 | } |
|
c37ea1d82326
Start to use the media backend code in PurpleMedia and PurpleMediaManager.
Michael Ruprecht <maiku@pidgin.im>
parents:
29561
diff
changeset
|
1638 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1639 | 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
|
1640 | |
|
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
|
1641 | if (!session) { |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1642 | GError *err = NULL; |
|
27205
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1643 | GList *codec_conf = NULL, *iter = NULL; |
|
26148
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1644 | gchar *filename = 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
|
1645 | 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
|
1646 | 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
|
1647 | |
|
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
|
1648 | session = g_new0(PurpleMediaSession, 1); |
|
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23711
diff
changeset
|
1649 | |
|
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
|
1650 | session->session = fs_conference_new_session( |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1651 | media->priv->conference, media_type, &err); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1652 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1653 | if (err != NULL) { |
|
28399
04f4e8c60778
Add some extra error strings just in case.
Michael Ruprecht <maiku@pidgin.im>
parents:
28377
diff
changeset
|
1654 | purple_media_error(media, _("Error creating session: %s"), err->message); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1655 | g_error_free(err); |
|
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
|
1656 | g_free(session); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1657 | return FALSE; |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1658 | } |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1659 | |
|
26148
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1660 | filename = g_build_filename(purple_user_dir(), "fs-codec.conf", NULL); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1661 | codec_conf = fs_codec_list_from_keyfile(filename, &err); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1662 | g_free(filename); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1663 | |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1664 | if (err != NULL) { |
|
26296
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1665 | if (err->code == 4) |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1666 | purple_debug_info("media", "Couldn't read " |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1667 | "fs-codec.conf: %s\n", |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1668 | err->message); |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1669 | else |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1670 | purple_debug_error("media", "Error reading " |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1671 | "fs-codec.conf: %s\n", |
|
059a3c380f94
Don't output an error if fs-codec.conf doesn't exist.
Michael Ruprecht <maiku@pidgin.im>
parents:
26290
diff
changeset
|
1672 | err->message); |
|
26148
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1673 | g_error_free(err); |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1674 | } |
|
fd54f5fd9bcb
Use a key file for Farsight 2 codec configuration.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1675 | |
|
27205
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1676 | /* |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1677 | * Add SPEEX if the configuration file doesn't exist or |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1678 | * there isn't a speex entry. |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1679 | */ |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1680 | for (iter = codec_conf; iter; iter = g_list_next(iter)) { |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1681 | FsCodec *codec = iter->data; |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1682 | if (!g_ascii_strcasecmp(codec->encoding_name, "speex")) |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1683 | break; |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1684 | } |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1685 | |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1686 | if (iter == NULL) { |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1687 | codec_conf = g_list_prepend(codec_conf, |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1688 | fs_codec_new(FS_CODEC_ID_ANY, |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1689 | "SPEEX", FS_MEDIA_TYPE_AUDIO, 8000)); |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1690 | codec_conf = g_list_prepend(codec_conf, |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1691 | fs_codec_new(FS_CODEC_ID_ANY, |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1692 | "SPEEX", FS_MEDIA_TYPE_AUDIO, 16000)); |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1693 | } |
|
fe56c88850ce
Add speex as a default codec.
Michael Ruprecht <maiku@pidgin.im>
parents:
27202
diff
changeset
|
1694 | |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1695 | fs_session_set_codec_preferences(session->session, codec_conf, 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
|
1696 | |
|
26180
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1697 | /* |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1698 | * Removes a 5-7 second delay before |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1699 | * receiving the src-pad-added signal. |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1700 | * Only works for non-multicast FsRtpSessions. |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1701 | */ |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1702 | if (is_nice || !strcmp(transmitter, "rawudp")) |
|
26180
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1703 | g_object_set(G_OBJECT(session->session), |
|
7ee4ef9150fd
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Michael Ruprecht <maiku@pidgin.im>
parents:
26179
diff
changeset
|
1704 | "no-rtcp-timeout", 0, NULL); |
|
23726
43a5e1a3131d
Temporary fix to remove a 5-7 second delay when initiating a media session.
Michael Ruprecht <maiku@pidgin.im>
parents:
23724
diff
changeset
|
1705 | |
|
27202
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1706 | /* |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1707 | * Hack to make x264 work with Gmail video. |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1708 | */ |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1709 | if (is_nice && !strcmp(sess_id, "google-video")) { |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1710 | FsElementAddedNotifier *notifier = |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1711 | fs_element_added_notifier_new(); |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1712 | g_signal_connect(G_OBJECT(notifier), "element-added", |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1713 | G_CALLBACK(purple_media_element_added_cb), |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1714 | stream); |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1715 | fs_element_added_notifier_add(notifier, |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1716 | GST_BIN(media->priv->conference)); |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1717 | } |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1718 | |
|
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
|
1719 | fs_codec_list_destroy(codec_conf); |
|
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
|
1720 | |
|
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
|
1721 | 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
|
1722 | 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
|
1723 | session->type = type; |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1724 | 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
|
1725 | |
|
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
|
1726 | purple_media_add_session(media, session); |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1727 | 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
|
1728 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1729 | session->id, NULL); |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1730 | |
|
28161
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1731 | 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
|
1732 | 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
|
1733 | 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
|
1734 | 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
|
1735 | 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
|
1736 | 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
|
1737 | 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
|
1738 | 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
|
1739 | "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
|
1740 | session->id); |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1741 | 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
|
1742 | return FALSE; |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1743 | } |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1744 | |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1745 | 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
|
1746 | 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
|
1747 | 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
|
1748 | 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
|
1749 | session->media, |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
1750 | 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
|
1751 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1752 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1753 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1754 | if (!(participant = purple_media_add_participant(media, who))) { |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1755 | purple_media_remove_session(media, session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1756 | g_free(session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1757 | return FALSE; |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1758 | } else { |
|
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1759 | 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
|
1760 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1761 | NULL, who); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1762 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1763 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1764 | stream = purple_media_get_stream(media, sess_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
|
1765 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1766 | if (!stream) { |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1767 | GError *err = NULL; |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1768 | FsStream *fsstream = NULL; |
|
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
|
1769 | const gchar *stun_ip = purple_network_get_stun_ip(); |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1770 | const gchar *turn_ip = purple_network_get_turn_ip(); |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1771 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1772 | if (stun_ip || turn_ip) { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1773 | guint new_num_params = |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1774 | (stun_ip && is_nice) && turn_ip ? |
|
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1775 | num_params + 2 : num_params + 1; |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1776 | guint next_param_index = num_params; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1777 | GParameter *param = g_new0(GParameter, new_num_params); |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1778 | memcpy(param, params, sizeof(GParameter) * num_params); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1779 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1780 | if (stun_ip) { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1781 | purple_debug_info("media", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1782 | "setting property stun-ip on new stream: %s\n", stun_ip); |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1783 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1784 | param[next_param_index].name = "stun-ip"; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1785 | g_value_init(¶m[next_param_index].value, G_TYPE_STRING); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1786 | g_value_set_string(¶m[next_param_index].value, stun_ip); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1787 | next_param_index++; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1788 | } |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1789 | |
|
26425
e052e2118184
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Michael Ruprecht <maiku@pidgin.im>
parents:
26417
diff
changeset
|
1790 | if (turn_ip && is_nice) { |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1791 | GValueArray *relay_info = g_value_array_new(0); |
|
26263
725845e88ebf
Removed a couple of warnings
Marcus Lundblad <malu@pidgin.im>
parents:
26262
diff
changeset
|
1792 | GValue value; |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1793 | gint turn_port = |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1794 | purple_prefs_get_int("/purple/network/turn_port"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1795 | const gchar *username = |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1796 | purple_prefs_get_string("/purple/network/turn_username"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1797 | const gchar *password = |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1798 | purple_prefs_get_string("/purple/network/turn_password"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1799 | GstStructure *turn_setup = gst_structure_new("relay-info", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1800 | "ip", G_TYPE_STRING, turn_ip, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1801 | "port", G_TYPE_UINT, turn_port, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1802 | "username", G_TYPE_STRING, username, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1803 | "password", G_TYPE_STRING, password, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1804 | NULL); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1805 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1806 | if (turn_setup) { |
|
26263
725845e88ebf
Removed a couple of warnings
Marcus Lundblad <malu@pidgin.im>
parents:
26262
diff
changeset
|
1807 | memset(&value, 0, sizeof(GValue)); |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1808 | g_value_init(&value, GST_TYPE_STRUCTURE); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1809 | gst_value_set_structure(&value, turn_setup); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1810 | relay_info = g_value_array_append(relay_info, &value); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1811 | gst_structure_free(turn_setup); |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1812 | |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1813 | purple_debug_info("media", |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1814 | "setting property relay-info on new stream\n"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1815 | param[next_param_index].name = "relay-info"; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1816 | g_value_init(¶m[next_param_index].value, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1817 | G_TYPE_VALUE_ARRAY); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1818 | g_value_set_boxed(¶m[next_param_index].value, |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1819 | relay_info); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1820 | g_value_array_free(relay_info); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1821 | } else { |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1822 | purple_debug_error("media", "Error relay info"); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1823 | g_object_unref(participant); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1824 | g_hash_table_remove(media->priv->participants, who); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1825 | purple_media_remove_session(media, session); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1826 | g_free(session); |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1827 | return FALSE; |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1828 | } |
|
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1829 | } |
|
26262
1ad96aa2e92a
Removed some extra tabs on blank lines
Marcus Lundblad <malu@pidgin.im>
parents:
26261
diff
changeset
|
1830 | |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1831 | fsstream = fs_session_new_stream(session->session, |
|
26257
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1832 | participant, type_direction & |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1833 | FS_DIRECTION_RECV, transmitter, |
|
26261
ffabb135a4b6
Added support to generate relayed candidates (TURN).
Marcus Lundblad <malu@pidgin.im>
parents:
26259
diff
changeset
|
1834 | new_num_params, param, &err); |
|
26133
a12ffee5bd73
Add params to purple_media_add_stream to allow for different libNice
Michael Ruprecht <maiku@pidgin.im>
parents:
26132
diff
changeset
|
1835 | g_free(param); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1836 | } else { |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1837 | fsstream = fs_session_new_stream(session->session, |
|
26257
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1838 | participant, type_direction & |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1839 | FS_DIRECTION_RECV, transmitter, |
|
e4a840dab1d4
Use the stream's direction to wait to send media.
Michael Ruprecht <maiku@pidgin.im>
parents:
26256
diff
changeset
|
1840 | num_params, params, &err); |
|
26097
0d34ffa7c5a9
Use the purple STUN server preference with the rawudp Farsight transmitter.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
1841 | } |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1842 | |
|
28329
0300f09b9cd6
Gracefully handle failures to create an FsStream. This was caused by
Michael Ruprecht <maiku@pidgin.im>
parents:
28162
diff
changeset
|
1843 | if (fsstream == NULL) { |
|
0300f09b9cd6
Gracefully handle failures to create an FsStream. This was caused by
Michael Ruprecht <maiku@pidgin.im>
parents:
28162
diff
changeset
|
1844 | purple_debug_error("media", |
|
0300f09b9cd6
Gracefully handle failures to create an FsStream. This was caused by
Michael Ruprecht <maiku@pidgin.im>
parents:
28162
diff
changeset
|
1845 | "Error creating stream: %s\n", |
|
0300f09b9cd6
Gracefully handle failures to create an FsStream. This was caused by
Michael Ruprecht <maiku@pidgin.im>
parents:
28162
diff
changeset
|
1846 | err && err->message ? |
|
0300f09b9cd6
Gracefully handle failures to create an FsStream. This was caused by
Michael Ruprecht <maiku@pidgin.im>
parents:
28162
diff
changeset
|
1847 | err->message : "NULL"); |
|
0300f09b9cd6
Gracefully handle failures to create an FsStream. This was caused by
Michael Ruprecht <maiku@pidgin.im>
parents:
28162
diff
changeset
|
1848 | if (err) |
|
0300f09b9cd6
Gracefully handle failures to create an FsStream. This was caused by
Michael Ruprecht <maiku@pidgin.im>
parents:
28162
diff
changeset
|
1849 | g_error_free(err); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1850 | g_object_unref(participant); |
|
26129
18c8f2cfb52b
Properly free PurpleMedia when there's an error creating an FsStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26125
diff
changeset
|
1851 | g_hash_table_remove(media->priv->participants, who); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1852 | purple_media_remove_session(media, session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1853 | g_free(session); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1854 | return FALSE; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1855 | } |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1856 | |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1857 | stream = purple_media_insert_stream(session, who, fsstream); |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
1858 | stream->initiator = initiator; |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1859 | |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1860 | /* callback for source pad added (new stream source ready) */ |
|
26163
df72970bffc6
Move variables to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26162
diff
changeset
|
1861 | g_signal_connect(G_OBJECT(fsstream), |
|
26176
05f45eb5a8ed
Move sink from PurpleMediaSession to PurpleMediaStream.
Michael Ruprecht <maiku@pidgin.im>
parents:
26174
diff
changeset
|
1862 | "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
|
1863 | |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1864 | 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
|
1865 | 0, PURPLE_MEDIA_STATE_NEW, |
|
26193
101122f0f3dd
Add state-changed signal to PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26191
diff
changeset
|
1866 | session->id, who); |
|
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
|
1867 | } else { |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1868 | if (purple_media_to_fs_stream_direction(stream->session->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
|
1869 | != 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
|
1870 | /* change 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
|
1871 | g_object_set(stream->stream, "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
|
1872 | type_direction, NULL); |
|
271f62b3c57a
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1873 | } |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1874 | } |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1875 | |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23699
diff
changeset
|
1876 | 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
|
1877 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1878 | 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
|
1879 | #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
|
1880 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1881 | |
|
26523
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1882 | PurpleMediaManager * |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1883 | purple_media_get_manager(PurpleMedia *media) |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1884 | { |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1885 | PurpleMediaManager *ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1886 | 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
|
1887 | g_object_get(media, "manager", &ret, NULL); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1888 | return ret; |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1889 | } |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
1890 | |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26105
diff
changeset
|
1891 | 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
|
1892 | 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
|
1893 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1894 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1895 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1896 | 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
|
1897 | 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
|
1898 | 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
|
1899 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1900 | 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
|
1901 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1902 | } |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1903 | /* 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
|
1904 | GList * |
|
26160
46bc5e18d59c
Combine get_*_codecs functions to mirror Farsight 2.
Michael Ruprecht <maiku@pidgin.im>
parents:
26151
diff
changeset
|
1905 | 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
|
1906 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1907 | #ifdef USE_VV |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1908 | GList *fscodecs; |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1909 | GList *codecs; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1910 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1911 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1912 | 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
|
1913 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1914 | 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
|
1915 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1916 | if (session == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1917 | return NULL; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1918 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1919 | g_object_get(G_OBJECT(session->session), |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1920 | "codecs", &fscodecs, NULL); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1921 | codecs = purple_media_codec_list_from_fs(fscodecs); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
1922 | fs_codec_list_destroy(fscodecs); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1923 | return 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
|
1924 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1925 | 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
|
1926 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1927 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1928 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1929 | GList * |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1930 | 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
|
1931 | 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
|
1932 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1933 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1934 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1935 | 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
|
1936 | stream = purple_media_get_stream(media, sess_id, participant); |
|
27202
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1937 | return stream ? purple_media_candidate_list_from_fs( |
|
5244a5510e0e
Add Gmail video support.
Michael Ruprecht <maiku@pidgin.im>
parents:
26960
diff
changeset
|
1938 | stream->local_candidates) : 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
|
1939 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1940 | 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
|
1941 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1942 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1943 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1944 | 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
|
1945 | 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
|
1946 | const gchar *participant, |
|
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
1947 | 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
|
1948 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1949 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1950 | PurpleMediaStream *stream; |
|
26258
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1951 | GError *err = NULL; |
|
9cfc01913beb
Set remote candidates as soon as they are received.
Michael Ruprecht <maiku@pidgin.im>
parents:
26257
diff
changeset
|
1952 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1953 | 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
|
1954 | 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
|
1955 | |
|
26519
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1956 | 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
|
1957 | 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
|
1958 | "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
|
1959 | "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
|
1960 | 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
|
1961 | 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
|
1962 | return; |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1963 | } |
|
9e62279d1be2
Make Finch not crash if someone requests a session with video with you.
Michael Ruprecht <maiku@pidgin.im>
parents:
26518
diff
changeset
|
1964 | |
|
26200
6636bcf92be3
Add candidates instead of replacing them.
Michael Ruprecht <maiku@pidgin.im>
parents:
26195
diff
changeset
|
1965 | stream->remote_candidates = g_list_concat(stream->remote_candidates, |
|
26229
3e786c9ebb62
Duplicate FsCandidate to remove it from the public interface.
Michael Ruprecht <maiku@pidgin.im>
parents:
26228
diff
changeset
|
1966 | purple_media_candidate_list_to_fs(remote_candidates)); |
|
26121
8b548a0ea68e
Update to Farsight2 0.0.3.
Michael Ruprecht <maiku@pidgin.im>
parents:
26120
diff
changeset
|
1967 | |
|
28419
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1968 | if (stream->accepted == TRUE) { |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1969 | fs_stream_set_remote_candidates(stream->stream, |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1970 | stream->remote_candidates, &err); |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1971 | |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1972 | if (err) { |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1973 | purple_debug_error("media", "Error adding remote" |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1974 | " candidates: %s\n", err->message); |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1975 | g_error_free(err); |
|
a01312dcd815
Wait to set remote candidates until the session has been accepted. This stops
Michael Ruprecht <maiku@pidgin.im>
parents:
28399
diff
changeset
|
1976 | } |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
1977 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1978 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1979 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
1980 | |
|
26516
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1981 | #if 0 |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1982 | /* |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1983 | * 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
|
1984 | * 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
|
1985 | */ |
|
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
1986 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1987 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1988 | 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
|
1989 | 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
|
1990 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1991 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1992 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
1993 | 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
|
1994 | stream = purple_media_get_stream(media, sess_id, participant); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1995 | return purple_media_candidate_list_from_fs( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
1996 | 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
|
1997 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
1998 | 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
|
1999 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
2000 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
2001 | |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
2002 | GList * |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
2003 | 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
|
2004 | 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
|
2005 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2006 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2007 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2008 | 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
|
2009 | stream = purple_media_get_stream(media, sess_id, participant); |
|
26304
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
2010 | return purple_media_candidate_list_from_fs( |
|
6e19bf6af065
Handle having multiple active candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26297
diff
changeset
|
2011 | 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
|
2012 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2013 | 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
|
2014 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
2015 | } |
|
26516
ba01d3212cac
Comment out purple_media_get_active_{local,remote}_candidates.
Michael Ruprecht <maiku@pidgin.im>
parents:
26515
diff
changeset
|
2016 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
2017 | |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2018 | gboolean |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
2019 | 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
|
2020 | 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
|
2021 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2022 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2023 | PurpleMediaStream *stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2024 | FsStream *fsstream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2025 | GList *fscodecs; |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2026 | GError *err = NULL; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2027 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2028 | g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
2029 | 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
|
2030 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2031 | if (stream == NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2032 | return FALSE; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2033 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2034 | fsstream = stream->stream; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2035 | fscodecs = purple_media_codec_list_to_fs(codecs); |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2036 | fs_stream_set_remote_codecs(fsstream, fscodecs, &err); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
2037 | fs_codec_list_destroy(fscodecs); |
|
23745
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2038 | |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2039 | if (err) { |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2040 | purple_debug_error("media", "Error setting remote codecs: %s\n", |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2041 | err->message); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2042 | g_error_free(err); |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2043 | return FALSE; |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2044 | } |
|
091a506a7018
Added better Farsight error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
23744
diff
changeset
|
2045 | 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
|
2046 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2047 | 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
|
2048 | #endif |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
2049 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
2050 | |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
2051 | gboolean |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2052 | purple_media_candidates_prepared(PurpleMedia *media, |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2053 | 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
|
2054 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2055 | #ifdef USE_VV |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2056 | GList *streams; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2057 | gboolean prepared = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2058 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2059 | 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
|
2060 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2061 | 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
|
2062 | |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2063 | 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
|
2064 | PurpleMediaStream *stream = streams->data; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2065 | if (stream->candidates_prepared == FALSE) { |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2066 | g_list_free(streams); |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2067 | prepared = FALSE; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2068 | break; |
|
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2069 | } |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
2070 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
2071 | |
|
26430
439ade36af30
Change purple_media_candidates_prepared to use wildcards.
Michael Ruprecht <maiku@pidgin.im>
parents:
26429
diff
changeset
|
2072 | 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
|
2073 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2074 | 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
|
2075 | #endif |
|
23730
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
2076 | } |
|
ed15b42da75c
Jingle sessions now keep track of their transaction state to a degree.
Michael Ruprecht <maiku@pidgin.im>
parents:
23726
diff
changeset
|
2077 | |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2078 | gboolean |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
2079 | 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
|
2080 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2081 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2082 | PurpleMediaSession *session; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2083 | FsCodec *fscodec; |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2084 | GError *err = NULL; |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2085 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2086 | 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
|
2087 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2088 | 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
|
2089 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2090 | if (session != NULL) |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2091 | return FALSE; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2092 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2093 | fscodec = purple_media_codec_to_fs(codec); |
|
26232
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
2094 | fs_session_set_send_codec(session->session, fscodec, &err); |
|
f91c96072586
Wrap FsCodec and remove the Farsight2 include from media.h.
Michael Ruprecht <maiku@pidgin.im>
parents:
26231
diff
changeset
|
2095 | fs_codec_destroy(fscodec); |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2096 | |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2097 | if (err) { |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2098 | purple_debug_error("media", "Error setting send codec\n"); |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2099 | g_error_free(err); |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2100 | return FALSE; |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2101 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2102 | 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
|
2103 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2104 | 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
|
2105 | #endif |
|
26102
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2106 | } |
|
881a436d77eb
Set the proper send codec in Farsight.
Michael Ruprecht <maiku@pidgin.im>
parents:
26097
diff
changeset
|
2107 | |
|
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
|
2108 | 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
|
2109 | 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
|
2110 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2111 | #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
|
2112 | gboolean ret; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2113 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2114 | 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
|
2115 | |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2116 | if (sess_id != NULL) { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2117 | PurpleMediaSession *session; |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2118 | 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
|
2119 | |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2120 | if (session == NULL) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2121 | 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
|
2122 | 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
|
2123 | 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
|
2124 | 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
|
2125 | "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
|
2126 | else |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
2127 | ret = TRUE; |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2128 | } else { |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2129 | 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
|
2130 | 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
|
2131 | 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
|
2132 | 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
|
2133 | 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
|
2134 | 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
|
2135 | "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
|
2136 | else |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
2137 | ret = TRUE; |
|
4368c139d67f
Fix unidirectional media sessions and add a colorspace before the video sink.
Michael Ruprecht <maiku@pidgin.im>
parents:
28140
diff
changeset
|
2138 | |
|
26333
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2139 | if (ret == FALSE) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2140 | break; |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2141 | } |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2142 | if (values != NULL) |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2143 | g_list_free(values); |
|
2b88f86521fb
Have purple_media_codecs_ready handle a session wildcard.
Michael Ruprecht <maiku@pidgin.im>
parents:
26332
diff
changeset
|
2144 | } |
|
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
|
2145 | 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
|
2146 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2147 | 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
|
2148 | #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
|
2149 | } |
|
0688cf5221c9
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26135
diff
changeset
|
2150 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2151 | gboolean |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2152 | purple_media_is_initiator(PurpleMedia *media, |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2153 | const gchar *sess_id, const gchar *participant) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2154 | { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2155 | #ifdef USE_VV |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2156 | 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
|
2157 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2158 | if (sess_id == NULL && participant == NULL) |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2159 | return media->priv->initiator; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2160 | else if (sess_id != NULL && participant == NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2161 | PurpleMediaSession *session = |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2162 | purple_media_get_session(media, sess_id); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2163 | return session != NULL ? session->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2164 | } else if (sess_id != NULL && participant != NULL) { |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2165 | PurpleMediaStream *stream = purple_media_get_stream( |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2166 | media, sess_id, participant); |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2167 | return stream != NULL ? stream->initiator : FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2168 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2169 | #endif |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2170 | return FALSE; |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2171 | } |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2172 | |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26513
diff
changeset
|
2173 | gboolean |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2174 | 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
|
2175 | 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
|
2176 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2177 | #ifdef USE_VV |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2178 | gboolean accepted = TRUE; |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2179 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2180 | 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
|
2181 | |
|
26429
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2182 | 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
|
2183 | GList *streams = media->priv->streams; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2184 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2185 | 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
|
2186 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2187 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2188 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2189 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2190 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2191 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2192 | } 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
|
2193 | 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
|
2194 | media, sess_id, NULL); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2195 | for (; streams; streams = |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2196 | 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
|
2197 | PurpleMediaStream *stream = streams->data; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2198 | if (stream->accepted == FALSE) { |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2199 | g_list_free(streams); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2200 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2201 | break; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2202 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2203 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2204 | } 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
|
2205 | 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
|
2206 | media, sess_id, participant); |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2207 | 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
|
2208 | accepted = FALSE; |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2209 | } |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2210 | |
|
6b47e1733f20
Make acceptance be per stream rather than per session.
Michael Ruprecht <maiku@pidgin.im>
parents:
26426
diff
changeset
|
2211 | 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
|
2212 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2213 | 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
|
2214 | #endif |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2215 | } |
|
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26266
diff
changeset
|
2216 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2217 | 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
|
2218 | 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
|
2219 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2220 | #ifdef USE_VV |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2221 | GList *sessions; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2222 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2223 | 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
|
2224 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
2225 | 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
|
2226 | |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2227 | if (session_id == NULL) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2228 | 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
|
2229 | else |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2230 | sessions = g_list_append(NULL, |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2231 | 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
|
2232 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2233 | 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
|
2234 | PurpleMediaSession *session = sessions->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2235 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2236 | 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
|
2237 | 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
|
2238 | session->id); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2239 | 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
|
2240 | 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
|
2241 | name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
2242 | g_free(name); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
2243 | 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
|
2244 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2245 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2246 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2247 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2248 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2249 | 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
|
2250 | 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
|
2251 | double level) |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2252 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2253 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2254 | GList *streams; |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2255 | |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2256 | 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
|
2257 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
2258 | 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
|
2259 | |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2260 | streams = purple_media_get_streams(media, |
|
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2261 | session_id, participant); |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2262 | |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2263 | 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
|
2264 | PurpleMediaStream *stream = streams->data; |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2265 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
2266 | 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
|
2267 | && GST_IS_ELEMENT(stream->volume)) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
2268 | 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
|
2269 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2270 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2271 | #endif |
|
26172
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2272 | } |
|
b14249e42983
Added media functions to set input and output volume.
Michael Ruprecht <maiku@pidgin.im>
parents:
26168
diff
changeset
|
2273 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2274 | gulong |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26258
diff
changeset
|
2275 | 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
|
2276 | 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
|
2277 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2278 | #ifdef USE_VV |
|
26278
385a3da0c2fe
Added a lot of assertions and error handling.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
2279 | 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
|
2280 | |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2281 | 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
|
2282 | 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
|
2283 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2284 | 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
|
2285 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2286 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2287 | |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2288 | void |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2289 | 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
|
2290 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2291 | #ifdef USE_VV |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2292 | GList *iter = media->priv->streams; |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2293 | 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
|
2294 | 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
|
2295 | 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
|
2296 | media->priv->manager, media, |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2297 | stream->session->id, stream->participant); |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2298 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2299 | |
|
26956
bcea44c3efa1
Distinguish name and participant in PurpleMedia API
Paul Aurich <darkrain42@pidgin.im>
parents:
26792
diff
changeset
|
2300 | 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
|
2301 | 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
|
2302 | 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
|
2303 | 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
|
2304 | 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
|
2305 | session_name, NULL); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2306 | } |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2307 | #endif |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2308 | } |
|
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26280
diff
changeset
|
2309 | |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
2310 | #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
|
2311 | GstElement * |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2312 | 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
|
2313 | 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
|
2314 | { |
|
26480
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2315 | #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
|
2316 | 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
|
2317 | |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2318 | 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
|
2319 | PurpleMediaSession *session = |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2320 | 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
|
2321 | 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
|
2322 | } 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
|
2323 | PurpleMediaStream *stream = |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2324 | 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
|
2325 | session_id, participant); |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2326 | 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
|
2327 | } |
|
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2328 | 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
|
2329 | #else |
|
5c4ab4baeb32
Properly wrap media functions so the API doesn't disappear when USE_VV
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
2330 | 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
|
2331 | #endif |
|
26323
cf93de98325c
Only create output windows once there's data to be output.
Michael Ruprecht <maiku@pidgin.im>
parents:
26321
diff
changeset
|
2332 | } |
|
26760
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
2333 | #endif /* USE_GSTREAMER */ |
|
251146cb6d09
Fix build with --disable-gstreamer.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26746
diff
changeset
|
2334 |