Mercurial > pidgin
annotate libpurple/media.c @ 26404:217574ec2a34
Hide and gobjectify PurpleMediaCodec.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Thu, 02 Apr 2009 04:06:07 +0000 |
parents | f0de2405c2f1 |
children | 2d332d327a0e |
rev | line source |
---|---|
23760 | 1 /** |
23766 | 2 * @file media.c Media API |
23760 | 3 * @ingroup core |
23865
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23863
diff
changeset
|
4 */ |
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23863
diff
changeset
|
5 |
b8a73b6dc0a4
* Added documentation to media.h and mediamanager.h
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23863
diff
changeset
|
6 /* purple |
23760 | 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 | |
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
25 */ | |
26 | |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
27 #include <string.h> |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
28 |
23766 | 29 #include "internal.h" |
30 | |
23760 | 31 #include "connection.h" |
26349
1ae3af12095a
Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26348
diff
changeset
|
32 #include "marshallers.h" |
23760 | 33 #include "media.h" |
26349
1ae3af12095a
Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26348
diff
changeset
|
34 #include "media-gst.h" |
23876
f10e0ac24595
* Added input/output volume preferences for voice conversations.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23873
diff
changeset
|
35 #include "mediamanager.h" |
26050
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26047
diff
changeset
|
36 #include "network.h" |
23760 | 37 |
23787
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23772
diff
changeset
|
38 #include "debug.h" |
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23772
diff
changeset
|
39 |
23804
cbe97caec684
Use USE_VV instead of USE_FARSIGHT.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23801
diff
changeset
|
40 #ifdef USE_VV |
23760 | 41 |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
42 #include <gst/farsight/fs-conference-iface.h> |
23760 | 43 |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
44 /** @copydoc _PurpleMediaSession */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
45 typedef struct _PurpleMediaSession PurpleMediaSession; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
46 /** @copydoc _PurpleMediaStream */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
47 typedef struct _PurpleMediaStream PurpleMediaStream; |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
48 /** @copydoc _PurpleMediaCodecClass */ |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
49 typedef struct _PurpleMediaCodecClass PurpleMediaCodecClass; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
50 /** @copydoc _PurpleMediaCodecPrivate */ |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
51 typedef struct _PurpleMediaCodecPrivate PurpleMediaCodecPrivate; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
52 |
26399
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
53 /** The media class */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
54 struct _PurpleMediaClass |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
55 { |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
56 GObjectClass parent_class; /**< The parent class. */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
57 }; |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
58 |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
59 /** The media class's private data */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
60 struct _PurpleMedia |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
61 { |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
62 GObject parent; /**< The parent of this object. */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
63 PurpleMediaPrivate *priv; /**< The private data of this object. */ |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
64 }; |
341864c1d1f9
Hide the easy structs in media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26393
diff
changeset
|
65 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
66 struct _PurpleMediaSession |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
67 { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
68 gchar *id; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
69 PurpleMedia *media; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
70 GstElement *src; |
26115
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26114
diff
changeset
|
71 GstElement *tee; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
72 FsSession *session; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
73 |
23869
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23865
diff
changeset
|
74 PurpleMediaSessionType type; |
26384
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
75 gboolean initiator; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
76 }; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
77 |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
78 struct _PurpleMediaStream |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
79 { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
80 PurpleMediaSession *session; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
81 gchar *participant; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
82 FsStream *stream; |
26109
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
83 GstElement *src; |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
84 GstElement *tee; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
85 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
86 GList *local_candidates; |
25000
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24995
diff
changeset
|
87 GList *remote_candidates; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
88 |
26384
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
89 gboolean initiator; |
26309
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
90 gboolean accepted; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
91 gboolean candidates_prepared; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
92 |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
93 GList *active_local_candidates; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
94 GList *active_remote_candidates; |
26053
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26052
diff
changeset
|
95 |
26118
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26117
diff
changeset
|
96 guint connected_cb_id; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
97 }; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
98 #endif |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
99 |
23760 | 100 struct _PurpleMediaPrivate |
101 { | |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
102 #ifdef USE_VV |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
103 PurpleMediaManager *manager; |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
104 PurpleConnection *pc; |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
105 FsConference *conference; |
24987
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
106 gboolean initiator; |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
107 gpointer prpl_data; |
23760 | 108 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
109 GHashTable *sessions; /* PurpleMediaSession table */ |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
110 GHashTable *participants; /* FsParticipant table */ |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
111 |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
112 GList *streams; /* PurpleMediaStream table */ |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
113 |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
114 GstElement *confbin; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
115 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
116 gpointer dummy; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
117 #endif |
23760 | 118 }; |
119 | |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
120 #ifdef USE_VV |
23760 | 121 #define PURPLE_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA, PurpleMediaPrivate)) |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
122 #define PURPLE_MEDIA_CODEC_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodecPrivate)) |
23760 | 123 |
124 static void purple_media_class_init (PurpleMediaClass *klass); | |
125 static void purple_media_init (PurpleMedia *media); | |
26005
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
126 static void purple_media_dispose (GObject *object); |
23760 | 127 static void purple_media_finalize (GObject *object); |
128 static void purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
129 static void purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
130 | |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
131 static void purple_media_new_local_candidate_cb(FsStream *stream, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
132 FsCandidate *local_candidate, PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
133 static void purple_media_candidates_prepared_cb(FsStream *stream, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
134 PurpleMediaSession *session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
135 static void purple_media_candidate_pair_established_cb(FsStream *stream, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
136 FsCandidate *native_candidate, FsCandidate *remote_candidate, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
137 PurpleMediaSession *session); |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
138 static gboolean media_bus_call(GstBus *bus, |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
139 GstMessage *msg, PurpleMedia *media); |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
140 |
23760 | 141 static GObjectClass *parent_class = NULL; |
142 | |
143 | |
144 | |
145 enum { | |
24982
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
146 ERROR, |
26060
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26059
diff
changeset
|
147 ACCEPTED, |
26298
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
148 CANDIDATES_PREPARED, |
26059
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26058
diff
changeset
|
149 CODECS_CHANGED, |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
150 NEW_CANDIDATE, |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
151 STATE_CHANGED, |
26320
8b4394e84633
Add stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26319
diff
changeset
|
152 STREAM_INFO, |
23760 | 153 LAST_SIGNAL |
154 }; | |
155 static guint purple_media_signals[LAST_SIGNAL] = {0}; | |
156 | |
157 enum { | |
158 PROP_0, | |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
159 PROP_MANAGER, |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
160 PROP_CONNECTION, |
24985
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24984
diff
changeset
|
161 PROP_CONFERENCE, |
24987
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
162 PROP_INITIATOR, |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
163 PROP_PRPL_DATA, |
23760 | 164 }; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
165 #endif |
23760 | 166 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
167 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
168 /* |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
169 * PurpleMediaElementType |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
170 */ |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
171 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
172 GType |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
173 purple_media_session_type_get_type() |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
174 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
175 static GType type = 0; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
176 if (type == 0) { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
177 static const GFlagsValue values[] = { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
178 { PURPLE_MEDIA_NONE, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
179 "PURPLE_MEDIA_NONE", "none" }, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
180 { PURPLE_MEDIA_RECV_AUDIO, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
181 "PURPLE_MEDIA_RECV_AUDIO", "recv-audio" }, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
182 { PURPLE_MEDIA_SEND_AUDIO, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
183 "PURPLE_MEDIA_SEND_AUDIO", "send-audio" }, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
184 { PURPLE_MEDIA_RECV_VIDEO, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
185 "PURPLE_MEDIA_RECV_VIDEO", "recv-video" }, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
186 { PURPLE_MEDIA_SEND_VIDEO, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
187 "PURPLE_MEDIA_SEND_VIDEO", "send-audio" }, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
188 { PURPLE_MEDIA_AUDIO, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
189 "PURPLE_MEDIA_AUDIO", "audio" }, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
190 { PURPLE_MEDIA_VIDEO, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
191 "PURPLE_MEDIA_VIDEO", "video" }, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
192 { 0, NULL, NULL } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
193 }; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
194 type = g_flags_register_static( |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
195 "PurpleMediaSessionType", values); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
196 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
197 return type; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
198 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
199 |
23760 | 200 GType |
201 purple_media_get_type() | |
202 { | |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
203 #ifdef USE_VV |
23760 | 204 static GType type = 0; |
205 | |
206 if (type == 0) { | |
207 static const GTypeInfo info = { | |
208 sizeof(PurpleMediaClass), | |
209 NULL, | |
210 NULL, | |
211 (GClassInitFunc) purple_media_class_init, | |
212 NULL, | |
213 NULL, | |
214 sizeof(PurpleMedia), | |
215 0, | |
23772
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23766
diff
changeset
|
216 (GInstanceInitFunc) purple_media_init, |
750d700098c1
Fix the prplinfo structs and get rid of some compile warnings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23766
diff
changeset
|
217 NULL |
23760 | 218 }; |
219 type = g_type_register_static(G_TYPE_OBJECT, "PurpleMedia", &info, 0); | |
220 } | |
221 return type; | |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
222 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
223 return G_TYPE_NONE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
224 #endif |
23760 | 225 } |
226 | |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
227 GType |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
228 purple_media_state_changed_get_type() |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
229 { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
230 static GType type = 0; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
231 if (type == 0) { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
232 static const GEnumValue values[] = { |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
233 { PURPLE_MEDIA_STATE_NEW, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
234 "PURPLE_MEDIA_STATE_NEW", "new" }, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
235 { PURPLE_MEDIA_STATE_CONNECTED, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
236 "PURPLE_MEDIA_STATE_CONNECTED", "connected" }, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
237 { PURPLE_MEDIA_STATE_END, |
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
238 "PURPLE_MEDIA_STATE_END", "end" }, |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
239 { 0, NULL, NULL } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
240 }; |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
241 type = g_enum_register_static("PurpleMediaState", values); |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
242 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
243 return type; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
244 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
245 |
26327
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
246 GType |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
247 purple_media_info_type_get_type() |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
248 { |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
249 static GType type = 0; |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
250 if (type == 0) { |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
251 static const GEnumValue values[] = { |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
252 { PURPLE_MEDIA_INFO_HANGUP, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
253 "PURPLE_MEDIA_INFO_HANGUP", "hangup" }, |
26367
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26366
diff
changeset
|
254 { PURPLE_MEDIA_INFO_ACCEPT, |
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26366
diff
changeset
|
255 "PURPLE_MEDIA_INFO_ACCEPT", "accept" }, |
26327
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
256 { PURPLE_MEDIA_INFO_REJECT, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
257 "PURPLE_MEDIA_INFO_REJECT", "reject" }, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
258 { PURPLE_MEDIA_INFO_MUTE, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
259 "PURPLE_MEDIA_INFO_MUTE", "mute" }, |
26367
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26366
diff
changeset
|
260 { PURPLE_MEDIA_INFO_UNMUTE, |
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26366
diff
changeset
|
261 "PURPLE_MEDIA_INFO_UNMUTE", "unmute" }, |
26327
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
262 { PURPLE_MEDIA_INFO_HOLD, |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
263 "PURPLE_MEDIA_INFO_HOLD", "hold" }, |
26367
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26366
diff
changeset
|
264 { PURPLE_MEDIA_INFO_UNHOLD, |
6943d2a41c6e
Add some more PurpleMediaInfo values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26366
diff
changeset
|
265 "PURPLE_MEDIA_INFO_HOLD", "unhold" }, |
26327
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
266 { 0, NULL, NULL } |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
267 }; |
db9d2a760329
Use the right enum for the stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26326
diff
changeset
|
268 type = g_enum_register_static("PurpleMediaInfoType", values); |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
269 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
270 return type; |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
271 } |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
272 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
273 #ifdef USE_VV |
23760 | 274 static void |
275 purple_media_class_init (PurpleMediaClass *klass) | |
276 { | |
277 GObjectClass *gobject_class = (GObjectClass*)klass; | |
278 parent_class = g_type_class_peek_parent(klass); | |
279 | |
26005
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
280 gobject_class->dispose = purple_media_dispose; |
23760 | 281 gobject_class->finalize = purple_media_finalize; |
282 gobject_class->set_property = purple_media_set_property; | |
283 gobject_class->get_property = purple_media_get_property; | |
284 | |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
285 g_object_class_install_property(gobject_class, PROP_MANAGER, |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
286 g_param_spec_object("manager", |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
287 "Purple Media Manager", |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
288 "The media manager that contains this media session.", |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
289 PURPLE_TYPE_MEDIA_MANAGER, |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
290 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
291 |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
292 g_object_class_install_property(gobject_class, PROP_CONNECTION, |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
293 g_param_spec_pointer("connection", |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
294 "PurpleConnection", |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
295 "The connection this media session is on.", |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
296 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
297 |
24985
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24984
diff
changeset
|
298 g_object_class_install_property(gobject_class, PROP_CONFERENCE, |
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24984
diff
changeset
|
299 g_param_spec_object("conference", |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
300 "Farsight conference", |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
301 "The FsConference associated with this media.", |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
302 FS_TYPE_CONFERENCE, |
26388
de03cce95e17
Make the conference property write only.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26387
diff
changeset
|
303 G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE)); |
23760 | 304 |
24987
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
305 g_object_class_install_property(gobject_class, PROP_INITIATOR, |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
306 g_param_spec_boolean("initiator", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
307 "initiator", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
308 "If the local user initiated the conference.", |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
309 FALSE, |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
310 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
311 |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
312 g_object_class_install_property(gobject_class, PROP_PRPL_DATA, |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
313 g_param_spec_pointer("prpl-data", |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
314 "gpointer", |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
315 "Data the prpl plugin set on the media session.", |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
316 G_PARAM_READWRITE)); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
317 |
24982
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
318 purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
319 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
320 g_cclosure_marshal_VOID__STRING, |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
321 G_TYPE_NONE, 1, G_TYPE_STRING); |
26060
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26059
diff
changeset
|
322 purple_media_signals[ACCEPTED] = g_signal_new("accepted", G_TYPE_FROM_CLASS(klass), |
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26059
diff
changeset
|
323 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26059
diff
changeset
|
324 purple_smarshal_VOID__STRING_STRING, |
5b64b7d8da39
Added the accepted signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26059
diff
changeset
|
325 G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); |
26298
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
326 purple_media_signals[CANDIDATES_PREPARED] = g_signal_new("candidates-prepared", G_TYPE_FROM_CLASS(klass), |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
327 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
328 purple_smarshal_VOID__STRING_STRING, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
329 G_TYPE_NONE, 2, G_TYPE_STRING, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
330 G_TYPE_STRING); |
26059
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26058
diff
changeset
|
331 purple_media_signals[CODECS_CHANGED] = g_signal_new("codecs-changed", G_TYPE_FROM_CLASS(klass), |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26058
diff
changeset
|
332 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26058
diff
changeset
|
333 g_cclosure_marshal_VOID__STRING, |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26058
diff
changeset
|
334 G_TYPE_NONE, 1, G_TYPE_STRING); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
335 purple_media_signals[NEW_CANDIDATE] = g_signal_new("new-candidate", G_TYPE_FROM_CLASS(klass), |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
336 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
337 purple_smarshal_VOID__POINTER_POINTER_OBJECT, |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
338 G_TYPE_NONE, 3, G_TYPE_POINTER, |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
339 G_TYPE_POINTER, PURPLE_TYPE_MEDIA_CANDIDATE); |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
340 purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass), |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
341 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
342 purple_smarshal_VOID__ENUM_STRING_STRING, |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
343 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE, |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
344 G_TYPE_STRING, G_TYPE_STRING); |
26320
8b4394e84633
Add stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26319
diff
changeset
|
345 purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass), |
8b4394e84633
Add stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26319
diff
changeset
|
346 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
26366
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
347 purple_smarshal_VOID__ENUM_STRING_STRING_BOOLEAN, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
348 G_TYPE_NONE, 4, PURPLE_MEDIA_TYPE_INFO_TYPE, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
349 G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN); |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
350 g_type_class_add_private(klass, sizeof(PurpleMediaPrivate)); |
23760 | 351 } |
352 | |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
353 |
23760 | 354 static void |
355 purple_media_init (PurpleMedia *media) | |
356 { | |
357 media->priv = PURPLE_MEDIA_GET_PRIVATE(media); | |
26286
d8a7c7d9ac8a
Zero out the proper size for the PurpleMediaPrivate structure.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26134
diff
changeset
|
358 memset(media->priv, 0, sizeof(*media->priv)); |
23760 | 359 } |
360 | |
361 static void | |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
362 purple_media_stream_free(PurpleMediaStream *stream) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
363 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
364 if (stream == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
365 return; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
366 |
26074
1199abde956b
Set the purple_media_connected_cb timeout to a high priority and remove
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26073
diff
changeset
|
367 /* Remove the connected_cb timeout */ |
26118
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26117
diff
changeset
|
368 if (stream->connected_cb_id != 0) |
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26117
diff
changeset
|
369 purple_timeout_remove(stream->connected_cb_id); |
26074
1199abde956b
Set the purple_media_connected_cb timeout to a high priority and remove
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26073
diff
changeset
|
370 |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
371 g_free(stream->participant); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
372 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
373 if (stream->local_candidates) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
374 fs_candidate_list_destroy(stream->local_candidates); |
25000
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24995
diff
changeset
|
375 if (stream->remote_candidates) |
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24995
diff
changeset
|
376 fs_candidate_list_destroy(stream->remote_candidates); |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
377 |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
378 if (stream->active_local_candidates) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
379 fs_candidate_list_destroy(stream->active_local_candidates); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
380 if (stream->active_remote_candidates) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
381 fs_candidate_list_destroy(stream->active_remote_candidates); |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
382 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
383 g_free(stream); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
384 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
385 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
386 static void |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
387 purple_media_session_free(PurpleMediaSession *session) |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
388 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
389 if (session == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
390 return; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
391 |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
392 g_free(session->id); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
393 g_free(session); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
394 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
395 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
396 static void |
26005
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
397 purple_media_dispose(GObject *media) |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
398 { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
399 PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
400 GList *iter = NULL; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
401 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
402 purple_debug_info("media","purple_media_dispose\n"); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
403 |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
404 purple_media_manager_remove_media(priv->manager, PURPLE_MEDIA(media)); |
26005
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
405 |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
406 if (priv->confbin) { |
26306
5906409c4b69
Fix some GStreamer timing issues.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26305
diff
changeset
|
407 gst_element_set_locked_state(priv->confbin, TRUE); |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
408 gst_element_set_state(GST_ELEMENT(priv->confbin), |
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
409 GST_STATE_NULL); |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
410 gst_bin_remove(GST_BIN(purple_media_manager_get_pipeline( |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
411 priv->manager)), priv->confbin); |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
412 priv->confbin = NULL; |
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
413 priv->conference = NULL; |
26005
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
414 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
415 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
416 for (iter = priv->streams; iter; iter = g_list_next(iter)) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
417 PurpleMediaStream *stream = iter->data; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
418 if (stream->stream) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
419 g_object_unref(stream->stream); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
420 stream->stream = NULL; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
421 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
422 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
423 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
424 if (priv->sessions) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
425 GList *sessions = g_hash_table_get_values(priv->sessions); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
426 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
427 PurpleMediaSession *session = sessions->data; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
428 if (session->session) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
429 g_object_unref(session->session); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
430 session->session = NULL; |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
431 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
432 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
433 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
434 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
435 if (priv->participants) { |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
436 GList *participants = g_hash_table_get_values(priv->participants); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
437 for (; participants; participants = g_list_delete_link(participants, participants)) |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
438 g_object_unref(participants->data); |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
439 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
440 |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
441 if (priv->manager) { |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
442 GstElement *pipeline = purple_media_manager_get_pipeline( |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
443 priv->manager); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
444 GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
445 g_signal_handlers_disconnect_matched(G_OBJECT(bus), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
446 G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
447 0, 0, 0, media_bus_call, media); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
448 gst_object_unref(bus); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
449 |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
450 g_object_unref(priv->manager); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
451 priv->manager = NULL; |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
452 } |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
453 |
26292 | 454 G_OBJECT_CLASS(parent_class)->dispose(media); |
26005
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
455 } |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
456 |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
457 static void |
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
458 purple_media_finalize(GObject *media) |
23760 | 459 { |
23811
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
460 PurpleMediaPrivate *priv = PURPLE_MEDIA_GET_PRIVATE(media); |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
461 purple_debug_info("media","purple_media_finalize\n"); |
d048100a43ab
Free the PurpleMedia object when the media session ends and fix ending
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23804
diff
changeset
|
462 |
24981
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24980
diff
changeset
|
463 for (; priv->streams; priv->streams = g_list_delete_link(priv->streams, priv->streams)) |
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24980
diff
changeset
|
464 purple_media_stream_free(priv->streams->data); |
584a4f5ce4dc
Free Farsight objects better.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24980
diff
changeset
|
465 |
23877
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
466 if (priv->sessions) { |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
467 GList *sessions = g_hash_table_get_values(priv->sessions); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
468 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
469 purple_media_session_free(sessions->data); |
23856
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23852
diff
changeset
|
470 } |
23877
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
471 g_hash_table_destroy(priv->sessions); |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
472 } |
23856
1c68f78414b7
Set the media pipeline to PLAYING immediately after initialization
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23852
diff
changeset
|
473 |
26005
83704757fa36
Use the dispose method too.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26004
diff
changeset
|
474 G_OBJECT_CLASS(parent_class)->finalize(media); |
23760 | 475 } |
476 | |
477 static void | |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
478 purple_media_setup_pipeline(PurpleMedia *media) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
479 { |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
480 GstBus *bus; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
481 gchar *name; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
482 GstElement *pipeline; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
483 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
484 if (media->priv->conference == NULL || media->priv->manager == NULL) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
485 return; |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
486 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
487 pipeline = purple_media_manager_get_pipeline(media->priv->manager); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
488 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
489 name = g_strdup_printf("conf_%p", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
490 media->priv->conference); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
491 media->priv->confbin = gst_bin_new(name); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
492 g_free(name); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
493 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
494 bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
495 g_signal_connect(G_OBJECT(bus), "message", |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
496 G_CALLBACK(media_bus_call), media); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
497 gst_object_unref(bus); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
498 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
499 gst_bin_add(GST_BIN(pipeline), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
500 media->priv->confbin); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
501 gst_bin_add(GST_BIN(media->priv->confbin), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
502 GST_ELEMENT(media->priv->conference)); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
503 gst_element_set_state(GST_ELEMENT(media->priv->confbin), |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
504 GST_STATE_PLAYING); |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
505 } |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
506 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
507 static void |
23760 | 508 purple_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
509 { | |
510 PurpleMedia *media; | |
511 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
23787
92e71f6e10d4
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23772
diff
changeset
|
512 |
23760 | 513 media = PURPLE_MEDIA(object); |
514 | |
515 switch (prop_id) { | |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
516 case PROP_MANAGER: |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
517 media->priv->manager = g_value_get_object(value); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
518 g_object_ref(media->priv->manager); |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
519 |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
520 purple_media_setup_pipeline(media); |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
521 break; |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
522 case PROP_CONNECTION: |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
523 media->priv->pc = g_value_get_pointer(value); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
524 break; |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
525 case PROP_CONFERENCE: { |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
526 if (media->priv->conference) |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
527 gst_object_unref(media->priv->conference); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
528 media->priv->conference = g_value_get_object(value); |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
529 gst_object_ref(media->priv->conference); |
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
530 |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
531 purple_media_setup_pipeline(media); |
23760 | 532 break; |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
533 } |
24987
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
534 case PROP_INITIATOR: |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
535 media->priv->initiator = g_value_get_boolean(value); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
536 break; |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
537 case PROP_PRPL_DATA: |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
538 media->priv->prpl_data = g_value_get_pointer(value); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
539 break; |
23760 | 540 default: |
541 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
542 break; | |
543 } | |
544 } | |
545 | |
546 static void | |
547 purple_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
548 { | |
549 PurpleMedia *media; | |
550 g_return_if_fail(PURPLE_IS_MEDIA(object)); | |
551 | |
552 media = PURPLE_MEDIA(object); | |
553 | |
554 switch (prop_id) { | |
26107
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
555 case PROP_MANAGER: |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
556 g_value_set_object(value, media->priv->manager); |
76104100cb87
Use the media manager that created the media session in media.c.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26103
diff
changeset
|
557 break; |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
558 case PROP_CONNECTION: |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
559 g_value_set_pointer(value, media->priv->pc); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
560 break; |
24985
ee2a2a9dda01
Rename "fs-conference" to "conference".
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24984
diff
changeset
|
561 case PROP_CONFERENCE: |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
562 g_value_set_object(value, media->priv->conference); |
23760 | 563 break; |
24987
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
564 case PROP_INITIATOR: |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
565 g_value_set_boolean(value, media->priv->initiator); |
c7d4b67b3332
Add initiator property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24985
diff
changeset
|
566 break; |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
567 case PROP_PRPL_DATA: |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
568 g_value_set_pointer(value, media->priv->prpl_data); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
569 break; |
23760 | 570 default: |
571 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | |
572 break; | |
573 } | |
574 | |
575 } | |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
576 #endif |
23760 | 577 |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
578 PurpleMediaCandidate * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
579 purple_media_candidate_new(const gchar *foundation, guint component_id, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
580 PurpleMediaCandidateType type, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
581 PurpleMediaNetworkProtocol proto, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
582 const gchar *ip, guint port) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
583 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
584 PurpleMediaCandidate *candidate = g_new0(PurpleMediaCandidate, 1); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
585 candidate->foundation = g_strdup(foundation); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
586 candidate->component_id = component_id; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
587 candidate->type = type; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
588 candidate->proto = proto; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
589 candidate->ip = g_strdup(ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
590 candidate->port = port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
591 return candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
592 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
593 |
26315
c0499eb4dd4d
Disapprove part of the revision that shouldn't be there.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26314
diff
changeset
|
594 static PurpleMediaCandidate * |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
595 purple_media_candidate_copy(PurpleMediaCandidate *candidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
596 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
597 PurpleMediaCandidate *new_candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
598 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
599 if (candidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
600 return NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
601 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
602 new_candidate = g_new0(PurpleMediaCandidate, 1); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
603 new_candidate->foundation = g_strdup(candidate->foundation); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
604 new_candidate->component_id = candidate->component_id; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
605 new_candidate->ip = g_strdup(candidate->ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
606 new_candidate->port = candidate->port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
607 new_candidate->base_ip = g_strdup(candidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
608 new_candidate->base_port = candidate->base_port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
609 new_candidate->proto = candidate->proto; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
610 new_candidate->priority = candidate->priority; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
611 new_candidate->type = candidate->type; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
612 new_candidate->username = g_strdup(candidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
613 new_candidate->password = g_strdup(candidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
614 new_candidate->ttl = candidate->ttl; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
615 return new_candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
616 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
617 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
618 static void |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
619 purple_media_candidate_free(PurpleMediaCandidate *candidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
620 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
621 if (candidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
622 return; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
623 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
624 g_free((gchar*)candidate->foundation); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
625 g_free((gchar*)candidate->ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
626 g_free((gchar*)candidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
627 g_free((gchar*)candidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
628 g_free((gchar*)candidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
629 g_free(candidate); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
630 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
631 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
632 #ifdef USE_VV |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
633 static FsCandidate * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
634 purple_media_candidate_to_fs(PurpleMediaCandidate *candidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
635 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
636 FsCandidate *fscandidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
637 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
638 if (candidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
639 return NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
640 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
641 fscandidate = fs_candidate_new(candidate->foundation, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
642 candidate->component_id, candidate->type, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
643 candidate->proto, candidate->ip, candidate->port); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
644 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
645 fscandidate->base_ip = g_strdup(candidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
646 fscandidate->base_port = candidate->base_port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
647 fscandidate->priority = candidate->priority; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
648 fscandidate->username = g_strdup(candidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
649 fscandidate->password = g_strdup(candidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
650 fscandidate->ttl = candidate->ttl; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
651 return fscandidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
652 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
653 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
654 static PurpleMediaCandidate * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
655 purple_media_candidate_from_fs(FsCandidate *fscandidate) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
656 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
657 PurpleMediaCandidate *candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
658 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
659 if (fscandidate == NULL) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
660 return NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
661 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
662 candidate = purple_media_candidate_new(fscandidate->foundation, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
663 fscandidate->component_id, fscandidate->type, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
664 fscandidate->proto, fscandidate->ip, fscandidate->port); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
665 candidate->base_ip = g_strdup(fscandidate->base_ip); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
666 candidate->base_port = fscandidate->base_port; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
667 candidate->priority = fscandidate->priority; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
668 candidate->username = g_strdup(fscandidate->username); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
669 candidate->password = g_strdup(fscandidate->password); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
670 candidate->ttl = fscandidate->ttl; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
671 return candidate; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
672 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
673 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
674 static GList * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
675 purple_media_candidate_list_from_fs(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
676 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
677 GList *new_list = NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
678 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
679 for (; candidates; candidates = g_list_next(candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
680 new_list = g_list_prepend(new_list, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
681 purple_media_candidate_from_fs( |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
682 candidates->data)); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
683 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
684 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
685 new_list = g_list_reverse(new_list); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
686 return new_list; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
687 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
688 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
689 static GList * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
690 purple_media_candidate_list_to_fs(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
691 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
692 GList *new_list = NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
693 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
694 for (; candidates; candidates = g_list_next(candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
695 new_list = g_list_prepend(new_list, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
696 purple_media_candidate_to_fs( |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
697 candidates->data)); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
698 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
699 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
700 new_list = g_list_reverse(new_list); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
701 return new_list; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
702 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
703 #endif |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
704 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
705 GList * |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
706 purple_media_candidate_list_copy(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
707 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
708 GList *new_list = NULL; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
709 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
710 for (; candidates; candidates = g_list_next(candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
711 new_list = g_list_prepend(new_list, g_boxed_copy( |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
712 PURPLE_TYPE_MEDIA_CANDIDATE, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
713 candidates->data)); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
714 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
715 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
716 new_list = g_list_reverse(new_list); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
717 return new_list; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
718 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
719 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
720 void |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
721 purple_media_candidate_list_free(GList *candidates) |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
722 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
723 for (; candidates; candidates = |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
724 g_list_delete_link(candidates, candidates)) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
725 g_boxed_free(PURPLE_TYPE_MEDIA_CANDIDATE, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
726 candidates->data); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
727 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
728 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
729 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
730 GType |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
731 purple_media_candidate_get_type() |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
732 { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
733 static GType type = 0; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
734 |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
735 if (type == 0) { |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
736 type = g_boxed_type_register_static("PurpleMediaCandidate", |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
737 (GBoxedCopyFunc)purple_media_candidate_copy, |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
738 (GBoxedFreeFunc)purple_media_candidate_free); |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
739 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
740 return type; |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
741 } |
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
742 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
743 #ifdef USE_VV |
26017
b6457b2a8e14
Make FsStreamDirection and FsMediaType conversion functions static.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26015
diff
changeset
|
744 static FsMediaType |
23869
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23865
diff
changeset
|
745 purple_media_to_fs_media_type(PurpleMediaSessionType type) |
23824
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
746 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
747 if (type & PURPLE_MEDIA_AUDIO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
748 return FS_MEDIA_TYPE_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
749 else if (type & PURPLE_MEDIA_VIDEO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
750 return FS_MEDIA_TYPE_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
751 else |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
752 return 0; |
23824
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
753 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
754 |
26017
b6457b2a8e14
Make FsStreamDirection and FsMediaType conversion functions static.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26015
diff
changeset
|
755 static FsStreamDirection |
23869
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23865
diff
changeset
|
756 purple_media_to_fs_stream_direction(PurpleMediaSessionType type) |
23824
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
757 { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
758 if ((type & PURPLE_MEDIA_AUDIO) == PURPLE_MEDIA_AUDIO || |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
759 (type & PURPLE_MEDIA_VIDEO) == PURPLE_MEDIA_VIDEO) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
760 return FS_DIRECTION_BOTH; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
761 else if ((type & PURPLE_MEDIA_SEND_AUDIO) || |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
762 (type & PURPLE_MEDIA_SEND_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
763 return FS_DIRECTION_SEND; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
764 else if ((type & PURPLE_MEDIA_RECV_AUDIO) || |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
765 (type & PURPLE_MEDIA_RECV_VIDEO)) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
766 return FS_DIRECTION_RECV; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
767 else |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
768 return FS_DIRECTION_NONE; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
769 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
770 |
26017
b6457b2a8e14
Make FsStreamDirection and FsMediaType conversion functions static.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26015
diff
changeset
|
771 static PurpleMediaSessionType |
23824
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
772 purple_media_from_fs(FsMediaType type, FsStreamDirection direction) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
773 { |
23869
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23865
diff
changeset
|
774 PurpleMediaSessionType result = PURPLE_MEDIA_NONE; |
23824
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
775 if (type == FS_MEDIA_TYPE_AUDIO) { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
776 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
777 result |= PURPLE_MEDIA_SEND_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
778 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
779 result |= PURPLE_MEDIA_RECV_AUDIO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
780 } else if (type == FS_MEDIA_TYPE_VIDEO) { |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
781 if (direction & FS_DIRECTION_SEND) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
782 result |= PURPLE_MEDIA_SEND_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
783 if (direction & FS_DIRECTION_RECV) |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
784 result |= PURPLE_MEDIA_RECV_VIDEO; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
785 } |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
786 return result; |
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
787 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
788 #endif |
23824
bfaad8393463
Added some utility functions to convert PurpleMediaStreamType
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23821
diff
changeset
|
789 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
790 /* |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
791 * PurpleMediaCodec |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
792 */ |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
793 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
794 struct _PurpleMediaCodecClass |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
795 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
796 GObjectClass parent_class; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
797 }; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
798 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
799 struct _PurpleMediaCodec |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
800 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
801 GObject parent; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
802 }; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
803 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
804 struct _PurpleMediaCodecPrivate |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
805 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
806 gint id; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
807 char *encoding_name; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
808 PurpleMediaSessionType media_type; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
809 guint clock_rate; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
810 guint channels; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
811 GList *optional_params; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
812 }; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
813 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
814 enum { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
815 PROP_CODEC_0, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
816 PROP_ID, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
817 PROP_ENCODING_NAME, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
818 PROP_MEDIA_TYPE, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
819 PROP_CLOCK_RATE, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
820 PROP_CHANNELS, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
821 PROP_OPTIONAL_PARAMS, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
822 }; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
823 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
824 static void |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
825 purple_media_codec_init(PurpleMediaCodec *info) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
826 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
827 PurpleMediaCodecPrivate *priv = |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
828 PURPLE_MEDIA_CODEC_GET_PRIVATE(info); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
829 priv->encoding_name = NULL; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
830 priv->optional_params = NULL; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
831 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
832 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
833 static void |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
834 purple_media_codec_finalize(GObject *info) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
835 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
836 PurpleMediaCodecPrivate *priv = |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
837 PURPLE_MEDIA_CODEC_GET_PRIVATE(info); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
838 g_free(priv->encoding_name); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
839 for (; priv->optional_params; priv->optional_params = |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
840 g_list_delete_link(priv->optional_params, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
841 priv->optional_params)) { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
842 g_free(priv->optional_params->data); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
843 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
844 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
845 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
846 static void |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
847 purple_media_codec_set_property (GObject *object, guint prop_id, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
848 const GValue *value, GParamSpec *pspec) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
849 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
850 PurpleMediaCodecPrivate *priv; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
851 g_return_if_fail(PURPLE_IS_MEDIA_CODEC(object)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
852 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
853 priv = PURPLE_MEDIA_CODEC_GET_PRIVATE(object); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
854 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
855 switch (prop_id) { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
856 case PROP_ID: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
857 priv->id = g_value_get_uint(value); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
858 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
859 case PROP_ENCODING_NAME: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
860 g_free(priv->encoding_name); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
861 priv->encoding_name = g_value_dup_string(value); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
862 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
863 case PROP_MEDIA_TYPE: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
864 priv->media_type = g_value_get_flags(value); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
865 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
866 case PROP_CLOCK_RATE: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
867 priv->clock_rate = g_value_get_uint(value); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
868 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
869 case PROP_CHANNELS: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
870 priv->channels = g_value_get_uint(value); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
871 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
872 case PROP_OPTIONAL_PARAMS: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
873 priv->optional_params = g_value_get_pointer(value); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
874 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
875 default: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
876 G_OBJECT_WARN_INVALID_PROPERTY_ID( |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
877 object, prop_id, pspec); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
878 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
879 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
880 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
881 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
882 static void |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
883 purple_media_codec_get_property (GObject *object, guint prop_id, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
884 GValue *value, GParamSpec *pspec) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
885 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
886 PurpleMediaCodecPrivate *priv; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
887 g_return_if_fail(PURPLE_IS_MEDIA_CODEC(object)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
888 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
889 priv = PURPLE_MEDIA_CODEC_GET_PRIVATE(object); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
890 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
891 switch (prop_id) { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
892 case PROP_ID: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
893 g_value_set_uint(value, priv->id); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
894 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
895 case PROP_ENCODING_NAME: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
896 g_value_set_string(value, priv->encoding_name); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
897 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
898 case PROP_MEDIA_TYPE: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
899 g_value_set_flags(value, priv->media_type); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
900 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
901 case PROP_CLOCK_RATE: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
902 g_value_set_uint(value, priv->clock_rate); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
903 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
904 case PROP_CHANNELS: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
905 g_value_set_uint(value, priv->channels); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
906 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
907 case PROP_OPTIONAL_PARAMS: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
908 g_value_set_pointer(value, priv->optional_params); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
909 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
910 default: |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
911 G_OBJECT_WARN_INVALID_PROPERTY_ID( |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
912 object, prop_id, pspec); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
913 break; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
914 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
915 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
916 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
917 static void |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
918 purple_media_codec_class_init(PurpleMediaCodecClass *klass) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
919 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
920 GObjectClass *gobject_class = (GObjectClass*)klass; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
921 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
922 gobject_class->finalize = purple_media_codec_finalize; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
923 gobject_class->set_property = purple_media_codec_set_property; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
924 gobject_class->get_property = purple_media_codec_get_property; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
925 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
926 g_object_class_install_property(gobject_class, PROP_ID, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
927 g_param_spec_uint("id", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
928 "ID", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
929 "The numeric identifier of the codec.", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
930 0, G_MAXUINT, 0, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
931 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
932 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
933 g_object_class_install_property(gobject_class, PROP_ENCODING_NAME, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
934 g_param_spec_string("encoding-name", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
935 "Encoding Name", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
936 "The name of the codec.", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
937 NULL, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
938 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
939 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
940 g_object_class_install_property(gobject_class, PROP_MEDIA_TYPE, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
941 g_param_spec_flags("media-type", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
942 "Media Type", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
943 "Whether this is an audio of video codec.", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
944 PURPLE_TYPE_MEDIA_SESSION_TYPE, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
945 PURPLE_MEDIA_NONE, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
946 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
947 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
948 g_object_class_install_property(gobject_class, PROP_CLOCK_RATE, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
949 g_param_spec_uint("clock-rate", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
950 "Create Callback", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
951 "The function called to create this element.", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
952 0, G_MAXUINT, 0, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
953 G_PARAM_READWRITE)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
954 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
955 g_object_class_install_property(gobject_class, PROP_CHANNELS, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
956 g_param_spec_uint("channels", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
957 "Channels", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
958 "The number of channels in this codec.", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
959 0, G_MAXUINT, 0, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
960 G_PARAM_READWRITE)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
961 g_object_class_install_property(gobject_class, PROP_OPTIONAL_PARAMS, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
962 g_param_spec_pointer("optional-params", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
963 "Optional Params", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
964 "A list of optional parameters for the codec.", |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
965 G_PARAM_READWRITE)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
966 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
967 g_type_class_add_private(klass, sizeof(PurpleMediaCodecPrivate)); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
968 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
969 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
970 G_DEFINE_TYPE(PurpleMediaCodec, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
971 purple_media_codec, G_TYPE_OBJECT); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
972 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
973 guint |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
974 purple_media_codec_get_id(PurpleMediaCodec *codec) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
975 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
976 guint id; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
977 g_return_val_if_fail(PURPLE_IS_MEDIA_CODEC(codec), 0); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
978 g_object_get(codec, "id", &id, NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
979 return id; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
980 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
981 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
982 gchar * |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
983 purple_media_codec_get_encoding_name(PurpleMediaCodec *codec) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
984 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
985 gchar *name; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
986 g_return_val_if_fail(PURPLE_IS_MEDIA_CODEC(codec), NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
987 g_object_get(codec, "encoding-name", &name, NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
988 return name; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
989 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
990 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
991 guint |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
992 purple_media_codec_get_clock_rate(PurpleMediaCodec *codec) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
993 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
994 guint clock_rate; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
995 g_return_val_if_fail(PURPLE_IS_MEDIA_CODEC(codec), 0); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
996 g_object_get(codec, "clock-rate", &clock_rate, NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
997 return clock_rate; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
998 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
999 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1000 guint |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1001 purple_media_codec_get_channels(PurpleMediaCodec *codec) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1002 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1003 guint channels; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1004 g_return_val_if_fail(PURPLE_IS_MEDIA_CODEC(codec), 0); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1005 g_object_get(codec, "channels", &channels, NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1006 return channels; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1007 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1008 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1009 GList * |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1010 purple_media_codec_get_optional_parameters(PurpleMediaCodec *codec) |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1011 { |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1012 GList *optional_params; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1013 g_return_val_if_fail(PURPLE_IS_MEDIA_CODEC(codec), NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1014 g_object_get(codec, "optional-params", &optional_params, NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1015 return optional_params; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1016 } |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1017 |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1018 void |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1019 purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1020 const gchar *name, const gchar *value) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1021 { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1022 PurpleMediaCodecPrivate *priv; |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1023 PurpleKeyValuePair *new_param; |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1024 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1025 g_return_if_fail(codec != NULL); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1026 g_return_if_fail(name != NULL && value != NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1027 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1028 priv = PURPLE_MEDIA_CODEC_GET_PRIVATE(codec); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1029 |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1030 new_param = g_new0(PurpleKeyValuePair, 1); |
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1031 new_param->key = g_strdup(name); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1032 new_param->value = g_strdup(value); |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1033 priv->optional_params = g_list_append( |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1034 priv->optional_params, new_param); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1035 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1036 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1037 void |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1038 purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec, |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1039 PurpleKeyValuePair *param) |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1040 { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1041 PurpleMediaCodecPrivate *priv; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1042 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1043 g_return_if_fail(codec != NULL && param != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1044 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1045 priv = PURPLE_MEDIA_CODEC_GET_PRIVATE(codec); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1046 |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1047 g_free(param->key); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1048 g_free(param->value); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1049 g_free(param); |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1050 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1051 priv->optional_params = |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1052 g_list_remove(priv->optional_params, param); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1053 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1054 |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1055 PurpleKeyValuePair * |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1056 purple_media_codec_get_optional_parameter(PurpleMediaCodec *codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1057 const gchar *name, const gchar *value) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1058 { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1059 PurpleMediaCodecPrivate *priv; |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1060 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1061 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1062 g_return_val_if_fail(codec != NULL, NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1063 g_return_val_if_fail(name != NULL, NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1064 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1065 priv = PURPLE_MEDIA_CODEC_GET_PRIVATE(codec); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1066 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1067 for (iter = priv->optional_params; iter; iter = g_list_next(iter)) { |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1068 PurpleKeyValuePair *param = iter->data; |
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1069 if (!g_ascii_strcasecmp(param->key, name) && |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1070 (value == NULL || |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1071 !g_ascii_strcasecmp(param->value, value))) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1072 return param; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1073 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1074 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1075 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1076 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1077 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1078 PurpleMediaCodec * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1079 purple_media_codec_new(int id, const char *encoding_name, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1080 PurpleMediaSessionType media_type, guint clock_rate) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1081 { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1082 PurpleMediaCodec *codec = |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1083 g_object_new(PURPLE_TYPE_MEDIA_CODEC, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1084 "id", id, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1085 "encoding_name", encoding_name, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1086 "media_type", media_type, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1087 "clock-rate", clock_rate, NULL); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1088 return codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1089 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1090 |
26315
c0499eb4dd4d
Disapprove part of the revision that shouldn't be there.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26314
diff
changeset
|
1091 static PurpleMediaCodec * |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1092 purple_media_codec_copy(PurpleMediaCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1093 { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1094 PurpleMediaCodecPrivate *priv; |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1095 PurpleMediaCodec *new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1096 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1097 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1098 if (codec == NULL) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1099 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1100 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1101 priv = PURPLE_MEDIA_CODEC_GET_PRIVATE(codec); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1102 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1103 new_codec = purple_media_codec_new(priv->id, priv->encoding_name, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1104 priv->media_type, priv->clock_rate); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1105 g_object_set(codec, "channels", priv->channels, NULL); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1106 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1107 for (iter = priv->optional_params; iter; iter = g_list_next(iter)) { |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1108 PurpleKeyValuePair *param = |
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1109 (PurpleKeyValuePair*)iter->data; |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1110 purple_media_codec_add_optional_parameter(new_codec, |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1111 param->key, param->value); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1112 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1113 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1114 return new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1115 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1116 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1117 #ifdef USE_VV |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1118 static FsCodec * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1119 purple_media_codec_to_fs(const PurpleMediaCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1120 { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1121 PurpleMediaCodecPrivate *priv; |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1122 FsCodec *new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1123 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1124 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1125 if (codec == NULL) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1126 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1127 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1128 priv = PURPLE_MEDIA_CODEC_GET_PRIVATE(codec); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1129 |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1130 new_codec = fs_codec_new(priv->id, priv->encoding_name, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1131 purple_media_to_fs_media_type(priv->media_type), |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1132 priv->clock_rate); |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1133 new_codec->channels = priv->channels; |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1134 |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1135 for (iter = priv->optional_params; iter; iter = g_list_next(iter)) { |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1136 PurpleKeyValuePair *param = (PurpleKeyValuePair*)iter->data; |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1137 fs_codec_add_optional_parameter(new_codec, |
26403
f0de2405c2f1
Use PurpleMediaKeyPair. Remove PurpleMediaCodecParameter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26399
diff
changeset
|
1138 param->key, param->value); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1139 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1140 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1141 return new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1142 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1143 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1144 static PurpleMediaCodec * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1145 purple_media_codec_from_fs(const FsCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1146 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1147 PurpleMediaCodec *new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1148 GList *iter; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1149 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1150 if (codec == NULL) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1151 return NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1152 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1153 new_codec = purple_media_codec_new(codec->id, codec->encoding_name, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1154 purple_media_from_fs(codec->media_type, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1155 FS_DIRECTION_BOTH), codec->clock_rate); |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1156 g_object_set(new_codec, "channels", codec->channels, NULL); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1157 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1158 for (iter = codec->optional_params; iter; iter = g_list_next(iter)) { |
26027
5275c7ef9edf
Manipulate optional parameters properly.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26026
diff
changeset
|
1159 FsCodecParameter *param = (FsCodecParameter*)iter->data; |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1160 purple_media_codec_add_optional_parameter(new_codec, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1161 param->name, param->value); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1162 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1163 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1164 return new_codec; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1165 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1166 #endif |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1167 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1168 gchar * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1169 purple_media_codec_to_string(const PurpleMediaCodec *codec) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1170 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1171 #ifdef USE_VV |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1172 FsCodec *fscodec = purple_media_codec_to_fs(codec); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1173 gchar *str = fs_codec_to_string(fscodec); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1174 fs_codec_destroy(fscodec); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1175 return str; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1176 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1177 return g_strdup(""); |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1178 #endif |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1179 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1180 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1181 #ifdef USE_VV |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1182 static GList * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1183 purple_media_codec_list_from_fs(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1184 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1185 GList *new_list = NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1186 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1187 for (; codecs; codecs = g_list_next(codecs)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1188 new_list = g_list_prepend(new_list, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1189 purple_media_codec_from_fs( |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1190 codecs->data)); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1191 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1192 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1193 new_list = g_list_reverse(new_list); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1194 return new_list; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1195 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1196 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1197 static GList * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1198 purple_media_codec_list_to_fs(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1199 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1200 GList *new_list = NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1201 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1202 for (; codecs; codecs = g_list_next(codecs)) { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1203 new_list = g_list_prepend(new_list, |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1204 purple_media_codec_to_fs( |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1205 codecs->data)); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1206 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1207 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1208 new_list = g_list_reverse(new_list); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1209 return new_list; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1210 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1211 #endif |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1212 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1213 GList * |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1214 purple_media_codec_list_copy(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1215 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1216 GList *new_list = NULL; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1217 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1218 for (; codecs; codecs = g_list_next(codecs)) { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1219 new_list = g_list_prepend(new_list, |
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1220 purple_media_codec_copy(codecs->data)); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1221 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1222 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1223 new_list = g_list_reverse(new_list); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1224 return new_list; |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1225 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1226 |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1227 void |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1228 purple_media_codec_list_free(GList *codecs) |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1229 { |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1230 for (; codecs; codecs = |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1231 g_list_delete_link(codecs, codecs)) { |
26404
217574ec2a34
Hide and gobjectify PurpleMediaCodec.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26403
diff
changeset
|
1232 g_object_unref(codecs->data); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1233 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1234 } |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
1235 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1236 #ifdef USE_VV |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1237 static PurpleMediaSession* |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1238 purple_media_get_session(PurpleMedia *media, const gchar *sess_id) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1239 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1240 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1241 return (PurpleMediaSession*) (media->priv->sessions) ? |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1242 g_hash_table_lookup(media->priv->sessions, sess_id) : NULL; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1243 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1244 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1245 static FsParticipant* |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1246 purple_media_get_participant(PurpleMedia *media, const gchar *name) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1247 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1248 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1249 return (FsParticipant*) (media->priv->participants) ? |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1250 g_hash_table_lookup(media->priv->participants, name) : NULL; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1251 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1252 |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1253 static PurpleMediaStream* |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1254 purple_media_get_stream(PurpleMedia *media, const gchar *session, const gchar *participant) |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1255 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1256 GList *streams; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1257 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1258 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1259 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1260 streams = media->priv->streams; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1261 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1262 for (; streams; streams = g_list_next(streams)) { |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1263 PurpleMediaStream *stream = streams->data; |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1264 if (!strcmp(stream->session->id, session) && |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1265 !strcmp(stream->participant, participant)) |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1266 return stream; |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1267 } |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1268 |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1269 return NULL; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1270 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1271 |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1272 static GList * |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1273 purple_media_get_streams(PurpleMedia *media, const gchar *session, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1274 const gchar *participant) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1275 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1276 GList *streams; |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1277 GList *ret = NULL; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1278 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1279 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1280 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1281 streams = media->priv->streams; |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1282 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1283 for (; streams; streams = g_list_next(streams)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1284 PurpleMediaStream *stream = streams->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1285 if ((session == NULL || |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1286 !strcmp(stream->session->id, session)) && |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1287 (participant == NULL || |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1288 !strcmp(stream->participant, participant))) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1289 ret = g_list_append(ret, stream); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1290 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1291 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1292 return ret; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1293 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
1294 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1295 static void |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1296 purple_media_add_session(PurpleMedia *media, PurpleMediaSession *session) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1297 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1298 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1299 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1300 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1301 if (!media->priv->sessions) { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1302 purple_debug_info("media", "Creating hash table for sessions\n"); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1303 media->priv->sessions = g_hash_table_new(g_str_hash, g_str_equal); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1304 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1305 g_hash_table_insert(media->priv->sessions, g_strdup(session->id), session); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1306 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1307 |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1308 static gboolean |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1309 purple_media_remove_session(PurpleMedia *media, PurpleMediaSession *session) |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1310 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1311 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1312 return g_hash_table_remove(media->priv->sessions, session->id); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1313 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1314 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1315 static FsParticipant * |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1316 purple_media_add_participant(PurpleMedia *media, const gchar *name) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1317 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1318 FsParticipant *participant; |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1319 GError *err = NULL; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1320 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1321 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1322 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1323 participant = purple_media_get_participant(media, name); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1324 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1325 if (participant) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1326 return participant; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1327 |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1328 participant = fs_conference_new_participant(media->priv->conference, |
23877
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
1329 (gchar*)name, &err); |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1330 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1331 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1332 purple_debug_error("media", "Error creating participant: %s\n", |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1333 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1334 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1335 return NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
1336 } |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1337 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1338 if (!media->priv->participants) { |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1339 purple_debug_info("media", "Creating hash table for participants\n"); |
23877
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
1340 media->priv->participants = g_hash_table_new_full(g_str_hash, |
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
1341 g_str_equal, g_free, NULL); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1342 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1343 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1344 g_hash_table_insert(media->priv->participants, g_strdup(name), participant); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1345 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1346 return participant; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1347 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1348 |
24976
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
1349 static PurpleMediaStream * |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1350 purple_media_insert_stream(PurpleMediaSession *session, const gchar *name, FsStream *stream) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1351 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1352 PurpleMediaStream *media_stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1353 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1354 g_return_val_if_fail(session != NULL, NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1355 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1356 media_stream = g_new0(PurpleMediaStream, 1); |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1357 media_stream->stream = stream; |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1358 media_stream->participant = g_strdup(name); |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1359 media_stream->session = session; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1360 |
24962
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1361 session->media->priv->streams = |
aa50b1f05145
Added PurpleMediaStream to wrap FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24960
diff
changeset
|
1362 g_list_append(session->media->priv->streams, media_stream); |
24976
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
1363 |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
1364 return media_stream; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1365 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1366 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1367 static void |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1368 purple_media_insert_local_candidate(PurpleMediaSession *session, const gchar *name, |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1369 FsCandidate *candidate) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1370 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1371 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1372 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1373 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1374 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1375 stream = purple_media_get_stream(session->media, session->id, name); |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1376 stream->local_candidates = g_list_append(stream->local_candidates, candidate); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1377 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1378 #endif |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1379 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1380 GList * |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1381 purple_media_get_session_names(PurpleMedia *media) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1382 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1383 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1384 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
26126 | 1385 return media->priv->sessions != NULL ? |
1386 g_hash_table_get_keys(media->priv->sessions) : NULL; | |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1387 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1388 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1389 #endif |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1390 } |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1391 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1392 #ifdef USE_VV |
26332
89002b47a0df
Remove purple_media_set_src/sink from the public API.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26331
diff
changeset
|
1393 static void |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1394 purple_media_set_src(PurpleMedia *media, const gchar *sess_id, GstElement *src) |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1395 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1396 PurpleMediaSession *session; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1397 GstPad *sinkpad; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1398 GstPad *srcpad; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1399 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1400 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
26389
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
1401 g_return_if_fail(GST_IS_ELEMENT(src)); |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1402 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1403 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1404 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1405 if (session == NULL) { |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1406 purple_debug_warning("media", "purple_media_set_src: trying" |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1407 " to set src on non-existent session\n"); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1408 return; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1409 } |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1410 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1411 if (session->src) |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1412 gst_object_unref(session->src); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1413 session->src = src; |
26306
5906409c4b69
Fix some GStreamer timing issues.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26305
diff
changeset
|
1414 gst_element_set_locked_state(session->src, TRUE); |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1415 |
26115
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26114
diff
changeset
|
1416 session->tee = gst_element_factory_make("tee", NULL); |
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26114
diff
changeset
|
1417 gst_bin_add(GST_BIN(session->media->priv->confbin), session->tee); |
26381
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1418 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1419 /* This supposedly isn't necessary, but it silences some warnings */ |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1420 if (GST_ELEMENT_PARENT(session->media->priv->confbin) |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1421 == GST_ELEMENT_PARENT(session->src)) { |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1422 GstPad *pad = gst_element_get_static_pad(session->tee, "sink"); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1423 GstPad *ghost = gst_ghost_pad_new(NULL, pad); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1424 gst_object_unref(pad); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1425 gst_pad_set_active(ghost, TRUE); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1426 gst_element_add_pad(session->media->priv->confbin, ghost); |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1427 } |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1428 |
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1429 gst_element_link(session->src, session->media->priv->confbin); |
26115
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26114
diff
changeset
|
1430 gst_element_set_state(session->tee, GST_STATE_PLAYING); |
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26114
diff
changeset
|
1431 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1432 g_object_get(session->session, "sink-pad", &sinkpad, NULL); |
26115
9b0761b77218
Handle the session tee in the session rather than the src bin.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26114
diff
changeset
|
1433 srcpad = gst_element_get_request_pad(session->tee, "src%d"); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1434 purple_debug_info("media", "connecting pad: %s\n", |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1435 gst_pad_link(srcpad, sinkpad) == GST_PAD_LINK_OK |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1436 ? "success" : "failure"); |
26306
5906409c4b69
Fix some GStreamer timing issues.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26305
diff
changeset
|
1437 gst_element_set_locked_state(session->src, FALSE); |
26381
6bcf5ad967ea
Make sharing sources between media sessions work.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26372
diff
changeset
|
1438 gst_object_unref(session->src); |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1439 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1440 #endif |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1441 |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1442 GstElement * |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1443 purple_media_get_src(PurpleMedia *media, const gchar *sess_id) |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1444 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1445 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1446 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1447 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1448 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1449 return (session != NULL) ? session->src : NULL; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1450 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1451 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1452 #endif |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1453 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1454 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1455 #ifdef USE_VV |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1456 static PurpleMediaSession * |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1457 purple_media_session_from_fs_stream(PurpleMedia *media, FsStream *stream) |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1458 { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1459 FsSession *fssession; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1460 GList *values; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1461 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1462 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1463 g_return_val_if_fail(FS_IS_STREAM(stream), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1464 |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1465 g_object_get(stream, "session", &fssession, NULL); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1466 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1467 values = g_hash_table_get_values(media->priv->sessions); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1468 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1469 for (; values; values = g_list_delete_link(values, values)) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1470 PurpleMediaSession *session = values->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1471 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1472 if (session->session == fssession) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1473 g_list_free(values); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1474 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1475 return session; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1476 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1477 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1478 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1479 g_object_unref(fssession); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1480 return NULL; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1481 } |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1482 |
23842
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1483 static gboolean |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
1484 media_bus_call(GstBus *bus, GstMessage *msg, PurpleMedia *media) |
23842
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1485 { |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1486 switch(GST_MESSAGE_TYPE(msg)) { |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1487 case GST_MESSAGE_ELEMENT: { |
26114
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
1488 if (!FS_IS_CONFERENCE(GST_MESSAGE_SRC(msg)) || |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
1489 !PURPLE_IS_MEDIA(media) || |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
1490 media->priv->conference != |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
1491 FS_CONFERENCE(GST_MESSAGE_SRC(msg))) |
730e760ca39f
Move pipeline creation into the media manager.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26109
diff
changeset
|
1492 break; |
26070
7be8c88d630c
Have all media sessions use a single pipeline.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26064
diff
changeset
|
1493 |
23842
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1494 if (gst_structure_has_name(msg->structure, "farsight-error")) { |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1495 FsError error_no; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1496 gst_structure_get_enum(msg->structure, "error-no", |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1497 FS_TYPE_ERROR, (gint*)&error_no); |
24932
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24931
diff
changeset
|
1498 /* |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24931
diff
changeset
|
1499 * Unknown CName is only a problem for the |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24931
diff
changeset
|
1500 * multicast transmitter which isn't used. |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24931
diff
changeset
|
1501 */ |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24931
diff
changeset
|
1502 if (error_no != FS_ERROR_UNKNOWN_CNAME) |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24931
diff
changeset
|
1503 purple_debug_error("media", "farsight-error: %i: %s\n", error_no, |
5606408fff59
Silence FS_ERROR_UNKNOWN_CNAME error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24931
diff
changeset
|
1504 gst_structure_get_string(msg->structure, "error-msg")); |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1505 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1506 "farsight-new-local-candidate")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1507 FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1508 FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "candidate")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1509 PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1510 purple_media_new_local_candidate_cb(stream, local_candidate, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1511 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1512 "farsight-local-candidates-prepared")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1513 FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1514 PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1515 purple_media_candidates_prepared_cb(stream, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1516 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1517 "farsight-new-active-candidate-pair")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1518 FsStream *stream = g_value_get_object(gst_structure_get_value(msg->structure, "stream")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1519 FsCandidate *local_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "local-candidate")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1520 FsCandidate *remote_candidate = g_value_get_boxed(gst_structure_get_value(msg->structure, "remote-candidate")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1521 PurpleMediaSession *session = purple_media_session_from_fs_stream(media, stream); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1522 purple_media_candidate_pair_established_cb(stream, local_candidate, remote_candidate, session); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1523 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1524 "farsight-recv-codecs-changed")) { |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1525 GList *codecs = g_value_get_boxed(gst_structure_get_value(msg->structure, "codecs")); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1526 FsCodec *codec = codecs->data; |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1527 purple_debug_info("media", "farsight-recv-codecs-changed: %s\n", codec->encoding_name); |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1528 |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1529 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1530 "farsight-component-state-changed")) { |
26091
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1531 FsStreamState fsstate = g_value_get_enum(gst_structure_get_value(msg->structure, "state")); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1532 guint component = g_value_get_uint(gst_structure_get_value(msg->structure, "component")); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1533 const gchar *state; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1534 switch (fsstate) { |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1535 case FS_STREAM_STATE_FAILED: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1536 state = "FAILED"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1537 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1538 case FS_STREAM_STATE_DISCONNECTED: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1539 state = "DISCONNECTED"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1540 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1541 case FS_STREAM_STATE_GATHERING: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1542 state = "GATHERING"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1543 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1544 case FS_STREAM_STATE_CONNECTING: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1545 state = "CONNECTING"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1546 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1547 case FS_STREAM_STATE_CONNECTED: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1548 state = "CONNECTED"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1549 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1550 case FS_STREAM_STATE_READY: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1551 state = "READY"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1552 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1553 default: |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1554 state = "UNKNOWN"; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1555 break; |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1556 } |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1557 purple_debug_info("media", "farsight-component-state-changed: component: %u state: %s\n", component, state); |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1558 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1559 "farsight-send-codec-changed")) { |
26091
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1560 FsCodec *codec = g_value_get_boxed(gst_structure_get_value(msg->structure, "codec")); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1561 gchar *codec_str = fs_codec_to_string(codec); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1562 purple_debug_info("media", "farsight-send-codec-changed: codec: %s\n", codec_str); |
58071d9f10b1
Add some debug messages for the remaining Farsight signals.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26090
diff
changeset
|
1563 g_free(codec_str); |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1564 } else if (gst_structure_has_name(msg->structure, |
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1565 "farsight-codecs-changed")) { |
24937
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1566 GList *sessions = g_hash_table_get_values(PURPLE_MEDIA(media)->priv->sessions); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1567 FsSession *fssession = g_value_get_object(gst_structure_get_value(msg->structure, "session")); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1568 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1569 PurpleMediaSession *session = sessions->data; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1570 if (session->session == fssession) { |
26316
bd9fa96c47dc
Remove the ready-new signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26314
diff
changeset
|
1571 gchar *session_id = g_strdup(session->id); |
26059
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26058
diff
changeset
|
1572 g_signal_emit(media, purple_media_signals[CODECS_CHANGED], 0, session_id); |
1ff5304f6e9d
Added codecs-changed signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26058
diff
changeset
|
1573 g_free(session_id); |
24937
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1574 g_list_free(sessions); |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1575 break; |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1576 } |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
1577 } |
23842
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1578 } |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1579 break; |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1580 } |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1581 default: |
23914
d6bda7b63eac
Remove a bunch of extraneous GstBus messages from the debug output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23913
diff
changeset
|
1582 break; |
23842
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1583 } |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1584 |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1585 return TRUE; |
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1586 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1587 #endif |
23842
19e077a4cb62
Move the main voice and video pipeline into media.c and display more debug info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23837
diff
changeset
|
1588 |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1589 PurpleConnection * |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1590 purple_media_get_connection(PurpleMedia *media) |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1591 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1592 #ifdef USE_VV |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1593 PurpleConnection *pc; |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1594 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1595 g_object_get(G_OBJECT(media), "connection", &pc, NULL); |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1596 return pc; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1597 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1598 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1599 #endif |
26121
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1600 } |
7738f530a967
Added the connection property back to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26118
diff
changeset
|
1601 |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1602 gpointer |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1603 purple_media_get_prpl_data(PurpleMedia *media) |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1604 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1605 #ifdef USE_VV |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1606 gpointer prpl_data; |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1607 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1608 g_object_get(G_OBJECT(media), "prpl-data", &prpl_data, NULL); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1609 return prpl_data; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1610 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1611 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1612 #endif |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1613 } |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1614 |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1615 void |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1616 purple_media_set_prpl_data(PurpleMedia *media, gpointer prpl_data) |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1617 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1618 #ifdef USE_VV |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1619 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1620 g_object_set(G_OBJECT(media), "prpl-data", prpl_data, NULL); |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1621 #endif |
26122
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1622 } |
e411aad4346b
Add a prpl-data property to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26121
diff
changeset
|
1623 |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1624 void |
24982
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1625 purple_media_error(PurpleMedia *media, const gchar *error, ...) |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1626 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1627 #ifdef USE_VV |
24982
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1628 va_list args; |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1629 gchar *message; |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1630 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1631 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1632 |
24982
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1633 va_start(args, error); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1634 message = g_strdup_vprintf(error, args); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1635 va_end(args); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1636 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1637 purple_debug_error("media", "%s\n", message); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1638 g_signal_emit(media, purple_media_signals[ERROR], 0, message); |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1639 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1640 g_free(message); |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1641 #endif |
24982
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1642 } |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1643 |
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1644 void |
26058
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1645 purple_media_end(PurpleMedia *media, |
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1646 const gchar *session_id, const gchar *participant) |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1647 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1648 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1649 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
26063
685c8f5f85c7
Separate PidginMedia from PidginConversation.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
1650 if (session_id == NULL && participant == NULL) { |
26058
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1651 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
1652 0, PURPLE_MEDIA_STATE_END, |
26058
ac56e5707a72
Added purple_media_end and removed the purple_media_got_hangup.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26057
diff
changeset
|
1653 NULL, NULL); |
26063
685c8f5f85c7
Separate PidginMedia from PidginConversation.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
1654 g_object_unref(media); |
685c8f5f85c7
Separate PidginMedia from PidginConversation.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26061
diff
changeset
|
1655 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1656 #endif |
23762
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1657 } |
70cdff43ec76
You can actually receive Google Talk voice calls with crappy UI now
Sean Egan <seanegan@gmail.com>
parents:
23760
diff
changeset
|
1658 |
26366
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1659 void |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1660 purple_media_stream_info(PurpleMedia *media, PurpleMediaInfoType type, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1661 const gchar *session_id, const gchar *participant, |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1662 gboolean local) |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1663 { |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1664 #ifdef USE_VV |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1665 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1666 |
26368
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1667 if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1668 GList *streams; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1669 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1670 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1671 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1672 streams = purple_media_get_streams(media, |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1673 session_id, participant); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1674 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1675 for (; streams; streams = |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1676 g_list_delete_link(streams, streams)) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1677 PurpleMediaStream *stream = streams->data; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1678 g_object_set(G_OBJECT(stream->stream), "direction", |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1679 purple_media_to_fs_stream_direction( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1680 stream->session->type), NULL); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1681 stream->accepted = TRUE; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1682 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1683 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1684 g_signal_emit(media, purple_media_signals[ACCEPTED], |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1685 0, NULL, NULL); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1686 } else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE || |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1687 type == PURPLE_MEDIA_INFO_UNMUTE)) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1688 GList *sessions; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1689 gboolean active = (type == PURPLE_MEDIA_INFO_MUTE); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1690 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1691 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
26366
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1692 |
26368
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1693 if (session_id == NULL) |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1694 sessions = g_hash_table_get_values( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1695 media->priv->sessions); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1696 else |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1697 sessions = g_list_prepend(NULL, |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1698 purple_media_get_session( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1699 media, session_id)); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1700 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1701 purple_debug_info("media", "Turning mute %s\n", |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1702 active ? "on" : "off"); |
26366
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1703 |
26368
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1704 for (; sessions; sessions = g_list_delete_link( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1705 sessions, sessions)) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1706 PurpleMediaSession *session = sessions->data; |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1707 if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1708 GstElement *volume = gst_bin_get_by_name( |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1709 GST_BIN(session->src), |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1710 "purpleaudioinputvolume"); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1711 g_object_set(volume, "mute", active, NULL); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1712 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1713 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1714 } |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1715 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1716 g_signal_emit(media, purple_media_signals[STREAM_INFO], |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1717 0, type, session_id, participant, local); |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1718 |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1719 if (type == PURPLE_MEDIA_INFO_HANGUP || |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1720 type == PURPLE_MEDIA_INFO_REJECT) { |
aab0195f997d
Move functionality into purple_media_stream_info.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26367
diff
changeset
|
1721 purple_media_end(media, session_id, participant); |
26366
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1722 } |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1723 #endif |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1724 } |
4e1286e76f1f
Create purple_media_stream_info. Add local parameter to stream-info signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26360
diff
changeset
|
1725 |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
1726 #ifdef USE_VV |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1727 static void |
23830
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
1728 purple_media_new_local_candidate_cb(FsStream *stream, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
1729 FsCandidate *local_candidate, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
1730 PurpleMediaSession *session) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1731 { |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1732 gchar *name; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1733 FsParticipant *participant; |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
1734 PurpleMediaCandidate *candidate; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1735 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1736 g_return_if_fail(FS_IS_STREAM(stream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1737 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1738 |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1739 purple_debug_info("media", "got new local candidate: %s\n", local_candidate->foundation); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1740 g_object_get(stream, "participant", &participant, NULL); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1741 g_object_get(participant, "cname", &name, NULL); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1742 g_object_unref(participant); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1743 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1744 purple_media_insert_local_candidate(session, name, fs_candidate_copy(local_candidate)); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1745 |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
1746 candidate = purple_media_candidate_from_fs(local_candidate); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1747 g_signal_emit(session->media, purple_media_signals[NEW_CANDIDATE], |
23877
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
1748 0, session->id, name, candidate); |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
1749 purple_media_candidate_free(candidate); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1750 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1751 g_free(name); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1752 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1753 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1754 static void |
23830
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
1755 purple_media_candidates_prepared_cb(FsStream *stream, PurpleMediaSession *session) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1756 { |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1757 gchar *name; |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1758 FsParticipant *participant; |
24989
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24987
diff
changeset
|
1759 PurpleMediaStream *stream_data; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24987
diff
changeset
|
1760 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1761 g_return_if_fail(FS_IS_STREAM(stream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1762 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1763 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1764 g_object_get(stream, "participant", &participant, NULL); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1765 g_object_get(participant, "cname", &name, NULL); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1766 g_object_unref(participant); |
24989
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24987
diff
changeset
|
1767 |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24987
diff
changeset
|
1768 stream_data = purple_media_get_stream(session->media, session->id, name); |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24987
diff
changeset
|
1769 stream_data->candidates_prepared = TRUE; |
7caa7e2ce870
Implement a new ready signal.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24987
diff
changeset
|
1770 |
26298
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
1771 g_signal_emit(session->media, |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
1772 purple_media_signals[CANDIDATES_PREPARED], |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
1773 0, session->id, name); |
b892b3cb9dbc
Add candidates-prepared signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26292
diff
changeset
|
1774 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1775 g_free(name); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1776 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1777 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1778 /* callback called when a pair of transport candidates (local and remote) |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1779 * has been established */ |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1780 static void |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1781 purple_media_candidate_pair_established_cb(FsStream *fsstream, |
23830
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
1782 FsCandidate *native_candidate, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
1783 FsCandidate *remote_candidate, |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
1784 PurpleMediaSession *session) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1785 { |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1786 gchar *name; |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1787 FsParticipant *participant; |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1788 PurpleMediaStream *stream; |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1789 GList *iter; |
23877
c48f5c9600c3
Fixed a ton of memory leaks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23876
diff
changeset
|
1790 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1791 g_return_if_fail(FS_IS_STREAM(fsstream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1792 g_return_if_fail(session != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1793 |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1794 g_object_get(fsstream, "participant", &participant, NULL); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1795 g_object_get(participant, "cname", &name, NULL); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1796 g_object_unref(participant); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1797 |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1798 stream = purple_media_get_stream(session->media, session->id, name); |
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1799 |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1800 iter = stream->active_local_candidates; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1801 for(; iter; iter = g_list_next(iter)) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1802 FsCandidate *c = iter->data; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1803 if (native_candidate->component_id == c->component_id) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1804 fs_candidate_destroy(c); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1805 stream->active_local_candidates = |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1806 g_list_delete_link(iter, iter); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1807 stream->active_local_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1808 stream->active_local_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1809 fs_candidate_copy(native_candidate)); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1810 break; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1811 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1812 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1813 if (iter == NULL) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1814 stream->active_local_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1815 stream->active_local_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1816 fs_candidate_copy(native_candidate)); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1817 |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1818 iter = stream->active_remote_candidates; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1819 for(; iter; iter = g_list_next(iter)) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1820 FsCandidate *c = iter->data; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1821 if (native_candidate->component_id == c->component_id) { |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1822 fs_candidate_destroy(c); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1823 stream->active_remote_candidates = |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1824 g_list_delete_link(iter, iter); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1825 stream->active_remote_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1826 stream->active_remote_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1827 fs_candidate_copy(remote_candidate)); |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1828 break; |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1829 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1830 } |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1831 if (iter == NULL) |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1832 stream->active_remote_candidates = g_list_prepend( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1833 stream->active_remote_candidates, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
1834 fs_candidate_copy(remote_candidate)); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1835 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1836 purple_debug_info("media", "candidate pair established\n"); |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1837 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1838 |
26026
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1839 static gboolean |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1840 purple_media_connected_cb(PurpleMediaStream *stream) |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1841 { |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1842 g_return_val_if_fail(stream != NULL, FALSE); |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
1843 |
26118
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26117
diff
changeset
|
1844 stream->connected_cb_id = 0; |
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26117
diff
changeset
|
1845 |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
1846 purple_media_manager_create_output_window( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
1847 stream->session->media->priv->manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
1848 stream->session->media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
1849 stream->session->id, stream->participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
1850 |
26026
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1851 g_signal_emit(stream->session->media, |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1852 purple_media_signals[STATE_CHANGED], |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
1853 0, PURPLE_MEDIA_STATE_CONNECTED, |
26026
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1854 stream->session->id, stream->participant); |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1855 return FALSE; |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1856 } |
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1857 |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1858 static void |
24976
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
1859 purple_media_src_pad_added_cb(FsStream *fsstream, GstPad *srcpad, |
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
1860 FsCodec *codec, PurpleMediaStream *stream) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1861 { |
26109
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1862 PurpleMediaPrivate *priv; |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1863 GstPad *sinkpad; |
24976
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
1864 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1865 g_return_if_fail(FS_IS_STREAM(fsstream)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1866 g_return_if_fail(stream != NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1867 |
26109
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1868 priv = stream->session->media->priv; |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1869 |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1870 if (stream->src == NULL) { |
26134 | 1871 GstElement *sink = NULL; |
26109
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1872 |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1873 if (codec->media_type == FS_MEDIA_TYPE_AUDIO) { |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1874 /* |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1875 * Should this instead be: |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1876 * audioconvert ! audioresample ! liveadder ! |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1877 * audioresample ! audioconvert ! realsink |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1878 */ |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1879 stream->src = gst_element_factory_make( |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1880 "liveadder", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1881 sink = purple_media_manager_get_element(priv->manager, |
26392
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
1882 PURPLE_MEDIA_RECV_AUDIO, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
1883 stream->session->media, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
1884 stream->session->id, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
1885 stream->participant); |
26109
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1886 } else if (codec->media_type == FS_MEDIA_TYPE_VIDEO) { |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1887 stream->src = gst_element_factory_make( |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1888 "fsfunnel", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1889 sink = gst_element_factory_make( |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1890 "fakesink", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1891 g_object_set(G_OBJECT(sink), "async", FALSE, NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1892 } |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1893 stream->tee = gst_element_factory_make("tee", NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1894 gst_bin_add_many(GST_BIN(priv->confbin), |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1895 stream->src, stream->tee, sink, NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1896 gst_element_sync_state_with_parent(sink); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1897 gst_element_sync_state_with_parent(stream->tee); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1898 gst_element_sync_state_with_parent(stream->src); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1899 gst_element_link_many(stream->src, stream->tee, sink, NULL); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1900 } |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1901 |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1902 sinkpad = gst_element_get_request_pad(stream->src, "sink%d"); |
26026
71eee5468b9d
Fix some crashes from printing debug messages on a separate thread.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26024
diff
changeset
|
1903 gst_pad_link(srcpad, sinkpad); |
26109
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1904 gst_object_unref(sinkpad); |
fcfb7571515c
Have all src_pads for a stream be funneled into the same stream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26107
diff
changeset
|
1905 |
26118
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26117
diff
changeset
|
1906 stream->connected_cb_id = purple_timeout_add(0, |
0a6f1f796d21
Use purple_timeout_* instead of g_timeout_*.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26117
diff
changeset
|
1907 (GSourceFunc)purple_media_connected_cb, stream); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1908 } |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1909 #endif /* USE_VV */ |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1910 |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1911 gboolean |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1912 purple_media_add_stream(PurpleMedia *media, const gchar *sess_id, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1913 const gchar *who, PurpleMediaSessionType type, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1914 gboolean initiator, const gchar *transmitter, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1915 guint num_params, GParameter *params) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1916 { |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1917 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1918 PurpleMediaSession *session; |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1919 FsParticipant *participant = NULL; |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
1920 PurpleMediaStream *stream = NULL; |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1921 FsMediaType media_type = purple_media_to_fs_media_type(type); |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1922 FsStreamDirection type_direction = |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1923 purple_media_to_fs_stream_direction(type); |
26305
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26298
diff
changeset
|
1924 gboolean is_nice = !strcmp(transmitter, "nice"); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
1925 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1926 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1927 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1928 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
1929 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1930 if (!session) { |
23801
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
1931 GError *err = NULL; |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1932 GList *codec_conf = NULL; |
24948
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1933 gchar *filename = NULL; |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1934 PurpleMediaSessionType session_type; |
26389
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
1935 GstElement *src = NULL; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1936 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1937 session = g_new0(PurpleMediaSession, 1); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1938 |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1939 session->session = fs_conference_new_session( |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1940 media->priv->conference, media_type, &err); |
23801
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
1941 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
1942 if (err != NULL) { |
24982
0ad1b8e950d7
Add purple_media_error.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24981
diff
changeset
|
1943 purple_media_error(media, "Error creating session: %s\n", err->message); |
23801
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
1944 g_error_free(err); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1945 g_free(session); |
23801
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
1946 return FALSE; |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
1947 } |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
1948 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1949 /* XXX: SPEEX has a latency of 5 or 6 seconds for me */ |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1950 #if 0 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1951 /* SPEEX is added through the configuration */ |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1952 codec_conf = g_list_prepend(codec_conf, fs_codec_new(FS_CODEC_ID_ANY, |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1953 "SPEEX", FS_MEDIA_TYPE_AUDIO, 8000)); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1954 codec_conf = g_list_prepend(codec_conf, fs_codec_new(FS_CODEC_ID_ANY, |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1955 "SPEEX", FS_MEDIA_TYPE_AUDIO, 16000)); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1956 #endif |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1957 |
24948
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1958 filename = g_build_filename(purple_user_dir(), "fs-codec.conf", NULL); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1959 codec_conf = fs_codec_list_from_keyfile(filename, &err); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1960 g_free(filename); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1961 |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1962 if (err != NULL) { |
26090
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1963 if (err->code == 4) |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1964 purple_debug_info("media", "Couldn't read " |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1965 "fs-codec.conf: %s\n", |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1966 err->message); |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1967 else |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1968 purple_debug_error("media", "Error reading " |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1969 "fs-codec.conf: %s\n", |
8a402c91fe6f
Don't output an error if fs-codec.conf doesn't exist.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26084
diff
changeset
|
1970 err->message); |
24948
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1971 g_error_free(err); |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1972 } |
78c3e991782a
Use a key file for Farsight 2 codec configuration.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24938
diff
changeset
|
1973 |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
1974 fs_session_set_codec_preferences(session->session, codec_conf, NULL); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1975 |
24980
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24979
diff
changeset
|
1976 /* |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24979
diff
changeset
|
1977 * Removes a 5-7 second delay before |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24979
diff
changeset
|
1978 * receiving the src-pad-added signal. |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24979
diff
changeset
|
1979 * Only works for non-multicast FsRtpSessions. |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24979
diff
changeset
|
1980 */ |
26305
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26298
diff
changeset
|
1981 if (is_nice || !strcmp(transmitter, "rawudp")) |
24980
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24979
diff
changeset
|
1982 g_object_set(G_OBJECT(session->session), |
bcbc62bb2496
Set no-rtcp-timeout to 0 only for nice and rawudp transmitters.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24979
diff
changeset
|
1983 "no-rtcp-timeout", 0, NULL); |
23826
157b30b530f4
Temporary fix to remove a 5-7 second delay when initiating a media session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23824
diff
changeset
|
1984 |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1985 fs_codec_list_destroy(codec_conf); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1986 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1987 session->id = g_strdup(sess_id); |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1988 session->media = media; |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1989 session->type = type; |
26384
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
1990 session->initiator = initiator; |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1991 |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
1992 purple_media_add_session(media, session); |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
1993 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
1994 0, PURPLE_MEDIA_STATE_NEW, |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
1995 session->id, NULL); |
26064
4f013819e4e3
Create the media srcs inside PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
1996 |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1997 session_type = purple_media_from_fs(media_type, |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
1998 FS_DIRECTION_SEND); |
26389
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
1999 src = purple_media_manager_get_element( |
26392
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
2000 media->priv->manager, session_type, |
9c671fc1b351
Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26389
diff
changeset
|
2001 media, session->id, who); |
26389
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2002 if (!GST_IS_ELEMENT(src)) { |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2003 purple_debug_error("media", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2004 "Error creating src for session %s\n", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2005 session->id); |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2006 purple_media_end(media, session->id, NULL); |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2007 return FALSE; |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2008 } |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2009 |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2010 purple_media_set_src(media, session->id, src); |
26064
4f013819e4e3
Create the media srcs inside PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26063
diff
changeset
|
2011 gst_element_set_state(session->src, GST_STATE_PLAYING); |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2012 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2013 purple_media_manager_create_output_window( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2014 media->priv->manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2015 session->media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2016 session->id, NULL); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2017 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2018 |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2019 if (!(participant = purple_media_add_participant(media, who))) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2020 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2021 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2022 return FALSE; |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
2023 } else { |
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
2024 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
2025 0, PURPLE_MEDIA_STATE_NEW, |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
2026 NULL, who); |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2027 } |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2028 |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
2029 stream = purple_media_get_stream(media, sess_id, who); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2030 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2031 if (!stream) { |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2032 GError *err = NULL; |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
2033 FsStream *fsstream = NULL; |
26050
ae3d25465d0f
Run an asynchronous DNS lookup for the STUN server IP (to set as a property
Marcus Lundblad <ml@update.uu.se>
parents:
26047
diff
changeset
|
2034 const gchar *stun_ip = purple_network_get_stun_ip(); |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2035 const gchar *turn_ip = purple_network_get_turn_ip(); |
26056
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26055
diff
changeset
|
2036 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2037 if (stun_ip || turn_ip) { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2038 guint new_num_params = |
26305
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26298
diff
changeset
|
2039 (stun_ip && is_nice) && turn_ip ? |
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26298
diff
changeset
|
2040 num_params + 2 : num_params + 1; |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2041 guint next_param_index = num_params; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2042 GParameter *param = g_new0(GParameter, new_num_params); |
24933
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24932
diff
changeset
|
2043 memcpy(param, params, sizeof(GParameter) * num_params); |
23857
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23856
diff
changeset
|
2044 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2045 if (stun_ip) { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2046 purple_debug_info("media", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2047 "setting property stun-ip on new stream: %s\n", stun_ip); |
26056
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26055
diff
changeset
|
2048 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2049 param[next_param_index].name = "stun-ip"; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2050 g_value_init(¶m[next_param_index].value, G_TYPE_STRING); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2051 g_value_set_string(¶m[next_param_index].value, stun_ip); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2052 next_param_index++; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2053 } |
26056
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26055
diff
changeset
|
2054 |
26305
189ac8d13103
Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26298
diff
changeset
|
2055 if (turn_ip && is_nice) { |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2056 GValueArray *relay_info = g_value_array_new(0); |
26057
128a3175668e
Removed a couple of warnings
Marcus Lundblad <ml@update.uu.se>
parents:
26056
diff
changeset
|
2057 GValue value; |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2058 gint turn_port = |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2059 purple_prefs_get_int("/purple/network/turn_port"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2060 const gchar *username = |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2061 purple_prefs_get_string("/purple/network/turn_username"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2062 const gchar *password = |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2063 purple_prefs_get_string("/purple/network/turn_password"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2064 GstStructure *turn_setup = gst_structure_new("relay-info", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2065 "ip", G_TYPE_STRING, turn_ip, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2066 "port", G_TYPE_UINT, turn_port, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2067 "username", G_TYPE_STRING, username, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2068 "password", G_TYPE_STRING, password, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2069 NULL); |
23857
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23856
diff
changeset
|
2070 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2071 if (turn_setup) { |
26057
128a3175668e
Removed a couple of warnings
Marcus Lundblad <ml@update.uu.se>
parents:
26056
diff
changeset
|
2072 memset(&value, 0, sizeof(GValue)); |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2073 g_value_init(&value, GST_TYPE_STRUCTURE); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2074 gst_value_set_structure(&value, turn_setup); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2075 relay_info = g_value_array_append(relay_info, &value); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2076 gst_structure_free(turn_setup); |
26056
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26055
diff
changeset
|
2077 |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2078 purple_debug_info("media", |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2079 "setting property relay-info on new stream\n"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2080 param[next_param_index].name = "relay-info"; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2081 g_value_init(¶m[next_param_index].value, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2082 G_TYPE_VALUE_ARRAY); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2083 g_value_set_boxed(¶m[next_param_index].value, |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2084 relay_info); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2085 g_value_array_free(relay_info); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2086 } else { |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2087 purple_debug_error("media", "Error relay info"); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2088 g_object_unref(participant); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2089 g_hash_table_remove(media->priv->participants, who); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2090 purple_media_remove_session(media, session); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2091 g_free(session); |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2092 return FALSE; |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2093 } |
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2094 } |
26056
4f0aec6d4ad7
Removed some extra tabs on blank lines
Marcus Lundblad <ml@update.uu.se>
parents:
26055
diff
changeset
|
2095 |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
2096 fsstream = fs_session_new_stream(session->session, |
26051
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
2097 participant, type_direction & |
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
2098 FS_DIRECTION_RECV, transmitter, |
26055
c56e8826fed0
Added support to generate relayed candidates (TURN).
Marcus Lundblad <ml@update.uu.se>
parents:
26053
diff
changeset
|
2099 new_num_params, param, &err); |
24933
6ab96d5d8ac6
Add params to purple_media_add_stream to allow for different libNice
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24932
diff
changeset
|
2100 g_free(param); |
23857
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23856
diff
changeset
|
2101 } else { |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
2102 fsstream = fs_session_new_stream(session->session, |
26051
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
2103 participant, type_direction & |
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
2104 FS_DIRECTION_RECV, transmitter, |
b68a88fb7458
Use the stream's direction to wait to send media.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26050
diff
changeset
|
2105 num_params, params, &err); |
23857
001064185ad4
Use the purple STUN server preference with the rawudp Farsight transmitter.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23856
diff
changeset
|
2106 } |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2107 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2108 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2109 purple_debug_error("media", "Error creating stream: %s\n", |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2110 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2111 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2112 g_object_unref(participant); |
24929
5c30047f960e
Properly free PurpleMedia when there's an error creating an FsStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23919
diff
changeset
|
2113 g_hash_table_remove(media->priv->participants, who); |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2114 purple_media_remove_session(media, session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2115 g_free(session); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2116 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2117 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2118 |
24976
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
2119 stream = purple_media_insert_stream(session, who, fsstream); |
26384
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2120 stream->initiator = initiator; |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
2121 |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2122 /* callback for source pad added (new stream source ready) */ |
24963
33fa549f2399
Move variables to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24962
diff
changeset
|
2123 g_signal_connect(G_OBJECT(fsstream), |
24976
01df0829f054
Move sink from PurpleMediaSession to PurpleMediaStream.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24974
diff
changeset
|
2124 "src-pad-added", G_CALLBACK(purple_media_src_pad_added_cb), stream); |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
2125 |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
2126 g_signal_emit(media, purple_media_signals[STATE_CHANGED], |
26329
86bc2d34f689
Rename state-changed enum and values.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26327
diff
changeset
|
2127 0, PURPLE_MEDIA_STATE_NEW, |
24993
7d2e06b29f88
Add state-changed signal to PurpleMedia.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24991
diff
changeset
|
2128 session->id, who); |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2129 } else { |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2130 if (purple_media_to_fs_stream_direction(stream->session->type) |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2131 != type_direction) { |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2132 /* change direction */ |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2133 g_object_set(stream->stream, "direction", |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2134 type_direction, NULL); |
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2135 } |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2136 } |
23801
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
2137 |
43b3b9ff6028
Added better Farsight error handling. Fixes several crash bugs related
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23799
diff
changeset
|
2138 return TRUE; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2139 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2140 return FALSE; |
26385
8bc4b9094913
Get rid of the purple_media_add_stream wrapper as it isn't useful.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26384
diff
changeset
|
2141 #endif /* USE_VV */ |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2142 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2143 |
26393
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2144 PurpleMediaManager * |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2145 purple_media_get_manager(PurpleMedia *media) |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2146 { |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2147 PurpleMediaManager *ret; |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2148 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2149 g_object_get(media, "manager", &ret, NULL); |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2150 return ret; |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2151 } |
462e5c27dbd7
Use purple_media_manager_get_pipeline instead.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26392
diff
changeset
|
2152 |
23869
551a462b346a
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23865
diff
changeset
|
2153 PurpleMediaSessionType |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
2154 purple_media_get_session_type(PurpleMedia *media, const gchar *sess_id) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2155 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2156 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2157 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2158 g_return_val_if_fail(PURPLE_IS_MEDIA(media), PURPLE_MEDIA_NONE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2159 session = purple_media_get_session(media, sess_id); |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
2160 return session->type; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2161 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2162 return PURPLE_MEDIA_NONE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2163 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2164 } |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
2165 /* XXX: Should wait until codecs-ready is TRUE before using this function */ |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2166 GList * |
24960
a5f1804fcb4b
Combine get_*_codecs functions to mirror Farsight 2.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24951
diff
changeset
|
2167 purple_media_get_codecs(PurpleMedia *media, const gchar *sess_id) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2168 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2169 #ifdef USE_VV |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2170 GList *fscodecs; |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2171 GList *codecs; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2172 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2173 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2174 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2175 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2176 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2177 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2178 if (session == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2179 return NULL; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2180 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2181 g_object_get(G_OBJECT(session->session), |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2182 "codecs", &fscodecs, NULL); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2183 codecs = purple_media_codec_list_from_fs(fscodecs); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2184 fs_codec_list_destroy(fscodecs); |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2185 return codecs; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2186 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2187 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2188 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2189 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2190 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2191 GList * |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
2192 purple_media_get_local_candidates(PurpleMedia *media, const gchar *sess_id, const gchar *name) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2193 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2194 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2195 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2196 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2197 stream = purple_media_get_stream(media, sess_id, name); |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
2198 return purple_media_candidate_list_from_fs(stream->local_candidates); |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2199 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2200 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2201 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2202 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2203 |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2204 void |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
2205 purple_media_add_remote_candidates(PurpleMedia *media, const gchar *sess_id, |
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
2206 const gchar *name, GList *remote_candidates) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2207 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2208 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2209 PurpleMediaStream *stream; |
26052
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2210 GError *err = NULL; |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2211 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2212 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2213 stream = purple_media_get_stream(media, sess_id, name); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2214 |
26389
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2215 if (stream == NULL) { |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2216 purple_debug_error("media", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2217 "purple_media_add_remote_candidates: " |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2218 "couldn't find stream %s %s.\n", |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2219 sess_id, name); |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2220 return; |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2221 } |
5a7fa2093d1e
Make Finch not crash if someone requests a session with video with you.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26388
diff
changeset
|
2222 |
25000
2cf44cc855fe
Add candidates instead of replacing them.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24995
diff
changeset
|
2223 stream->remote_candidates = g_list_concat(stream->remote_candidates, |
26021
f7cf50180e1d
Duplicate FsCandidate to remove it from the public interface.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26020
diff
changeset
|
2224 purple_media_candidate_list_to_fs(remote_candidates)); |
23915
9632027d3b50
Update to Farsight2 0.0.3.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23914
diff
changeset
|
2225 |
26052
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2226 fs_stream_set_remote_candidates(stream->stream, |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2227 stream->remote_candidates, &err); |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2228 |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2229 if (err) { |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2230 purple_debug_error("media", "Error adding remote" |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2231 " candidates: %s\n", err->message); |
997bbae7b80f
Set remote candidates as soon as they are received.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26051
diff
changeset
|
2232 g_error_free(err); |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2233 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2234 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2235 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2236 |
26386
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26385
diff
changeset
|
2237 #if 0 |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26385
diff
changeset
|
2238 /* |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26385
diff
changeset
|
2239 * These two functions aren't being used and I'd rather not lock in the API |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26385
diff
changeset
|
2240 * until they are needed. If they ever are. |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26385
diff
changeset
|
2241 */ |
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26385
diff
changeset
|
2242 |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2243 GList * |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2244 purple_media_get_active_local_candidates(PurpleMedia *media, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2245 const gchar *sess_id, const gchar *name) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2246 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2247 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2248 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2249 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2250 stream = purple_media_get_stream(media, sess_id, name); |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2251 return purple_media_candidate_list_from_fs( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2252 stream->active_local_candidates); |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2253 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2254 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2255 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2256 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2257 |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2258 GList * |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2259 purple_media_get_active_remote_candidates(PurpleMedia *media, |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2260 const gchar *sess_id, const gchar *name) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2261 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2262 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2263 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2264 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2265 stream = purple_media_get_stream(media, sess_id, name); |
26099
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2266 return purple_media_candidate_list_from_fs( |
dcff28a0415c
Handle having multiple active candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26091
diff
changeset
|
2267 stream->active_remote_candidates); |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2268 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2269 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2270 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2271 } |
26386
6d9f4ca72828
Comment out purple_media_get_active_{local,remote}_candidates.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26385
diff
changeset
|
2272 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2273 |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2274 gboolean |
23821
12a16471f94e
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23811
diff
changeset
|
2275 purple_media_set_remote_codecs(PurpleMedia *media, const gchar *sess_id, const gchar *name, GList *codecs) |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2276 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2277 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2278 PurpleMediaStream *stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2279 FsStream *fsstream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2280 GList *fscodecs; |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2281 GError *err = NULL; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2282 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2283 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2284 stream = purple_media_get_stream(media, sess_id, name); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2285 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2286 if (stream == NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2287 return FALSE; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2288 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2289 fsstream = stream->stream; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2290 fscodecs = purple_media_codec_list_to_fs(codecs); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2291 fs_stream_set_remote_codecs(fsstream, fscodecs, &err); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2292 fs_codec_list_destroy(fscodecs); |
23845
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2293 |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2294 if (err) { |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2295 purple_debug_error("media", "Error setting remote codecs: %s\n", |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2296 err->message); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2297 g_error_free(err); |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2298 return FALSE; |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2299 } |
13936e4405b7
Added better Farsight error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23844
diff
changeset
|
2300 return TRUE; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2301 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2302 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2303 #endif |
23797
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2304 } |
e1c8ec1259de
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23793
diff
changeset
|
2305 |
23830
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
2306 gboolean |
26310
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2307 purple_media_candidates_prepared(PurpleMedia *media, |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2308 const gchar *session_id, const gchar *participant) |
23830
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
2309 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2310 #ifdef USE_VV |
26310
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2311 GList *streams; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2312 gboolean prepared = TRUE; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2313 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2314 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2315 |
26310
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2316 streams = purple_media_get_streams(media, session_id, participant); |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2317 |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2318 for (; streams; streams = g_list_delete_link(streams, streams)) { |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2319 PurpleMediaStream *stream = streams->data; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2320 if (stream->candidates_prepared == FALSE) { |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2321 g_list_free(streams); |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2322 prepared = FALSE; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2323 break; |
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2324 } |
23830
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
2325 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
2326 |
26310
17929a84c1fb
Change purple_media_candidates_prepared to use wildcards.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26309
diff
changeset
|
2327 return prepared; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2328 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2329 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2330 #endif |
23830
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
2331 } |
b5a00ddb7077
Jingle sessions now keep track of their transaction state to a degree.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23826
diff
changeset
|
2332 |
23862
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2333 gboolean |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2334 purple_media_set_send_codec(PurpleMedia *media, const gchar *sess_id, PurpleMediaCodec *codec) |
23862
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2335 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2336 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2337 PurpleMediaSession *session; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2338 FsCodec *fscodec; |
23862
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2339 GError *err = NULL; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2340 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2341 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2342 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2343 session = purple_media_get_session(media, sess_id); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2344 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2345 if (session != NULL) |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2346 return FALSE; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2347 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2348 fscodec = purple_media_codec_to_fs(codec); |
26024
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2349 fs_session_set_send_codec(session->session, fscodec, &err); |
ac4d7695dbc7
Wrap FsCodec and remove the Farsight2 include from media.h.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26023
diff
changeset
|
2350 fs_codec_destroy(fscodec); |
23862
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2351 |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2352 if (err) { |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2353 purple_debug_error("media", "Error setting send codec\n"); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2354 g_error_free(err); |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2355 return FALSE; |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2356 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2357 return TRUE; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2358 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2359 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2360 #endif |
23862
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2361 } |
3ffe166a355e
Set the proper send codec in Farsight.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
23857
diff
changeset
|
2362 |
24937
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
2363 gboolean |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
2364 purple_media_codecs_ready(PurpleMedia *media, const gchar *sess_id) |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
2365 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2366 #ifdef USE_VV |
24937
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
2367 gboolean ret; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2368 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2369 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2370 |
26127
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2371 if (sess_id != NULL) { |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2372 PurpleMediaSession *session; |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2373 session = purple_media_get_session(media, sess_id); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2374 |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2375 if (session == NULL) |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2376 return FALSE; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2377 |
26127
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2378 g_object_get(session->session, "codecs-ready", &ret, NULL); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2379 } else { |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2380 GList *values = g_hash_table_get_values(media->priv->sessions); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2381 for (; values; values = g_list_delete_link(values, values)) { |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2382 PurpleMediaSession *session = values->data; |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2383 g_object_get(session->session, |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2384 "codecs-ready", &ret, NULL); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2385 if (ret == FALSE) |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2386 break; |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2387 } |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2388 if (values != NULL) |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2389 g_list_free(values); |
df133a5df391
Have purple_media_codecs_ready handle a session wildcard.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26126
diff
changeset
|
2390 } |
24937
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
2391 return ret; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2392 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2393 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2394 #endif |
24937
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
2395 } |
5a774d0817d8
Wait for Farsight 2's codecs-ready property to be TRUE before using codecs.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24935
diff
changeset
|
2396 |
26061
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
2397 gboolean |
26384
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2398 purple_media_is_initiator(PurpleMedia *media, |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2399 const gchar *sess_id, const gchar *participant) |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2400 { |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2401 #ifdef USE_VV |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2402 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2403 |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2404 if (sess_id == NULL && participant == NULL) |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2405 return media->priv->initiator; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2406 else if (sess_id != NULL && participant == NULL) { |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2407 PurpleMediaSession *session = |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2408 purple_media_get_session(media, sess_id); |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2409 return session != NULL ? session->initiator : FALSE; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2410 } else if (sess_id != NULL && participant != NULL) { |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2411 PurpleMediaStream *stream = purple_media_get_stream( |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2412 media, sess_id, participant); |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2413 return stream != NULL ? stream->initiator : FALSE; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2414 } |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2415 #endif |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2416 return FALSE; |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2417 } |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2418 |
bea334b214fa
Add purple_media_is_initiator.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26383
diff
changeset
|
2419 gboolean |
26061
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
2420 purple_media_accepted(PurpleMedia *media, const gchar *sess_id, |
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
2421 const gchar *participant) |
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
2422 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2423 #ifdef USE_VV |
26309
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2424 gboolean accepted = TRUE; |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2425 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2426 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2427 |
26309
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2428 if (sess_id == NULL && participant == NULL) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2429 GList *streams = media->priv->streams; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2430 |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2431 for (; streams; streams = g_list_next(streams)) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2432 PurpleMediaStream *stream = streams->data; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2433 if (stream->accepted == FALSE) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2434 accepted = FALSE; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2435 break; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2436 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2437 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2438 } else if (sess_id != NULL && participant == NULL) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2439 GList *streams = purple_media_get_streams( |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2440 media, sess_id, NULL); |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2441 for (; streams; streams = |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2442 g_list_delete_link(streams, streams)) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2443 PurpleMediaStream *stream = streams->data; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2444 if (stream->accepted == FALSE) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2445 g_list_free(streams); |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2446 accepted = FALSE; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2447 break; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2448 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2449 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2450 } else if (sess_id != NULL && participant != NULL) { |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2451 PurpleMediaStream *stream = purple_media_get_stream( |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2452 media, sess_id, participant); |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2453 if (stream == NULL || stream->accepted == FALSE) |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2454 accepted = FALSE; |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2455 } |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2456 |
b7b0513604e6
Make acceptance be per stream rather than per session.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26306
diff
changeset
|
2457 return accepted; |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2458 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2459 return FALSE; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2460 #endif |
26061
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
2461 } |
f6a98b2b8d92
Add the accepted signal and make the accept button go away immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26060
diff
changeset
|
2462 |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2463 void purple_media_set_input_volume(PurpleMedia *media, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2464 const gchar *session_id, double level) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2465 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2466 #ifdef USE_VV |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2467 GList *sessions; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2468 |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2469 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2470 |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2471 if (session_id == NULL) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2472 sessions = g_hash_table_get_values(media->priv->sessions); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2473 else |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2474 sessions = g_list_append(NULL, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2475 purple_media_get_session(media, session_id)); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2476 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2477 for (; sessions; sessions = g_list_delete_link(sessions, sessions)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2478 PurpleMediaSession *session = sessions->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2479 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2480 if (session->type & PURPLE_MEDIA_SEND_AUDIO) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2481 GstElement *volume = gst_bin_get_by_name( |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2482 GST_BIN(session->src), |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2483 "purpleaudioinputvolume"); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2484 g_object_set(volume, "volume", level, NULL); |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2485 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2486 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2487 #endif |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2488 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2489 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2490 void purple_media_set_output_volume(PurpleMedia *media, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2491 const gchar *session_id, const gchar *participant, |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2492 double level) |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2493 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2494 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2495 GList *streams; |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2496 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2497 g_return_if_fail(PURPLE_IS_MEDIA(media)); |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2498 |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2499 streams = purple_media_get_streams(media, |
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2500 session_id, participant); |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2501 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2502 for (; streams; streams = g_list_delete_link(streams, streams)) { |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2503 PurpleMediaStream *stream = streams->data; |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2504 |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2505 if (stream->session->type & PURPLE_MEDIA_RECV_AUDIO) { |
26338
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2506 GstElement *tee = stream->tee; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2507 GstIterator *iter = gst_element_iterate_src_pads(tee); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2508 GstPad *sinkpad; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2509 while (gst_iterator_next(iter, (gpointer)&sinkpad) |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2510 == GST_ITERATOR_OK) { |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2511 GstPad *peer = gst_pad_get_peer(sinkpad); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2512 GstElement *volume; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2513 |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2514 if (peer == NULL) { |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2515 gst_object_unref(sinkpad); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2516 continue; |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2517 } |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2518 |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2519 volume = gst_bin_get_by_name(GST_BIN( |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2520 GST_OBJECT_PARENT(peer)), |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2521 "purpleaudiooutputvolume"); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2522 g_object_set(volume, "volume", level, NULL); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2523 gst_object_unref(peer); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2524 gst_object_unref(sinkpad); |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2525 } |
754be87047dc
Have purple_media_set_output_volume handle all sinks.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26336
diff
changeset
|
2526 gst_iterator_free(iter); |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2527 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2528 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2529 #endif |
24971
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2530 } |
1ce297c8923b
Added media functions to set input and output volume.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
24968
diff
changeset
|
2531 |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2532 gulong |
26053
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26052
diff
changeset
|
2533 purple_media_set_output_window(PurpleMedia *media, const gchar *session_id, |
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26052
diff
changeset
|
2534 const gchar *participant, gulong window_id) |
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26052
diff
changeset
|
2535 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2536 #ifdef USE_VV |
26072
4cbf594b2f17
Added a lot of assertions and error handling.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26070
diff
changeset
|
2537 g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE); |
26053
c334a9e17426
Wait to create the sinks until the frames are ready.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26052
diff
changeset
|
2538 |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2539 return purple_media_manager_set_output_window(media->priv->manager, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2540 media, session_id, participant, window_id); |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2541 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2542 return 0; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2543 #endif |
26075
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2544 } |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2545 |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2546 void |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2547 purple_media_remove_output_windows(PurpleMedia *media) |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2548 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2549 #ifdef USE_VV |
26075
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2550 GList *iter = media->priv->streams; |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2551 for (; iter; iter = g_list_next(iter)) { |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2552 PurpleMediaStream *stream = iter->data; |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2553 purple_media_manager_remove_output_windows( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2554 media->priv->manager, media, |
26075
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2555 stream->session->id, stream->participant); |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2556 } |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2557 |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2558 iter = purple_media_get_session_names(media); |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2559 for (; iter; iter = g_list_delete_link(iter, iter)) { |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2560 gchar *session_name = iter->data; |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2561 purple_media_manager_remove_output_windows( |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2562 media->priv->manager, media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2563 session_name, NULL); |
26075
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2564 } |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2565 #endif |
26075
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2566 } |
1aed9a92b657
Implement *_remove_output_window and *_remove_output_windows.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26074
diff
changeset
|
2567 |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2568 GstElement * |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2569 purple_media_get_tee(PurpleMedia *media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2570 const gchar *session_id, const gchar *participant) |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2571 { |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2572 #ifdef USE_VV |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2573 g_return_val_if_fail(PURPLE_IS_MEDIA(media), NULL); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2574 |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2575 if (session_id != NULL && participant == NULL) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2576 PurpleMediaSession *session = |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2577 purple_media_get_session(media, session_id); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2578 return (session != NULL) ? session->tee : NULL; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2579 } else if (session_id != NULL && participant != NULL) { |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2580 PurpleMediaStream *stream = |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2581 purple_media_get_stream(media, |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2582 session_id, participant); |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2583 return (stream != NULL) ? stream->tee : NULL; |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2584 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2585 g_return_val_if_reached(NULL); |
26350
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2586 #else |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2587 return NULL; |
064657db29c4
Properly wrap media functions so the API doesn't disappear when USE_VV
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26349
diff
changeset
|
2588 #endif |
26117
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2589 } |
6cf36f68033c
Only create output windows once there's data to be output.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26115
diff
changeset
|
2590 |