Thu, 23 Jun 2016 14:31:24 +0200
pidgin/finch: use GStreamer-provided VV elements
On startup, don't register own "pidgindefault..." etc. elements with
PurpleMediaManager; only set the active elements from application
preferences.
| 35454 | 1 | /* pidgin |
| 19886 | 2 | * |
| 3 | * Pidgin is the legal property of its developers, whose names are too numerous | |
| 4 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 18 | * along with this program; if not, write to the Free Software | |
|
28321
c8d617c408ab
Update various header copyrights thanks to licensecheck.
Paul Aurich <darkrain42@pidgin.im>
parents:
28278
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 19886 | 20 | */ |
| 21 | ||
|
28981
4e3922ab4844
Include 'internal.h' before all other headers to make some non-gcc compilers happy.
Paul Aurich <darkrain42@pidgin.im>
parents:
28709
diff
changeset
|
22 | #include "internal.h" |
|
23728
77a48a216424
Listen to the media pipeline and display errors.
Michael Ruprecht <maiku@pidgin.im>
parents:
23724
diff
changeset
|
23 | #include "debug.h" |
| 19886 | 24 | #include "connection.h" |
| 25 | #include "media.h" | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
26 | #include "mediamanager.h" |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
27 | #include "pidgin.h" |
|
26273
34eb5919488a
Use request API for a media invitation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26272
diff
changeset
|
28 | #include "request.h" |
| 19886 | 29 | |
| 30 | #include "gtkmedia.h" | |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
31 | #include "gtkutils.h" |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
32 | #include "pidginstock.h" |
| 19886 | 33 | |
|
23704
9b88c9b23aed
Use USE_VV instead of USE_FARSIGHT.
Michael Ruprecht <maiku@pidgin.im>
parents:
23701
diff
changeset
|
34 | #ifdef USE_VV |
|
26639
a56751b4291d
Gstreamer shouldn't be a requirement if USE_VV isn't defined.
Daniel Atallah <datallah@pidgin.im>
parents:
26629
diff
changeset
|
35 | #include "media-gst.h" |
| 19886 | 36 | |
|
33520
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
37 | #ifdef GDK_WINDOWING_WIN32 |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
38 | #include <gdk/gdkwin32.h> |
|
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
39 | #endif |
|
33520
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
40 | #ifdef GDK_WINDOWING_X11 |
|
33478
e6e3ac31f0b4
Move gdkx.h include to the file that really needs it.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33277
diff
changeset
|
41 | #include <gdk/gdkx.h> |
|
33520
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
42 | #endif |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
43 | #ifdef GDK_WINDOWING_QUARTZ |
|
32752
8163ce6c42a6
Allow compile of V/V on OSX without X11. Patch by Eion Robb.
Eion Robb <eion@robbmob.com>
parents:
32751
diff
changeset
|
44 | #include <gdk/gdkquartz.h> |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
45 | #endif |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
46 | #include <gdk/gdkkeysyms.h> |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
47 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33120
diff
changeset
|
48 | #include "gtk3compat.h" |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
49 | |
|
26503
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
50 | #define PIDGIN_TYPE_MEDIA (pidgin_media_get_type()) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
51 | #define PIDGIN_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PIDGIN_TYPE_MEDIA, PidginMedia)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
52 | #define PIDGIN_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PIDGIN_TYPE_MEDIA, PidginMediaClass)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
53 | #define PIDGIN_IS_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PIDGIN_TYPE_MEDIA)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
54 | #define PIDGIN_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PIDGIN_TYPE_MEDIA)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
55 | #define PIDGIN_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PIDGIN_TYPE_MEDIA, PidginMediaClass)) |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
56 | |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
57 | typedef struct _PidginMedia PidginMedia; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
58 | typedef struct _PidginMediaClass PidginMediaClass; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
59 | typedef struct _PidginMediaPrivate PidginMediaPrivate; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
60 | |
|
22682
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
61 | typedef enum |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
62 | { |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
63 | /* Waiting for response */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
64 | PIDGIN_MEDIA_WAITING = 1, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
65 | /* Got request */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
66 | PIDGIN_MEDIA_REQUESTED, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
67 | /* Accepted call */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
68 | PIDGIN_MEDIA_ACCEPTED, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
69 | /* Rejected call */ |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
70 | PIDGIN_MEDIA_REJECTED, |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
71 | } PidginMediaState; |
|
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
72 | |
|
26503
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
73 | struct _PidginMediaClass |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
74 | { |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
75 | GtkWindowClass parent_class; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
76 | }; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
77 | |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
78 | struct _PidginMedia |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
79 | { |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
80 | GtkWindow parent; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
81 | PidginMediaPrivate *priv; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
82 | }; |
|
8f0ab2bd6cf3
Hide PidginMedia and related structs.
Michael Ruprecht <maiku@pidgin.im>
parents:
26502
diff
changeset
|
83 | |
| 19886 | 84 | struct _PidginMediaPrivate |
| 85 | { | |
| 86 | PurpleMedia *media; | |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
87 | gchar *screenname; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
88 | gulong level_handler_id; |
| 19886 | 89 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
90 | GtkUIManager *ui; |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
91 | GtkWidget *menubar; |
|
26285
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
92 | GtkWidget *statusbar; |
|
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
93 | |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
94 | GtkWidget *hold; |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
95 | GtkWidget *mute; |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
96 | GtkWidget *pause; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
97 | |
| 19886 | 98 | GtkWidget *send_progress; |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
99 | GHashTable *recv_progressbars; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
100 | |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
101 | PidginMediaState state; |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
102 | |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
103 | GtkWidget *display; |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
104 | GtkWidget *send_widget; |
|
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
105 | GtkWidget *recv_widget; |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
106 | GtkWidget *button_widget; |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
107 | GtkWidget *local_video; |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
108 | GHashTable *remote_videos; |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
109 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
110 | guint timeout_id; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
111 | PurpleMediaSessionType request_type; |
| 19886 | 112 | }; |
| 113 | ||
| 114 | #define PIDGIN_MEDIA_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), PIDGIN_TYPE_MEDIA, PidginMediaPrivate)) | |
| 115 | ||
| 116 | static void pidgin_media_class_init (PidginMediaClass *klass); | |
| 117 | static void pidgin_media_init (PidginMedia *media); | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
118 | static void pidgin_media_dispose (GObject *object); |
| 19886 | 119 | static void pidgin_media_finalize (GObject *object); |
| 120 | static void pidgin_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); | |
| 121 | static void pidgin_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); | |
|
22682
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
122 | static void pidgin_media_set_state(PidginMedia *gtkmedia, PidginMediaState state); |
| 19886 | 123 | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
124 | static GtkWindowClass *parent_class = NULL; |
| 19886 | 125 | |
| 126 | ||
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
127 | #if 0 |
| 19886 | 128 | enum { |
| 129 | LAST_SIGNAL | |
| 130 | }; | |
| 131 | static guint pidgin_media_signals[LAST_SIGNAL] = {0}; | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
132 | #endif |
| 19886 | 133 | |
| 134 | enum { | |
| 135 | PROP_0, | |
| 136 | PROP_MEDIA, | |
|
28126
6b4a7ccec66f
Remove send_level and recv_level from PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
28125
diff
changeset
|
137 | PROP_SCREENNAME |
| 19886 | 138 | }; |
| 139 | ||
| 26509 | 140 | static GType |
|
22400
3762d64b1f58
Show a message when the remote end terminates a session.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22072
diff
changeset
|
141 | pidgin_media_get_type(void) |
| 19886 | 142 | { |
| 143 | static GType type = 0; | |
| 144 | ||
| 145 | if (type == 0) { | |
| 146 | static const GTypeInfo info = { | |
| 147 | sizeof(PidginMediaClass), | |
| 148 | NULL, | |
| 149 | NULL, | |
| 150 | (GClassInitFunc) pidgin_media_class_init, | |
| 151 | NULL, | |
| 152 | NULL, | |
| 153 | sizeof(PidginMedia), | |
| 154 | 0, | |
|
22072
4ad1e1e6d94e
Remove a compile error, and a few warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19886
diff
changeset
|
155 | (GInstanceInitFunc) pidgin_media_init, |
|
4ad1e1e6d94e
Remove a compile error, and a few warnings.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19886
diff
changeset
|
156 | NULL |
| 19886 | 157 | }; |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
158 | type = g_type_register_static(GTK_TYPE_WINDOW, "PidginMedia", &info, 0); |
| 19886 | 159 | } |
| 160 | return type; | |
| 161 | } | |
| 162 | ||
| 163 | ||
| 164 | static void | |
| 165 | pidgin_media_class_init (PidginMediaClass *klass) | |
| 166 | { | |
| 167 | GObjectClass *gobject_class = (GObjectClass*)klass; | |
| 23729 | 168 | /* GtkContainerClass *container_class = (GtkContainerClass*)klass; */ |
| 19886 | 169 | parent_class = g_type_class_peek_parent(klass); |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
170 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
171 | gobject_class->dispose = pidgin_media_dispose; |
| 19886 | 172 | gobject_class->finalize = pidgin_media_finalize; |
| 173 | gobject_class->set_property = pidgin_media_set_property; | |
| 174 | gobject_class->get_property = pidgin_media_get_property; | |
| 175 | ||
| 176 | g_object_class_install_property(gobject_class, PROP_MEDIA, | |
| 177 | g_param_spec_object("media", | |
| 178 | "PurpleMedia", | |
| 179 | "The PurpleMedia associated with this media.", | |
| 180 | PURPLE_TYPE_MEDIA, | |
|
35060
195dbb3b6432
pidgin: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
181 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
182 | g_object_class_install_property(gobject_class, PROP_SCREENNAME, |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
183 | g_param_spec_string("screenname", |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
184 | "Screenname", |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
185 | "The screenname of the user this session is with.", |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
186 | NULL, |
|
35060
195dbb3b6432
pidgin: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
187 | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); |
| 19886 | 188 | |
| 189 | g_type_class_add_private(klass, sizeof(PidginMediaPrivate)); | |
| 190 | } | |
| 191 | ||
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
192 | static void |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
193 | pidgin_media_hold_toggled(GtkToggleButton *toggle, PidginMedia *media) |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
194 | { |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
195 | purple_media_stream_info(media->priv->media, |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
196 | gtk_toggle_button_get_active(toggle) ? |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
197 | PURPLE_MEDIA_INFO_HOLD : PURPLE_MEDIA_INFO_UNHOLD, |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
198 | NULL, NULL, TRUE); |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
199 | } |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
200 | |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
201 | static void |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
202 | pidgin_media_mute_toggled(GtkToggleButton *toggle, PidginMedia *media) |
|
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
203 | { |
|
26502
f0c8338ca7da
Remove purple_media_mute.
Michael Ruprecht <maiku@pidgin.im>
parents:
26501
diff
changeset
|
204 | purple_media_stream_info(media->priv->media, |
|
f0c8338ca7da
Remove purple_media_mute.
Michael Ruprecht <maiku@pidgin.im>
parents:
26501
diff
changeset
|
205 | gtk_toggle_button_get_active(toggle) ? |
|
f0c8338ca7da
Remove purple_media_mute.
Michael Ruprecht <maiku@pidgin.im>
parents:
26501
diff
changeset
|
206 | PURPLE_MEDIA_INFO_MUTE : PURPLE_MEDIA_INFO_UNMUTE, |
|
f0c8338ca7da
Remove purple_media_mute.
Michael Ruprecht <maiku@pidgin.im>
parents:
26501
diff
changeset
|
207 | NULL, NULL, TRUE); |
|
26103
1cdefa229226
Added a mute button for the local microphone.
Michael Ruprecht <maiku@pidgin.im>
parents:
26096
diff
changeset
|
208 | } |
| 19886 | 209 | |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
210 | static void |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
211 | pidgin_media_pause_toggled(GtkToggleButton *toggle, PidginMedia *media) |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
212 | { |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
213 | purple_media_stream_info(media->priv->media, |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
214 | gtk_toggle_button_get_active(toggle) ? |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
215 | PURPLE_MEDIA_INFO_PAUSE : PURPLE_MEDIA_INFO_UNPAUSE, |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
216 | NULL, NULL, TRUE); |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
217 | } |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
218 | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
219 | static gboolean |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
220 | pidgin_media_delete_event_cb(GtkWidget *widget, |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
221 | GdkEvent *event, PidginMedia *media) |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
222 | { |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
223 | if (media->priv->media) |
|
26499
759bf410db86
Remove purple_media_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26496
diff
changeset
|
224 | purple_media_stream_info(media->priv->media, |
|
759bf410db86
Remove purple_media_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26496
diff
changeset
|
225 | PURPLE_MEDIA_INFO_HANGUP, NULL, NULL, TRUE); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
226 | return FALSE; |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
227 | } |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
228 | |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
229 | #ifdef HAVE_X11 |
|
26283
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
230 | static int |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
231 | pidgin_x_error_handler(Display *display, XErrorEvent *event) |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
232 | { |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
233 | const gchar *error_type; |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
234 | switch (event->error_code) { |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
235 | #define XERRORCASE(type) case type: error_type = #type; break |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
236 | XERRORCASE(BadAccess); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
237 | XERRORCASE(BadAlloc); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
238 | XERRORCASE(BadAtom); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
239 | XERRORCASE(BadColor); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
240 | XERRORCASE(BadCursor); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
241 | XERRORCASE(BadDrawable); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
242 | XERRORCASE(BadFont); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
243 | XERRORCASE(BadGC); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
244 | XERRORCASE(BadIDChoice); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
245 | XERRORCASE(BadImplementation); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
246 | XERRORCASE(BadLength); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
247 | XERRORCASE(BadMatch); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
248 | XERRORCASE(BadName); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
249 | XERRORCASE(BadPixmap); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
250 | XERRORCASE(BadRequest); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
251 | XERRORCASE(BadValue); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
252 | XERRORCASE(BadWindow); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
253 | #undef XERRORCASE |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
254 | default: |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
255 | error_type = "unknown"; |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
256 | break; |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
257 | } |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
258 | purple_debug_error("media", "A %s Xlib error has occurred. " |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
259 | "The program would normally crash now.\n", |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
260 | error_type); |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
261 | return 0; |
|
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
262 | } |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
263 | #endif |
|
26283
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
264 | |
| 19886 | 265 | static void |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
266 | menu_hangup(GtkAction *action, gpointer data) |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
267 | { |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
268 | PidginMedia *gtkmedia = PIDGIN_MEDIA(data); |
|
26499
759bf410db86
Remove purple_media_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26496
diff
changeset
|
269 | purple_media_stream_info(gtkmedia->priv->media, |
|
759bf410db86
Remove purple_media_hangup.
Michael Ruprecht <maiku@pidgin.im>
parents:
26496
diff
changeset
|
270 | PURPLE_MEDIA_INFO_HANGUP, NULL, NULL, TRUE); |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
271 | } |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
272 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
273 | static const GtkActionEntry menu_entries[] = { |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
274 | { "MediaMenu", NULL, N_("_Media"), NULL, NULL, NULL }, |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
275 | { "Hangup", NULL, N_("_Hangup"), NULL, NULL, G_CALLBACK(menu_hangup) }, |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
276 | }; |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
277 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
278 | static const char *media_menu = |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
279 | "<ui>" |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
280 | "<menubar name='Media'>" |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
281 | "<menu action='MediaMenu'>" |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
282 | "<menuitem action='Hangup'/>" |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
283 | "</menu>" |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
284 | "</menubar>" |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
285 | "</ui>"; |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
286 | |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
287 | static GtkWidget * |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
288 | setup_menubar(PidginMedia *window) |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
289 | { |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
290 | GtkActionGroup *action_group; |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
291 | GError *error; |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
292 | GtkAccelGroup *accel_group; |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
293 | GtkWidget *menu; |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
294 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
295 | action_group = gtk_action_group_new("MediaActions"); |
|
32055
b1715ca1b7d8
Fix translation of the menu items on the media window.
Mark Doliner <markdoliner@pidgin.im>
parents:
31966
diff
changeset
|
296 | #ifdef ENABLE_NLS |
|
b1715ca1b7d8
Fix translation of the menu items on the media window.
Mark Doliner <markdoliner@pidgin.im>
parents:
31966
diff
changeset
|
297 | gtk_action_group_set_translation_domain(action_group, |
|
b1715ca1b7d8
Fix translation of the menu items on the media window.
Mark Doliner <markdoliner@pidgin.im>
parents:
31966
diff
changeset
|
298 | PACKAGE); |
|
b1715ca1b7d8
Fix translation of the menu items on the media window.
Mark Doliner <markdoliner@pidgin.im>
parents:
31966
diff
changeset
|
299 | #endif |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
300 | gtk_action_group_add_actions(action_group, |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
301 | menu_entries, |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
302 | G_N_ELEMENTS(menu_entries), |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
303 | GTK_WINDOW(window)); |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
304 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
305 | window->priv->ui = gtk_ui_manager_new(); |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
306 | gtk_ui_manager_insert_action_group(window->priv->ui, action_group, 0); |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
307 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
308 | accel_group = gtk_ui_manager_get_accel_group(window->priv->ui); |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
309 | gtk_window_add_accel_group(GTK_WINDOW(window), accel_group); |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
310 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
311 | error = NULL; |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
312 | if (!gtk_ui_manager_add_ui_from_string(window->priv->ui, media_menu, -1, &error)) |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
313 | { |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
314 | g_message("building menus failed: %s", error->message); |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
315 | g_error_free(error); |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
316 | exit(EXIT_FAILURE); |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
317 | } |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
318 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
319 | menu = gtk_ui_manager_get_widget(window->priv->ui, "/Media"); |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
320 | |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
321 | gtk_widget_show(menu); |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
322 | return menu; |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
323 | } |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
324 | |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
325 | static void |
| 19886 | 326 | pidgin_media_init (PidginMedia *media) |
| 327 | { | |
|
26624
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
328 | GtkWidget *vbox; |
| 19886 | 329 | media->priv = PIDGIN_MEDIA_GET_PRIVATE(media); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
330 | |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
331 | #ifdef HAVE_X11 |
|
26283
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
332 | XSetErrorHandler(pidgin_x_error_handler); |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
333 | #endif |
|
26283
196caad2294d
Implement an X error handler to prevent Pidgin from crashing on
Michael Ruprecht <maiku@pidgin.im>
parents:
26282
diff
changeset
|
334 | |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
335 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
336 | gtk_container_add(GTK_CONTAINER(media), vbox); |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
337 | |
|
26285
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
338 | media->priv->statusbar = gtk_statusbar_new(); |
|
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
339 | gtk_box_pack_end(GTK_BOX(vbox), media->priv->statusbar, |
|
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
340 | FALSE, FALSE, 0); |
|
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
341 | gtk_statusbar_push(GTK_STATUSBAR(media->priv->statusbar), |
|
26299
e7a85461e2a7
Remove unnecessary buttons and change statusbar to say "Calling..."
Michael Ruprecht <maiku@pidgin.im>
parents:
26298
diff
changeset
|
342 | 0, _("Calling...")); |
|
26285
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
343 | gtk_widget_show(media->priv->statusbar); |
|
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
344 | |
|
26298
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
345 | media->priv->menubar = setup_menubar(media); |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
346 | gtk_box_pack_start(GTK_BOX(vbox), media->priv->menubar, |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
347 | FALSE, TRUE, 0); |
|
ca30f1c77069
Add a basic menu to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26289
diff
changeset
|
348 | |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
349 | media->priv->display = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE); |
|
26481
c5813c3ae985
Improve padding in media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
350 | gtk_container_set_border_width(GTK_CONTAINER(media->priv->display), |
|
c5813c3ae985
Improve padding in media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26479
diff
changeset
|
351 | PIDGIN_HIG_BOX_SPACE); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
352 | gtk_box_pack_start(GTK_BOX(vbox), media->priv->display, |
|
26255
3b0da2f49570
Remove unneeded pidgin_media_get_display_widget function.
Michael Ruprecht <maiku@pidgin.im>
parents:
26254
diff
changeset
|
353 | TRUE, TRUE, PIDGIN_HIG_BOX_SPACE); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
354 | gtk_widget_show(vbox); |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
355 | |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
356 | g_signal_connect(G_OBJECT(media), "delete-event", |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
357 | G_CALLBACK(pidgin_media_delete_event_cb), media); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
358 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
359 | media->priv->recv_progressbars = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
360 | g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
361 | media->priv->remote_videos = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
362 | g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
363 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
364 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
365 | static gchar * |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
366 | create_key(const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
367 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
368 | return g_strdup_printf("%s_%s", session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
369 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
370 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
371 | static void |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
372 | pidgin_media_insert_widget(PidginMedia *gtkmedia, GtkWidget *widget, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
373 | const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
374 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
375 | gchar *key = create_key(session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
376 | PurpleMediaSessionType type = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
377 | purple_media_get_session_type(gtkmedia->priv->media, session_id); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
378 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
379 | if (type & PURPLE_MEDIA_AUDIO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
380 | g_hash_table_insert(gtkmedia->priv->recv_progressbars, key, widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
381 | else if (type & PURPLE_MEDIA_VIDEO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
382 | g_hash_table_insert(gtkmedia->priv->remote_videos, key, widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
383 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
384 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
385 | static GtkWidget * |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
386 | pidgin_media_get_widget(PidginMedia *gtkmedia, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
387 | const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
388 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
389 | GtkWidget *widget = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
390 | gchar *key = create_key(session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
391 | PurpleMediaSessionType type = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
392 | purple_media_get_session_type(gtkmedia->priv->media, session_id); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
393 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
394 | if (type & PURPLE_MEDIA_AUDIO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
395 | widget = g_hash_table_lookup(gtkmedia->priv->recv_progressbars, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
396 | else if (type & PURPLE_MEDIA_VIDEO) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
397 | widget = g_hash_table_lookup(gtkmedia->priv->remote_videos, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
398 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
399 | g_free(key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
400 | return widget; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
401 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
402 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
403 | static void |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
404 | pidgin_media_remove_widget(PidginMedia *gtkmedia, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
405 | const gchar *session_id, const gchar *participant) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
406 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
407 | GtkWidget *widget = pidgin_media_get_widget(gtkmedia, session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
408 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
409 | if (widget) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
410 | PurpleMediaSessionType type = |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
411 | purple_media_get_session_type(gtkmedia->priv->media, session_id); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
412 | gchar *key = create_key(session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
413 | GtkRequisition req; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
414 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
415 | if (type & PURPLE_MEDIA_AUDIO) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
416 | g_hash_table_remove(gtkmedia->priv->recv_progressbars, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
417 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
418 | if (g_hash_table_size(gtkmedia->priv->recv_progressbars) == 0 && |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
419 | gtkmedia->priv->send_progress) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
420 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
421 | gtk_widget_destroy(gtkmedia->priv->send_progress); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
422 | gtkmedia->priv->send_progress = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
423 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
424 | gtk_widget_destroy(gtkmedia->priv->mute); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
425 | gtkmedia->priv->mute = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
426 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
427 | } else if (type & PURPLE_MEDIA_VIDEO) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
428 | g_hash_table_remove(gtkmedia->priv->remote_videos, key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
429 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
430 | if (g_hash_table_size(gtkmedia->priv->remote_videos) == 0 && |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
431 | gtkmedia->priv->local_video) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
432 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
433 | gtk_widget_destroy(gtkmedia->priv->local_video); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
434 | gtkmedia->priv->local_video = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
435 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
436 | gtk_widget_destroy(gtkmedia->priv->pause); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
437 | gtkmedia->priv->pause = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
438 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
439 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
440 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
441 | g_free(key); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
442 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
443 | gtk_widget_destroy(widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
444 | |
|
33277
d6229108ce71
Remove deprecated gtk_widget_size_request calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33170
diff
changeset
|
445 | gtk_widget_get_preferred_size(GTK_WIDGET(gtkmedia), NULL, &req); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
446 | gtk_window_resize(GTK_WINDOW(gtkmedia), req.width, req.height); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
447 | } |
| 19886 | 448 | } |
| 449 | ||
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
450 | static void |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
451 | level_message_cb(PurpleMedia *media, gchar *session_id, gchar *participant, |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
452 | double level, PidginMedia *gtkmedia) |
| 19886 | 453 | { |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
454 | GtkWidget *progress = NULL; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
455 | if (participant == NULL) |
|
26276
b9d3887b8318
Have all media sessions use a single pipeline.
Michael Ruprecht <maiku@pidgin.im>
parents:
26275
diff
changeset
|
456 | progress = gtkmedia->priv->send_progress; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
457 | else |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
458 | progress = pidgin_media_get_widget(gtkmedia, session_id, participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
459 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
460 | if (progress) |
|
32751
24798e6f3c3a
The function gst_msg_db_to_percent already retyrns a number between
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32711
diff
changeset
|
461 | gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progress), level); |
| 19886 | 462 | } |
| 463 | ||
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
464 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
465 | static void |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
466 | pidgin_media_disconnect_levels(PurpleMedia *media, PidginMedia *gtkmedia) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
467 | { |
|
26523
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
468 | PurpleMediaManager *manager = purple_media_get_manager(media); |
|
4544b079e3dd
Use purple_media_manager_get_pipeline instead.
Michael Ruprecht <maiku@pidgin.im>
parents:
26522
diff
changeset
|
469 | GstElement *element = purple_media_manager_get_pipeline(manager); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
470 | gulong handler_id = g_signal_handler_find(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))), |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
471 | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
472 | NULL, G_CALLBACK(level_message_cb), gtkmedia); |
|
23701
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
473 | if (handler_id) |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
474 | g_signal_handler_disconnect(G_OBJECT(gst_pipeline_get_bus(GST_PIPELINE(element))), |
|
ecbd92b724df
Added better Farsight error handling. Fixes several crash bugs related
Michael Ruprecht <maiku@pidgin.im>
parents:
23697
diff
changeset
|
475 | handler_id); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
476 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
477 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
478 | static void |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
479 | pidgin_media_dispose(GObject *media) |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
480 | { |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
481 | PidginMedia *gtkmedia = PIDGIN_MEDIA(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
482 | purple_debug_info("gtkmedia", "pidgin_media_dispose\n"); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
483 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
484 | if (gtkmedia->priv->media) { |
|
26300
02de47d1a94c
Close the request dialog if the remote user hung up.
Michael Ruprecht <maiku@pidgin.im>
parents:
26299
diff
changeset
|
485 | purple_request_close_with_handle(gtkmedia); |
|
26281
111754ffd39b
Implement *_remove_output_window and *_remove_output_windows.
Michael Ruprecht <maiku@pidgin.im>
parents:
26276
diff
changeset
|
486 | purple_media_remove_output_windows(gtkmedia->priv->media); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
487 | pidgin_media_disconnect_levels(gtkmedia->priv->media, gtkmedia); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
488 | g_object_unref(gtkmedia->priv->media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
489 | gtkmedia->priv->media = NULL; |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
490 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
491 | |
|
30554
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
492 | if (gtkmedia->priv->ui) { |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
493 | g_object_unref(gtkmedia->priv->ui); |
|
c429e21a08b9
Use GtkUIManager for gtk media stuff, since it's internal.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30481
diff
changeset
|
494 | gtkmedia->priv->ui = NULL; |
|
26305
04b0dd0fd8cb
Properly free item factory. Should fix a crash on close.
Michael Ruprecht <maiku@pidgin.im>
parents:
26298
diff
changeset
|
495 | } |
|
04b0dd0fd8cb
Properly free item factory. Should fix a crash on close.
Michael Ruprecht <maiku@pidgin.im>
parents:
26298
diff
changeset
|
496 | |
|
31151
f352f10d5755
pidgin: Remove a timeout when destroying this object to avoid a use-after-free
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30554
diff
changeset
|
497 | if (gtkmedia->priv->timeout_id != 0) |
|
f352f10d5755
pidgin: Remove a timeout when destroying this object to avoid a use-after-free
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30554
diff
changeset
|
498 | g_source_remove(gtkmedia->priv->timeout_id); |
|
f352f10d5755
pidgin: Remove a timeout when destroying this object to avoid a use-after-free
Jakub Adam <jakub.adam@ktknet.cz>
parents:
30554
diff
changeset
|
499 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
500 | if (gtkmedia->priv->recv_progressbars) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
501 | g_hash_table_destroy(gtkmedia->priv->recv_progressbars); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
502 | g_hash_table_destroy(gtkmedia->priv->remote_videos); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
503 | gtkmedia->priv->recv_progressbars = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
504 | gtkmedia->priv->remote_videos = NULL; |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
505 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
506 | |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
507 | G_OBJECT_CLASS(parent_class)->dispose(media); |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
508 | } |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
509 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
510 | static void |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
511 | pidgin_media_finalize(GObject *media) |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
512 | { |
|
26255
3b0da2f49570
Remove unneeded pidgin_media_get_display_widget function.
Michael Ruprecht <maiku@pidgin.im>
parents:
26254
diff
changeset
|
513 | /* PidginMedia *gtkmedia = PIDGIN_MEDIA(media); */ |
|
26143
673b6665624d
Restructure Jingle code to more easily support multiple application types.
Michael Ruprecht <maiku@pidgin.im>
parents:
26137
diff
changeset
|
514 | purple_debug_info("gtkmedia", "pidgin_media_finalize\n"); |
|
26210
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
515 | |
|
dffd522ea21e
Use the dispose method too.
Michael Ruprecht <maiku@pidgin.im>
parents:
26184
diff
changeset
|
516 | G_OBJECT_CLASS(parent_class)->finalize(media); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
517 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
518 | |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
519 | static void |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
520 | pidgin_media_emit_message(PidginMedia *gtkmedia, const char *msg) |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
521 | { |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
33958
diff
changeset
|
522 | PurpleConversation *conv = purple_conversations_find_with_account( |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
523 | gtkmedia->priv->screenname, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
524 | purple_media_get_account(gtkmedia->priv->media)); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
525 | if (conv != NULL) |
|
36089
c035b9a63457
Use purple_conversation_write_system_message where appropriate
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
526 | purple_conversation_write_system_message(conv, msg, 0); |
|
23697
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
527 | } |
|
299bafcd8eb8
Updates voice and video to use Farsight 2, gets XMPP voice conferences
Michael Ruprecht <maiku@pidgin.im>
parents:
22682
diff
changeset
|
528 | |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
529 | typedef struct |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
530 | { |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
531 | PidginMedia *gtkmedia; |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
532 | gchar *session_id; |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
533 | gchar *participant; |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
534 | } PidginMediaRealizeData; |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
535 | |
|
26233
236de657aae4
Hopefully stop the last of the BadWindow errors.
Michael Ruprecht <maiku@pidgin.im>
parents:
26212
diff
changeset
|
536 | static gboolean |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
537 | realize_cb_cb(PidginMediaRealizeData *data) |
|
26233
236de657aae4
Hopefully stop the last of the BadWindow errors.
Michael Ruprecht <maiku@pidgin.im>
parents:
26212
diff
changeset
|
538 | { |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
539 | PidginMediaPrivate *priv = data->gtkmedia->priv; |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
540 | GdkWindow *window = NULL; |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
541 | |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
542 | if (data->participant == NULL) |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
543 | window = gtk_widget_get_window(priv->local_video); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
544 | else { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
545 | GtkWidget *widget = pidgin_media_get_widget(data->gtkmedia, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
546 | data->session_id, data->participant); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
547 | if (widget) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
548 | window = gtk_widget_get_window(widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
549 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
550 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
551 | if (window) { |
|
33520
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
552 | gulong window_id = 0; |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
553 | #ifdef GDK_WINDOWING_WIN32 |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
554 | if (GDK_IS_WIN32_WINDOW(window)) |
|
33948
b6c9e5dd95d1
VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33947
diff
changeset
|
555 | window_id = GPOINTER_TO_UINT(GDK_WINDOW_HWND(window)); |
|
33520
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
556 | else |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
557 | #endif |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
558 | #ifdef GDK_WINDOWING_X11 |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
559 | if (GDK_IS_X11_WINDOW(window)) |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
560 | window_id = gdk_x11_window_get_xid(window); |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
561 | else |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
562 | #endif |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
563 | #ifdef GDK_WINDOWING_QUARTZ |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
564 | if (GDK_IS_QUARTZ_WINDOW(window)) |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
565 | window_id = (gulong)gdk_quartz_window_get_nsview(window); |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
566 | else |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
567 | #endif |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
568 | g_warning("Unsupported GDK backend"); |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
569 | #if !(defined(GDK_WINDOWING_WIN32) \ |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
570 | || defined(GDK_WINDOWING_X11) \ |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
571 | || defined(GDK_WINDOWING_QUARTZ)) |
|
e7741c77c5b2
Add support for multiple GDK backends.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33510
diff
changeset
|
572 | # error "Unsupported GDK windowing system" |
|
27972
54d25d73c6c8
Make gtkmedia.c compilable on systems without X11 (as long as they're Win32)
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
26746
diff
changeset
|
573 | #endif |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
574 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
575 | purple_media_set_output_window(priv->media, data->session_id, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
576 | data->participant, window_id); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
577 | } |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
578 | |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
579 | g_free(data->session_id); |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
580 | g_free(data->participant); |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
581 | g_free(data); |
|
26233
236de657aae4
Hopefully stop the last of the BadWindow errors.
Michael Ruprecht <maiku@pidgin.im>
parents:
26212
diff
changeset
|
582 | return FALSE; |
|
236de657aae4
Hopefully stop the last of the BadWindow errors.
Michael Ruprecht <maiku@pidgin.im>
parents:
26212
diff
changeset
|
583 | } |
|
236de657aae4
Hopefully stop the last of the BadWindow errors.
Michael Ruprecht <maiku@pidgin.im>
parents:
26212
diff
changeset
|
584 | |
| 19886 | 585 | static void |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
586 | realize_cb(GtkWidget *widget, PidginMediaRealizeData *data) |
|
26177
35f25555116f
Wait for local video frame to be realized before starting local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
26158
diff
changeset
|
587 | { |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
588 | g_timeout_add(0, (GSourceFunc)realize_cb_cb, data); |
|
26177
35f25555116f
Wait for local video frame to be realized before starting local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
26158
diff
changeset
|
589 | } |
|
35f25555116f
Wait for local video frame to be realized before starting local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
26158
diff
changeset
|
590 | |
|
35f25555116f
Wait for local video frame to be realized before starting local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
26158
diff
changeset
|
591 | static void |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
592 | pidgin_media_error_cb(PidginMedia *media, const char *error, PidginMedia *gtkmedia) |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
593 | { |
|
34622
753f46dd000f
Global replace - renamed functions and types according to GObject-based PurpleConversation API
Ankit Vani <a@nevitus.org>
parents:
33958
diff
changeset
|
594 | PurpleConversation *conv = purple_conversations_find_with_account( |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
595 | gtkmedia->priv->screenname, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
596 | purple_media_get_account(gtkmedia->priv->media)); |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
597 | if (conv != NULL) { |
|
36089
c035b9a63457
Use purple_conversation_write_system_message where appropriate
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
598 | purple_conversation_write_system_message( |
|
c035b9a63457
Use purple_conversation_write_system_message where appropriate
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
599 | conv, error, PURPLE_MESSAGE_ERROR); |
|
34449
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
600 | } else { |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
601 | purple_notify_error(NULL, NULL, _("Media error"), error, |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
602 | purple_request_cpar_from_conversation(conv)); |
|
bbcb198650b7
Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
603 | } |
|
36316
2415067473ba
Support GStreamer 1.x and resync with trunk
David Woodhouse <David.Woodhouse@intel.com>
parents:
36312
diff
changeset
|
604 | |
|
26285
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
605 | gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar), |
|
da0d636d494a
Add statusbar to eventually replace the label.
Michael Ruprecht <maiku@pidgin.im>
parents:
26284
diff
changeset
|
606 | 0, error); |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
607 | } |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
608 | |
|
26267
3bd0240f0632
Add the accepted signal and make the accept button go away immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26259
diff
changeset
|
609 | static void |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
610 | pidgin_media_accept_cb(PurpleMedia *media, int index) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
611 | { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
612 | purple_media_stream_info(media, PURPLE_MEDIA_INFO_ACCEPT, |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
613 | NULL, NULL, TRUE); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
614 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
615 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
616 | static void |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
617 | pidgin_media_reject_cb(PurpleMedia *media, int index) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
618 | { |
|
31620
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
619 | GList *iter = purple_media_get_session_ids(media); |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
620 | for (; iter; iter = g_list_delete_link(iter, iter)) { |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
621 | const gchar *sessionid = iter->data; |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
622 | if (!purple_media_accepted(media, sessionid, NULL)) |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
623 | purple_media_stream_info(media, PURPLE_MEDIA_INFO_REJECT, |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
624 | sessionid, NULL, TRUE); |
|
6058b133ecfd
Adapt Pidgin's incoming call dialog behavior so that rejecting the addition of a
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31619
diff
changeset
|
625 | } |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
626 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
627 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
628 | static gboolean |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
629 | pidgin_request_timeout_cb(PidginMedia *gtkmedia) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
630 | { |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
631 | PurpleAccount *account; |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
632 | PurpleBuddy *buddy; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
633 | const gchar *alias; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
634 | PurpleMediaSessionType type; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
635 | gchar *message = NULL; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
636 | |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
637 | account = purple_media_get_account(gtkmedia->priv->media); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
638 | buddy = purple_blist_find_buddy(account, gtkmedia->priv->screenname); |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
639 | alias = buddy ? purple_buddy_get_contact_alias(buddy) : |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
640 | gtkmedia->priv->screenname; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
641 | type = gtkmedia->priv->request_type; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
642 | gtkmedia->priv->timeout_id = 0; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
643 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
644 | if (type & PURPLE_MEDIA_AUDIO && type & PURPLE_MEDIA_VIDEO) { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
645 | message = g_strdup_printf(_("%s wishes to start an audio/video session with you."), |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
646 | alias); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
647 | } else if (type & PURPLE_MEDIA_AUDIO) { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
648 | message = g_strdup_printf(_("%s wishes to start an audio session with you."), |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
649 | alias); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
650 | } else if (type & PURPLE_MEDIA_VIDEO) { |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
651 | message = g_strdup_printf(_("%s wishes to start a video session with you."), |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
652 | alias); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
653 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
654 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
655 | gtkmedia->priv->request_type = PURPLE_MEDIA_NONE; |
|
28385
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
656 | if (!purple_media_accepted(gtkmedia->priv->media, NULL, NULL)) { |
|
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
657 | purple_request_accept_cancel(gtkmedia, _("Incoming Call"), |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
658 | message, NULL, PURPLE_DEFAULT_ACTION_NONE, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
659 | purple_request_cpar_from_account(account), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
660 | gtkmedia->priv->media, pidgin_media_accept_cb, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33958
diff
changeset
|
661 | pidgin_media_reject_cb); |
|
28385
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
662 | } |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
663 | pidgin_media_emit_message(gtkmedia, message); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
664 | g_free(message); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
665 | return FALSE; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
666 | } |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
667 | |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
668 | static void |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
669 | pidgin_media_input_volume_changed(GtkScaleButton *range, double value, |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
670 | PurpleMedia *media) |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
671 | { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
672 | double val = (double)value * 100.0; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
673 | purple_media_set_input_volume(media, NULL, val); |
|
26622
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
674 | } |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
675 | |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
676 | static void |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
677 | pidgin_media_output_volume_changed(GtkScaleButton *range, double value, |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
678 | PurpleMedia *media) |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
679 | { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
680 | double val = (double)value * 100.0; |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
681 | purple_media_set_output_volume(media, NULL, NULL, val); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
682 | } |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
683 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
684 | static void |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
685 | destroy_parent_widget_cb(GtkWidget *widget, GtkWidget *parent) |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
686 | { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
687 | g_return_if_fail(GTK_IS_WIDGET(parent)); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
688 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
689 | gtk_widget_destroy(parent); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
690 | } |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
691 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
692 | static GtkWidget * |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
693 | pidgin_media_add_audio_widget(PidginMedia *gtkmedia, |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
694 | PurpleMediaSessionType type, const gchar *sid) |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
695 | { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
696 | GtkWidget *volume_widget, *progress_parent, *volume, *progress; |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
697 | double value; |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
698 | |
|
37652
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
699 | static const gchar * const input_volume_icons[] = { |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
700 | "microphone-sensitivity-muted-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
701 | "microphone-sensitivity-high-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
702 | "microphone-sensitivity-low-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
703 | "microphone-sensitivity-medium-symbolic", |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
704 | NULL |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
705 | }; |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
706 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
707 | if (type & PURPLE_MEDIA_SEND_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
708 | value = purple_prefs_get_int( |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
709 | "/purple/media/audio/volume/input"); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
710 | } else if (type & PURPLE_MEDIA_RECV_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
711 | value = purple_prefs_get_int( |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
712 | "/purple/media/audio/volume/output"); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
713 | } else |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
714 | g_return_val_if_reached(NULL); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
715 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
716 | /* Setup widget structure */ |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
717 | volume_widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE); |
|
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
718 | progress_parent = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
719 | gtk_box_pack_start(GTK_BOX(volume_widget), |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
720 | progress_parent, TRUE, TRUE, 0); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
721 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
722 | /* Volume button */ |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
723 | volume = gtk_volume_button_new(); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
724 | gtk_scale_button_set_value(GTK_SCALE_BUTTON(volume), value/100.0); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
725 | gtk_box_pack_end(GTK_BOX(volume_widget), |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
726 | volume, FALSE, FALSE, 0); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
727 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
728 | /* Volume level indicator */ |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
729 | progress = gtk_progress_bar_new(); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
730 | gtk_widget_set_size_request(progress, 250, 10); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
731 | gtk_box_pack_end(GTK_BOX(progress_parent), progress, TRUE, FALSE, 0); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
732 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
733 | if (type & PURPLE_MEDIA_SEND_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
734 | g_signal_connect (G_OBJECT(volume), "value-changed", |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
735 | G_CALLBACK(pidgin_media_input_volume_changed), |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
736 | gtkmedia->priv->media); |
|
37652
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
737 | gtk_scale_button_set_icons(GTK_SCALE_BUTTON(volume), |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
738 | input_volume_icons); |
|
7b1c2a7c0c1d
gtkmedia: use distinct icon for input volume
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37648
diff
changeset
|
739 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
740 | gtkmedia->priv->send_progress = progress; |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
741 | } else if (type & PURPLE_MEDIA_RECV_AUDIO) { |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
742 | g_signal_connect (G_OBJECT(volume), "value-changed", |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
743 | G_CALLBACK(pidgin_media_output_volume_changed), |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
744 | gtkmedia->priv->media); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
745 | |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
746 | pidgin_media_insert_widget(gtkmedia, progress, sid, gtkmedia->priv->screenname); |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
747 | } |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
748 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
749 | g_signal_connect(G_OBJECT(progress), "destroy", |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
750 | G_CALLBACK(destroy_parent_widget_cb), |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
751 | volume_widget); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
752 | |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
753 | gtk_widget_show_all(volume_widget); |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
754 | |
|
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
755 | return volume_widget; |
|
26622
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
756 | } |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
757 | |
|
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
758 | static void |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
759 | phone_dtmf_pressed_cb(GtkButton *button, gpointer user_data) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
760 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
761 | PidginMedia *gtkmedia = user_data; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
762 | gint num; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
763 | gchar *sid; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
764 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
765 | num = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button), "dtmf-digit")); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
766 | sid = g_object_get_data(G_OBJECT(button), "session-id"); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
767 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
768 | purple_media_send_dtmf(gtkmedia->priv->media, sid, num, 25, 50); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
769 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
770 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
771 | static inline GtkWidget * |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
772 | phone_create_button(const gchar *text_hi, const gchar *text_lo) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
773 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
774 | GtkWidget *button; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
775 | GtkWidget *label_hi; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
776 | GtkWidget *label_lo; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
777 | GtkWidget *grid; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
778 | const gchar *text_hi_local; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
779 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
780 | if (text_hi) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
781 | text_hi_local = _(text_hi); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
782 | else |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
783 | text_hi_local = ""; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
784 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
785 | grid = gtk_vbox_new(TRUE, 0); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
786 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
787 | button = gtk_button_new(); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
788 | label_hi = gtk_label_new(text_hi_local); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
789 | gtk_misc_set_alignment(GTK_MISC(label_hi), 0.5, 0.5); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
790 | gtk_box_pack_end(GTK_BOX(grid), label_hi, FALSE, TRUE, 0); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
791 | label_lo = gtk_label_new(text_lo); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
792 | gtk_misc_set_alignment(GTK_MISC(label_lo), 0.5, 0.5); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
793 | gtk_label_set_use_markup(GTK_LABEL(label_lo), TRUE); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
794 | gtk_box_pack_end(GTK_BOX(grid), label_lo, FALSE, TRUE, 0); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
795 | gtk_container_add(GTK_CONTAINER(button), grid); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
796 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
797 | return button; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
798 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
799 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
800 | static struct phone_label { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
801 | gchar *subtext; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
802 | gchar *text; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
803 | gchar chr; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
804 | } phone_labels[] = { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
805 | {"<b>1</b>", NULL, '1'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
806 | /* Translators note: These are the letters on the keys of a numeric |
|
36339
69efd0ff9b9a
Update the link for ETSI ES 202 130
Richard Laager <rlaager@pidgin.im>
parents:
36316
diff
changeset
|
807 | keypad; translate according to the tables in §7 of ETSI ES 202 130: |
|
69efd0ff9b9a
Update the link for ETSI ES 202 130
Richard Laager <rlaager@pidgin.im>
parents:
36316
diff
changeset
|
808 | http://webapp.etsi.org/WorkProgram/Report_WorkItem.asp?WKI_ID=11730 |
|
69efd0ff9b9a
Update the link for ETSI ES 202 130
Richard Laager <rlaager@pidgin.im>
parents:
36316
diff
changeset
|
809 | */ |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
810 | /* Letters on the '2' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
811 | {"<b>2</b>", N_("ABC"), '2'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
812 | /* Letters on the '3' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
813 | {"<b>3</b>", N_("DEF"), '3'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
814 | /* Letters on the '4' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
815 | {"<b>4</b>", N_("GHI"), '4'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
816 | /* Letters on the '5' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
817 | {"<b>5</b>", N_("JKL"), '5'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
818 | /* Letters on the '6' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
819 | {"<b>6</b>", N_("MNO"), '6'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
820 | /* Letters on the '7' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
821 | {"<b>7</b>", N_("PQRS"), '7'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
822 | /* Letters on the '8' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
823 | {"<b>8</b>", N_("TUV"), '8'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
824 | /* Letters on the '9' key of a numeric keypad */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
825 | {"<b>9</b>", N_("WXYZ"), '9'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
826 | {"<b>*</b>", NULL, '*'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
827 | {"<b>0</b>", NULL, '0'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
828 | {"<b>#</b>", NULL, '#'}, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
829 | {NULL, NULL, 0} |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
830 | }; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
831 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
832 | static gboolean |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
833 | pidgin_media_dtmf_key_press_event_cb(GtkWidget *widget, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
834 | GdkEvent *event, gpointer user_data) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
835 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
836 | PidginMedia *gtkmedia = user_data; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
837 | GdkEventKey *key = (GdkEventKey *) event; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
838 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
839 | if (event->type != GDK_KEY_PRESS) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
840 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
841 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
842 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
843 | if ((key->keyval >= GDK_KEY_0 && key->keyval <= GDK_KEY_9) || |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
844 | key->keyval == GDK_KEY_asterisk || |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
845 | key->keyval == GDK_KEY_numbersign) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
846 | gchar *sid = g_object_get_data(G_OBJECT(widget), "session-id"); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
847 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
848 | purple_media_send_dtmf(gtkmedia->priv->media, sid, key->keyval, 25, 50); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
849 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
850 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
851 | return FALSE; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
852 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
853 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
854 | static GtkWidget * |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
855 | pidgin_media_add_dtmf_widget(PidginMedia *gtkmedia, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
856 | PurpleMediaSessionType type, const gchar *_sid) |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
857 | { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
858 | GtkWidget *grid = gtk_table_new(4, 3, TRUE); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
859 | GtkWidget *button; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
860 | gint index = 0; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
861 | GtkWindow *win = >kmedia->parent; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
862 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
863 | /* Add buttons */ |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
864 | for (index = 0; phone_labels[index].subtext != NULL; index++) { |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
865 | button = phone_create_button(phone_labels[index].text, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
866 | phone_labels[index].subtext); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
867 | g_signal_connect(button, "pressed", |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
868 | G_CALLBACK(phone_dtmf_pressed_cb), gtkmedia); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
869 | g_object_set_data(G_OBJECT(button), "dtmf-digit", |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
870 | GINT_TO_POINTER(phone_labels[index].chr)); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
871 | g_object_set_data_full(G_OBJECT(button), "session-id", |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
872 | g_strdup(_sid), g_free); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
873 | gtk_table_attach(GTK_TABLE(grid), button, index % 3, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
874 | index % 3 + 1, index / 3, index / 3 + 1, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
875 | GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
876 | 2, 2); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
877 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
878 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
879 | g_signal_connect(G_OBJECT(win), "key-press-event", |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
880 | G_CALLBACK(pidgin_media_dtmf_key_press_event_cb), gtkmedia); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
881 | g_object_set_data_full(G_OBJECT(win), "session-id", |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
882 | g_strdup(_sid), g_free); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
883 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
884 | gtk_widget_show_all(grid); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
885 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
886 | return grid; |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
887 | } |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
888 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
889 | static void |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
890 | pidgin_media_ready_cb(PurpleMedia *media, PidginMedia *gtkmedia, const gchar *sid) |
| 19886 | 891 | { |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
892 | GtkWidget *send_widget = NULL, *recv_widget = NULL, *button_widget = NULL; |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
893 | PurpleMediaSessionType type = |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
894 | purple_media_get_session_type(media, sid); |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
895 | GdkPixbuf *icon = NULL; |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
896 | |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
897 | if (gtkmedia->priv->recv_widget == NULL |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
898 | && type & (PURPLE_MEDIA_RECV_VIDEO | |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
899 | PURPLE_MEDIA_RECV_AUDIO)) { |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
900 | recv_widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_BOX_SPACE); |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
901 | gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display), |
|
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
902 | recv_widget, TRUE, TRUE, 0); |
|
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
903 | gtk_widget_show(recv_widget); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
904 | } else { |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
905 | recv_widget = gtkmedia->priv->recv_widget; |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
906 | } |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
907 | if (gtkmedia->priv->send_widget == NULL |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
908 | && type & (PURPLE_MEDIA_SEND_VIDEO | |
|
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
909 | PURPLE_MEDIA_SEND_AUDIO)) { |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
910 | send_widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, PIDGIN_HIG_BOX_SPACE); |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
911 | gtk_box_pack_start(GTK_BOX(gtkmedia->priv->display), |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
912 | send_widget, FALSE, TRUE, 0); |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
913 | button_widget = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BOX_SPACE); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
914 | gtk_box_pack_end(GTK_BOX(recv_widget), button_widget, |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
915 | FALSE, TRUE, 0); |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
916 | gtk_widget_show(send_widget); |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
917 | |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
918 | /* Hold button */ |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
919 | gtkmedia->priv->hold = |
|
32056
5ecbc7cf4ee1
Mark the "hold" and "mute" menu items for translation in the media dialog.
Mark Doliner <markdoliner@pidgin.im>
parents:
32055
diff
changeset
|
920 | gtk_toggle_button_new_with_mnemonic(_("_Hold")); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
921 | gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->hold, |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
922 | FALSE, FALSE, 0); |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
923 | gtk_widget_show(gtkmedia->priv->hold); |
|
28709
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
924 | g_signal_connect(gtkmedia->priv->hold, "toggled", |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
925 | G_CALLBACK(pidgin_media_hold_toggled), |
|
47bd5eac3afd
Add a hold button to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
28421
diff
changeset
|
926 | gtkmedia); |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
927 | } else { |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
928 | send_widget = gtkmedia->priv->send_widget; |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
929 | button_widget = gtkmedia->priv->button_widget; |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
930 | } |
|
23738
2188a1d89a3a
Move the audio progress bar widgets to be beside the video displays.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
931 | |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
932 | if (type & PURPLE_MEDIA_RECV_VIDEO) { |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
933 | PidginMediaRealizeData *data; |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
934 | GtkWidget *aspect; |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
935 | GtkWidget *remote_video; |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
936 | |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
937 | aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, FALSE); |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
938 | gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN); |
|
23743
bc49c5e2ab2b
Fix the order of the send/recv audio/video display widgets.
Michael Ruprecht <maiku@pidgin.im>
parents:
23742
diff
changeset
|
939 | gtk_box_pack_start(GTK_BOX(recv_widget), aspect, TRUE, TRUE, 0); |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
940 | |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
941 | data = g_new0(PidginMediaRealizeData, 1); |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
942 | data->gtkmedia = gtkmedia; |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
943 | data->session_id = g_strdup(sid); |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
944 | data->participant = g_strdup(gtkmedia->priv->screenname); |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
945 | |
|
37589
e498a88e7c00
Factor out video widget creation into pidgin_create_video_widget()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37424
diff
changeset
|
946 | remote_video = pidgin_create_video_widget(); |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
947 | g_signal_connect(G_OBJECT(remote_video), "realize", |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
948 | G_CALLBACK(realize_cb), data); |
|
26676
8cd0a1fc0f14
Remove old GtkPlug and GtkSocket code.
Michael Ruprecht <maiku@pidgin.im>
parents:
26639
diff
changeset
|
949 | gtk_container_add(GTK_CONTAINER(aspect), remote_video); |
|
26284
5d36c99b8f2d
Make the sinks better default sizes and display them immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26283
diff
changeset
|
950 | gtk_widget_set_size_request (GTK_WIDGET(remote_video), 320, 240); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
951 | g_signal_connect(G_OBJECT(remote_video), "destroy", |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
952 | G_CALLBACK(destroy_parent_widget_cb), aspect); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
953 | |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
954 | gtk_widget_show(remote_video); |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
955 | gtk_widget_show(aspect); |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
956 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
957 | pidgin_media_insert_widget(gtkmedia, remote_video, |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
958 | data->session_id, data->participant); |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
959 | } |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
960 | |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
961 | if (type & PURPLE_MEDIA_SEND_VIDEO && !gtkmedia->priv->local_video) { |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
962 | PidginMediaRealizeData *data; |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
963 | GtkWidget *aspect; |
|
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
964 | GtkWidget *local_video; |
|
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
965 | |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
966 | aspect = gtk_aspect_frame_new(NULL, 0, 0, 4.0/3.0, TRUE); |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
967 | gtk_frame_set_shadow_type(GTK_FRAME(aspect), GTK_SHADOW_IN); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
968 | gtk_box_pack_start(GTK_BOX(send_widget), aspect, FALSE, TRUE, 0); |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
969 | |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
970 | data = g_new0(PidginMediaRealizeData, 1); |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
971 | data->gtkmedia = gtkmedia; |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
972 | data->session_id = g_strdup(sid); |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
973 | data->participant = NULL; |
|
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
974 | |
|
37589
e498a88e7c00
Factor out video widget creation into pidgin_create_video_widget()
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37424
diff
changeset
|
975 | local_video = pidgin_create_video_widget(); |
|
26177
35f25555116f
Wait for local video frame to be realized before starting local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
26158
diff
changeset
|
976 | g_signal_connect(G_OBJECT(local_video), "realize", |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
977 | G_CALLBACK(realize_cb), data); |
|
26676
8cd0a1fc0f14
Remove old GtkPlug and GtkSocket code.
Michael Ruprecht <maiku@pidgin.im>
parents:
26639
diff
changeset
|
978 | gtk_container_add(GTK_CONTAINER(aspect), local_video); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
979 | gtk_widget_set_size_request (GTK_WIDGET(local_video), 80, 60); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
980 | g_signal_connect(G_OBJECT(local_video), "destroy", |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
981 | G_CALLBACK(destroy_parent_widget_cb), aspect); |
|
26177
35f25555116f
Wait for local video frame to be realized before starting local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
26158
diff
changeset
|
982 | |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
983 | gtk_widget_show(local_video); |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
984 | gtk_widget_show(aspect); |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
985 | |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
986 | gtkmedia->priv->pause = |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
987 | gtk_toggle_button_new_with_mnemonic(_("_Pause")); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
988 | gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->pause, |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
989 | FALSE, FALSE, 0); |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
990 | gtk_widget_show(gtkmedia->priv->pause); |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
991 | g_signal_connect(gtkmedia->priv->pause, "toggled", |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
992 | G_CALLBACK(pidgin_media_pause_toggled), |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
993 | gtkmedia); |
|
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
994 | |
|
23736
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
995 | gtkmedia->priv->local_video = local_video; |
|
e77595cce169
Preliminary video embedded in the conversation window. It's still kind of buggy.
Michael Ruprecht <maiku@pidgin.im>
parents:
23729
diff
changeset
|
996 | } |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
997 | if (type & PURPLE_MEDIA_RECV_AUDIO) { |
|
26622
b3cd53038449
Move volume levels for media to the media window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26619
diff
changeset
|
998 | gtk_box_pack_end(GTK_BOX(recv_widget), |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
999 | pidgin_media_add_audio_widget(gtkmedia, |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1000 | PURPLE_MEDIA_RECV_AUDIO, sid), FALSE, FALSE, 0); |
|
23738
2188a1d89a3a
Move the audio progress bar widgets to be beside the video displays.
Michael Ruprecht <maiku@pidgin.im>
parents:
23737
diff
changeset
|
1001 | } |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1002 | |
|
26270
c92c7e4eb004
Create the media srcs inside PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26269
diff
changeset
|
1003 | if (type & PURPLE_MEDIA_SEND_AUDIO) { |
|
26624
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
1004 | gtkmedia->priv->mute = |
|
32056
5ecbc7cf4ee1
Mark the "hold" and "mute" menu items for translation in the media dialog.
Mark Doliner <markdoliner@pidgin.im>
parents:
32055
diff
changeset
|
1005 | gtk_toggle_button_new_with_mnemonic(_("_Mute")); |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1006 | gtk_box_pack_end(GTK_BOX(button_widget), gtkmedia->priv->mute, |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1007 | FALSE, FALSE, 0); |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1008 | gtk_widget_show(gtkmedia->priv->mute); |
|
26624
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
1009 | g_signal_connect(gtkmedia->priv->mute, "toggled", |
|
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
1010 | G_CALLBACK(pidgin_media_mute_toggled), |
|
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
1011 | gtkmedia); |
|
d8be4ebac4f0
Improve the padding around the mute button.
Michael Ruprecht <maiku@pidgin.im>
parents:
26623
diff
changeset
|
1012 | |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1013 | gtk_box_pack_end(GTK_BOX(recv_widget), |
|
26728
e6d5b2333b1d
Use GtkVolumeButtons for audio if it's available.
Michael Ruprecht <maiku@pidgin.im>
parents:
26676
diff
changeset
|
1014 | pidgin_media_add_audio_widget(gtkmedia, |
|
36312
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
1015 | PURPLE_MEDIA_SEND_AUDIO, sid), FALSE, FALSE, 0); |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
1016 | |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
1017 | gtk_box_pack_end(GTK_BOX(recv_widget), |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
1018 | pidgin_media_add_dtmf_widget(gtkmedia, |
|
6b4576edf2a6
Add out-of-band DTMF support and dialpad to use it
David Woodhouse <David.Woodhouse@intel.com>
parents:
32056
diff
changeset
|
1019 | PURPLE_MEDIA_SEND_AUDIO, sid), FALSE, FALSE, 0); |
|
26113
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
1020 | } |
|
ad871f934f18
Decouple stream direction. Allows send only or recv only streams.
Michael Ruprecht <maiku@pidgin.im>
parents:
26108
diff
changeset
|
1021 | |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1022 | if (type & PURPLE_MEDIA_AUDIO && |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1023 | gtkmedia->priv->level_handler_id == 0) { |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1024 | gtkmedia->priv->level_handler_id = g_signal_connect( |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1025 | media, "level", G_CALLBACK(level_message_cb), |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1026 | gtkmedia); |
|
26259
0983517fc75f
Wait to create the sinks until the frames are ready.
Michael Ruprecht <maiku@pidgin.im>
parents:
26255
diff
changeset
|
1027 | } |
|
26151
218a4f61cf0d
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1028 | |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
1029 | if (send_widget != NULL) |
|
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
1030 | gtkmedia->priv->send_widget = send_widget; |
|
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
1031 | if (recv_widget != NULL) |
|
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
1032 | gtkmedia->priv->recv_widget = recv_widget; |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1033 | if (button_widget != NULL) { |
|
28133
4b84b16a01af
Add pause capability for local video.
Michael Ruprecht <maiku@pidgin.im>
parents:
28126
diff
changeset
|
1034 | gtkmedia->priv->button_widget = button_widget; |
|
30481
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1035 | gtk_widget_show(GTK_WIDGET(button_widget)); |
|
97ccb2147ce3
pidgin: Re-arrange media window. Layout remote and local video side-by-side.
Marcus Lundblad <malu@pidgin.im>
parents:
28981
diff
changeset
|
1036 | } |
|
26151
218a4f61cf0d
Prepare vv GUI earlier and create sinks when src-pad-added is triggered.
Michael Ruprecht <maiku@pidgin.im>
parents:
26143
diff
changeset
|
1037 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26512
diff
changeset
|
1038 | if (purple_media_is_initiator(media, sid, NULL) == FALSE) { |
|
26512
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
1039 | if (gtkmedia->priv->timeout_id != 0) |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
1040 | g_source_remove(gtkmedia->priv->timeout_id); |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
1041 | gtkmedia->priv->request_type |= type; |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
1042 | gtkmedia->priv->timeout_id = g_timeout_add(500, |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
1043 | (GSourceFunc)pidgin_request_timeout_cb, |
|
0a10f7f30fd6
Display which type of media session is being requested.
Michael Ruprecht <maiku@pidgin.im>
parents:
26510
diff
changeset
|
1044 | gtkmedia); |
|
23737
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
1045 | } |
|
26284
5d36c99b8f2d
Make the sinks better default sizes and display them immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26283
diff
changeset
|
1046 | |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1047 | /* set the window icon according to the type */ |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1048 | if (type & PURPLE_MEDIA_VIDEO) { |
| 28421 | 1049 | icon = gtk_widget_render_icon(GTK_WIDGET(gtkmedia), |
| 1050 | PIDGIN_STOCK_TOOLBAR_VIDEO_CALL, | |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1051 | gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_LARGE), NULL); |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1052 | } else if (type & PURPLE_MEDIA_AUDIO) { |
| 28421 | 1053 | icon = gtk_widget_render_icon(GTK_WIDGET(gtkmedia), |
| 1054 | PIDGIN_STOCK_TOOLBAR_AUDIO_CALL, | |
|
28398
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1055 | gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_LARGE), NULL); |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1056 | } |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1057 | |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1058 | if (icon) { |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1059 | gtk_window_set_icon(GTK_WINDOW(gtkmedia), icon); |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1060 | g_object_unref(icon); |
|
acc1ddff586b
Set the icon of media corresponding to the media type
Marcus Lundblad <malu@pidgin.im>
parents:
28385
diff
changeset
|
1061 | } |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
1062 | |
|
26284
5d36c99b8f2d
Make the sinks better default sizes and display them immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26283
diff
changeset
|
1063 | gtk_widget_show(gtkmedia->priv->display); |
|
23737
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
1064 | } |
|
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
1065 | |
|
91165a8fcbd9
Notify the user which type of media session the remote user wants to initiate.
Michael Ruprecht <maiku@pidgin.im>
parents:
23736
diff
changeset
|
1066 | static void |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26444
diff
changeset
|
1067 | pidgin_media_state_changed_cb(PurpleMedia *media, PurpleMediaState state, |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1068 | gchar *sid, gchar *name, PidginMedia *gtkmedia) |
|
22400
3762d64b1f58
Show a message when the remote end terminates a session.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22072
diff
changeset
|
1069 | { |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26444
diff
changeset
|
1070 | purple_debug_info("gtkmedia", "state: %d sid: %s name: %s\n", |
|
27974
2021706e911d
Fixes for some potential printf("%s", NULL) type of problems from Maiku
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27972
diff
changeset
|
1071 | state, sid ? sid : "(null)", name ? name : "(null)"); |
|
31619
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1072 | if (state == PURPLE_MEDIA_STATE_END) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1073 | if (sid != NULL && name != NULL) { |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1074 | pidgin_media_remove_widget(gtkmedia, sid, name); |
|
8eeb5fc86dcf
Adapt the Pidgin UI to correctly handle dynamic addition and removal of streams
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31557
diff
changeset
|
1075 | } else if (sid == NULL && name == NULL) { |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1076 | pidgin_media_emit_message(gtkmedia, |
|
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1077 | _("The call has been terminated.")); |
|
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1078 | gtk_widget_destroy(GTK_WIDGET(gtkmedia)); |
|
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1079 | } |
|
26449
9e381dc6ed24
Rename state-changed enum and values.
Michael Ruprecht <maiku@pidgin.im>
parents:
26444
diff
changeset
|
1080 | } else if (state == PURPLE_MEDIA_STATE_NEW && |
|
26242
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
1081 | sid != NULL && name != NULL) { |
|
4e3c5480ef0f
Replace the ready signal in PidginMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26241
diff
changeset
|
1082 | pidgin_media_ready_cb(media, gtkmedia, sid); |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1083 | } |
| 19886 | 1084 | } |
| 1085 | ||
| 1086 | static void | |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1087 | pidgin_media_stream_info_cb(PurpleMedia *media, PurpleMediaInfoType type, |
|
26496
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26494
diff
changeset
|
1088 | gchar *sid, gchar *name, gboolean local, |
|
11e1e5221460
Create purple_media_stream_info. Add local parameter to stream-info signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26494
diff
changeset
|
1089 | PidginMedia *gtkmedia) |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1090 | { |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1091 | if (type == PURPLE_MEDIA_INFO_REJECT) { |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1092 | pidgin_media_emit_message(gtkmedia, |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1093 | _("You have rejected the call.")); |
|
28111
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
1094 | } else if (type == PURPLE_MEDIA_INFO_ACCEPT) { |
|
28385
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
1095 | if (local == TRUE) |
|
871a31df2174
There's no reason to ask for acceptance if the stream has been accepted. Also,
Michael Ruprecht <maiku@pidgin.im>
parents:
28321
diff
changeset
|
1096 | purple_request_close_with_handle(gtkmedia); |
|
28111
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
1097 | pidgin_media_set_state(gtkmedia, PIDGIN_MEDIA_ACCEPTED); |
|
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
1098 | pidgin_media_emit_message(gtkmedia, _("Call in progress.")); |
|
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
1099 | gtk_statusbar_push(GTK_STATUSBAR(gtkmedia->priv->statusbar), |
|
32695
f86582a6bc5b
Remove a period from a phrase that appears in the status bar of active calls
Mark Doliner <markdoliner@pidgin.im>
parents:
31966
diff
changeset
|
1100 | 0, _("Call in progress")); |
|
28111
61de2e173be9
Remove the "accepted" signal from PurpleMedia as it was redundant.
Michael Ruprecht <maiku@pidgin.im>
parents:
27974
diff
changeset
|
1101 | gtk_widget_show(GTK_WIDGET(gtkmedia)); |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1102 | } |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1103 | } |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1104 | |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1105 | static void |
| 19886 | 1106 | pidgin_media_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
| 1107 | { | |
| 1108 | PidginMedia *media; | |
| 1109 | g_return_if_fail(PIDGIN_IS_MEDIA(object)); | |
|
22400
3762d64b1f58
Show a message when the remote end terminates a session.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22072
diff
changeset
|
1110 | |
| 19886 | 1111 | media = PIDGIN_MEDIA(object); |
| 1112 | switch (prop_id) { | |
| 1113 | case PROP_MEDIA: | |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
1114 | { |
| 19886 | 1115 | if (media->priv->media) |
| 1116 | g_object_unref(media->priv->media); | |
| 1117 | media->priv->media = g_value_get_object(value); | |
| 1118 | g_object_ref(media->priv->media); | |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
1119 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26512
diff
changeset
|
1120 | if (purple_media_is_initiator(media->priv->media, |
|
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26512
diff
changeset
|
1121 | NULL, NULL) == TRUE) |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
1122 | pidgin_media_set_state(media, PIDGIN_MEDIA_WAITING); |
|
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
1123 | else |
|
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
1124 | pidgin_media_set_state(media, PIDGIN_MEDIA_REQUESTED); |
|
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
1125 | |
|
26182
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
1126 | g_signal_connect(G_OBJECT(media->priv->media), "error", |
|
728ad1da9cbc
Add purple_media_error.
Michael Ruprecht <maiku@pidgin.im>
parents:
26177
diff
changeset
|
1127 | G_CALLBACK(pidgin_media_error_cb), media); |
|
26240
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1128 | g_signal_connect(G_OBJECT(media->priv->media), "state-changed", |
|
3bc5338843aa
Convert PidginMedia to use the state-changed signal.
Michael Ruprecht <maiku@pidgin.im>
parents:
26234
diff
changeset
|
1129 | G_CALLBACK(pidgin_media_state_changed_cb), media); |
|
26444
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1130 | g_signal_connect(G_OBJECT(media->priv->media), "stream-info", |
|
55d385e7faad
Use stream-info for reject instead of state-changed.
Michael Ruprecht <maiku@pidgin.im>
parents:
26439
diff
changeset
|
1131 | G_CALLBACK(pidgin_media_stream_info_cb), media); |
| 19886 | 1132 | break; |
|
26241
d4be7f79d6bc
Convert more PidginMedia signals to the newer API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26240
diff
changeset
|
1133 | } |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1134 | case PROP_SCREENNAME: |
|
37424
04cf8cbe44d8
Remove more NULL-checks before free().
Michael McConville <mmcco@mykolab.com>
parents:
37422
diff
changeset
|
1135 | g_free(media->priv->screenname); |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1136 | media->priv->screenname = g_value_dup_string(value); |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1137 | break; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1138 | default: |
| 19886 | 1139 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 1140 | break; | |
| 1141 | } | |
| 1142 | } | |
| 1143 | ||
| 1144 | static void | |
| 1145 | pidgin_media_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) | |
| 1146 | { | |
| 1147 | PidginMedia *media; | |
| 1148 | g_return_if_fail(PIDGIN_IS_MEDIA(object)); | |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1149 | |
| 19886 | 1150 | media = PIDGIN_MEDIA(object); |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1151 | |
| 19886 | 1152 | switch (prop_id) { |
| 1153 | case PROP_MEDIA: | |
| 1154 | g_value_set_object(value, media->priv->media); | |
| 1155 | break; | |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1156 | case PROP_SCREENNAME: |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1157 | g_value_set_string(value, media->priv->screenname); |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1158 | break; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1159 | default: |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1160 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
| 19886 | 1161 | break; |
| 1162 | } | |
| 1163 | } | |
| 1164 | ||
|
26494
829997fe9c23
No reason for this to be public API.
Michael Ruprecht <maiku@pidgin.im>
parents:
26488
diff
changeset
|
1165 | static GtkWidget * |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1166 | pidgin_media_new(PurpleMedia *media, const gchar *screenname) |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1167 | { |
|
23721
15285d082f6c
Refactored PurpleMedia to make creating audio or video sessions virtually identical. Audio, video, and audio/video sessions now work. Also added videotestsrc to the video plugin preference.
Michael Ruprecht <maiku@pidgin.im>
parents:
23704
diff
changeset
|
1168 | PidginMedia *gtkmedia = g_object_new(pidgin_media_get_type(), |
|
26184
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1169 | "media", media, |
|
db732f8c4d29
Remove the screenname attribute from PurpleMedia.
Michael Ruprecht <maiku@pidgin.im>
parents:
26182
diff
changeset
|
1170 | "screenname", screenname, NULL); |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1171 | return GTK_WIDGET(gtkmedia); |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1172 | } |
|
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1173 | |
|
22682
8df904a56d77
Change a few things:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22648
diff
changeset
|
1174 | static void |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1175 | pidgin_media_set_state(PidginMedia *gtkmedia, PidginMediaState state) |
| 19886 | 1176 | { |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22400
diff
changeset
|
1177 | gtkmedia->priv->state = state; |
| 19886 | 1178 | } |
| 1179 | ||
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1180 | static gboolean |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1181 | pidgin_media_new_cb(PurpleMediaManager *manager, PurpleMedia *media, |
|
26746
2a2d45ac9774
Switch media to store accounts rather than connections.
Michael Ruprecht <maiku@pidgin.im>
parents:
26728
diff
changeset
|
1182 | PurpleAccount *account, gchar *screenname, gpointer nul) |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1183 | { |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1184 | PidginMedia *gtkmedia = PIDGIN_MEDIA( |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1185 | pidgin_media_new(media, screenname)); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
1186 | PurpleBuddy *buddy = purple_blist_find_buddy(account, screenname); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
1187 | const gchar *alias = buddy ? |
|
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
1188 | purple_buddy_get_contact_alias(buddy) : screenname; |
|
26275
69951c5ca44f
Use aliases for the media window title and the request window.
Michael Ruprecht <maiku@pidgin.im>
parents:
26273
diff
changeset
|
1189 | gtk_window_set_title(GTK_WINDOW(gtkmedia), alias); |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1190 | |
|
26514
058053cffc0e
Add purple_media_is_initiator.
Michael Ruprecht <maiku@pidgin.im>
parents:
26512
diff
changeset
|
1191 | if (purple_media_is_initiator(media, NULL, NULL) == TRUE) |
|
26273
34eb5919488a
Use request API for a media invitation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26272
diff
changeset
|
1192 | gtk_widget_show(GTK_WIDGET(gtkmedia)); |
|
34eb5919488a
Use request API for a media invitation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26272
diff
changeset
|
1193 | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1194 | return TRUE; |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1195 | } |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1196 | |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1197 | #ifndef USE_GSTREAMER |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1198 | |
|
37648
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1199 | static void |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1200 | videosink_disable_last_sample(GstElement *sink) |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1201 | { |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1202 | GObjectClass *klass = G_OBJECT_GET_CLASS(sink); |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1203 | |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1204 | if (g_object_class_find_property(klass, "enable-last-sample")) { |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1205 | g_object_set(sink, "enable-last-sample", FALSE, NULL); |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1206 | } |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1207 | } |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1208 | |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1209 | static void |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1210 | autovideosink_child_added_cb (GstChildProxy *child_proxy, GObject *object, |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1211 | gchar *name, gpointer user_data) |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1212 | { |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1213 | videosink_disable_last_sample(GST_ELEMENT(object)); |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1214 | } |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1215 | |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1216 | static GstElement * |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1217 | create_vv_element(const gchar *plugin, const gchar *device) |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1218 | { |
|
33958
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1219 | GstElement *element, *source; |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1220 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1221 | g_return_val_if_fail(plugin != NULL, NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1222 | g_return_val_if_fail(plugin[0] != '\0', NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1223 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1224 | if (device != NULL && device[0] == '\0') |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1225 | device = NULL; |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1226 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1227 | if (g_strcmp0(plugin, "videodisabledsrc") == 0) { |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1228 | element = gst_element_factory_make("videotestsrc", NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1229 | g_object_set(G_OBJECT(element), "is-live", TRUE, NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1230 | if (g_strcmp0(device, "snow") == 0) { |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1231 | /* GST_VIDEO_TEST_SRC_SNOW */ |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1232 | g_object_set(G_OBJECT(element), "pattern", 1, NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1233 | } else { |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1234 | /* GST_VIDEO_TEST_SRC_BLACK */ |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1235 | g_object_set(G_OBJECT(element), "pattern", 2, NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1236 | } |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1237 | return element; |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1238 | } |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1239 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1240 | if (g_strcmp0(plugin, "ksvideosrc") == 0) { |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1241 | GstElement *ksv_bin, *ksv_src, *ksv_filter; |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1242 | GstPad *ksv_pad, *ksv_ghost; |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1243 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1244 | ksv_bin = gst_bin_new("ksvideofilteredsrc"); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1245 | ksv_src = gst_element_factory_make("ksvideosrc", NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1246 | ksv_filter = gst_element_factory_make("ffmpegcolorspace", NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1247 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1248 | gst_bin_add_many(GST_BIN(ksv_bin), ksv_src, ksv_filter, NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1249 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1250 | gst_element_link(ksv_src, ksv_filter); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1251 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1252 | ksv_pad = gst_element_get_static_pad(ksv_filter, "src"); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1253 | ksv_ghost = gst_ghost_pad_new("src", ksv_pad); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1254 | gst_object_unref(ksv_pad); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1255 | gst_element_add_pad(ksv_bin, ksv_ghost); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1256 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1257 | element = ksv_bin; |
|
33958
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1258 | source = ksv_src; |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1259 | } |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1260 | else |
|
33958
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1261 | element = source = gst_element_factory_make(plugin, NULL); |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1262 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1263 | if (element == NULL) |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1264 | return NULL; |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1265 | |
|
33958
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1266 | if (device != NULL) { |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1267 | GObjectClass *klass = G_OBJECT_GET_CLASS(source); |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1268 | if (g_object_class_find_property(klass, "device")) |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1269 | g_object_set(G_OBJECT(source), "device", device, NULL); |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1270 | else if (g_object_class_find_property(klass, "device-index")) |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1271 | g_object_set(G_OBJECT(source), "device-index", |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1272 | g_ascii_strtoull(device, NULL, 10), NULL); |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1273 | else |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1274 | purple_debug_warning("gtkmedia", "No possibility to " |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1275 | "set device\n"); |
|
d76b1d242829
VV: add another method of probing devices (by device-name), fix memleak
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33957
diff
changeset
|
1276 | } |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1277 | |
|
37648
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1278 | if (g_strcmp0(plugin, "autovideosink") == 0) { |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1279 | g_signal_connect(source, "child-added", |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1280 | G_CALLBACK(autovideosink_child_added_cb), NULL); |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1281 | } else { |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1282 | videosink_disable_last_sample(source); |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1283 | } |
|
13807c514810
media: don't keep last sample reference on sinks
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37589
diff
changeset
|
1284 | |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1285 | if (g_strcmp0(plugin, "videotestsrc") == 0) |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1286 | g_object_set(G_OBJECT(element), "is-live", TRUE, NULL); |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1287 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1288 | return element; |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1289 | } |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1290 | |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1291 | static GstElement * |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1292 | create_configured_vv_element(const gchar *type, const gchar *dir) |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1293 | { |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1294 | gchar *tmp; |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1295 | const gchar *plugin, *device; |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1296 | |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1297 | tmp = g_strdup_printf(PIDGIN_PREFS_ROOT "/vvconfig/%s/%s/plugin", |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1298 | type, dir); |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1299 | plugin = purple_prefs_get_string(tmp); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1300 | g_free(tmp); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1301 | |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1302 | tmp = g_strdup_printf(PIDGIN_PREFS_ROOT "/vvconfig/%s/%s/device", |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1303 | type, dir); |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1304 | device = purple_prefs_get_string(tmp); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1305 | g_free(tmp); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1306 | |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1307 | if (plugin == NULL || plugin[0] == '\0') |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1308 | return NULL; |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1309 | |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1310 | return create_vv_element(plugin, device); |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1311 | } |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1312 | |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1313 | static GstElement * |
|
37880
3f81450a2df5
mediamanager: add info argument to PurpleMediaElementCreateCallback
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37652
diff
changeset
|
1314 | create_default_video_src(PurpleMediaElementInfo *info, PurpleMedia *media, |
|
26522
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26521
diff
changeset
|
1315 | const gchar *session_id, const gchar *participant) |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1316 | { |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1317 | GstElement *sendbin, *src; |
|
26462
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1318 | GstPad *pad; |
|
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1319 | GstPad *ghost; |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1320 | |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1321 | src = create_configured_vv_element("video", "src"); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1322 | |
|
28163
7e41e62cf99f
Handle sources for Windows better.
Michael Ruprecht <maiku@pidgin.im>
parents:
28141
diff
changeset
|
1323 | #ifdef _WIN32 |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1324 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1325 | src = create_vv_element("ksvideosrc", NULL); |
|
28163
7e41e62cf99f
Handle sources for Windows better.
Michael Ruprecht <maiku@pidgin.im>
parents:
28141
diff
changeset
|
1326 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1327 | src = create_vv_element("dshowvideosrc", NULL); |
|
28163
7e41e62cf99f
Handle sources for Windows better.
Michael Ruprecht <maiku@pidgin.im>
parents:
28141
diff
changeset
|
1328 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1329 | src = create_vv_element("autovideosrc", NULL); |
|
32752
8163ce6c42a6
Allow compile of V/V on OSX without X11. Patch by Eion Robb.
Eion Robb <eion@robbmob.com>
parents:
32751
diff
changeset
|
1330 | #elif defined(__APPLE__) |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1331 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1332 | src = create_vv_element("osxvideosrc", NULL); |
|
32752
8163ce6c42a6
Allow compile of V/V on OSX without X11. Patch by Eion Robb.
Eion Robb <eion@robbmob.com>
parents:
32751
diff
changeset
|
1333 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1334 | src = create_vv_element("autovideosrc", NULL); |
|
28163
7e41e62cf99f
Handle sources for Windows better.
Michael Ruprecht <maiku@pidgin.im>
parents:
28141
diff
changeset
|
1335 | #else |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1336 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1337 | src = create_vv_element("gconfvideosrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1338 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1339 | src = create_vv_element("autovideosrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1340 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1341 | src = create_vv_element("v4l2src", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1342 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1343 | src = create_vv_element("v4lsrc", NULL); |
|
28163
7e41e62cf99f
Handle sources for Windows better.
Michael Ruprecht <maiku@pidgin.im>
parents:
28141
diff
changeset
|
1344 | #endif |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1345 | if (src == NULL) |
|
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1346 | src = create_vv_element("videotestsrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1347 | if (src == NULL) { |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1348 | purple_debug_error("gtkmedia", "Unable to find a suitable " |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1349 | "element for the default video source.\n"); |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1350 | return NULL; |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1351 | } |
|
26462
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1352 | |
|
26507
629bdcfe9516
Unique elements ought to be named the same as their id.
Michael Ruprecht <maiku@pidgin.im>
parents:
26504
diff
changeset
|
1353 | sendbin = gst_bin_new("pidgindefaultvideosrc"); |
|
26462
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1354 | |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1355 | gst_bin_add(GST_BIN(sendbin), src); |
|
26462
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1356 | |
|
31311
740a84050c72
Add a GstCapsFilter between every video source and the rest of the pipeline.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31294
diff
changeset
|
1357 | pad = gst_element_get_static_pad(src, "src"); |
|
26462
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1358 | ghost = gst_ghost_pad_new("ghostsrc", pad); |
|
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1359 | gst_object_unref(pad); |
|
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1360 | gst_element_add_pad(sendbin, ghost); |
|
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1361 | |
|
78777290e568
Remove purple_media_video_init_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26457
diff
changeset
|
1362 | return sendbin; |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1363 | } |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1364 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1365 | static GstElement * |
|
37880
3f81450a2df5
mediamanager: add info argument to PurpleMediaElementCreateCallback
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37652
diff
changeset
|
1366 | create_default_video_sink(PurpleMediaElementInfo *info, PurpleMedia *media, |
|
26522
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26521
diff
changeset
|
1367 | const gchar *session_id, const gchar *participant) |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1368 | { |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1369 | GstElement *sink; |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1370 | |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1371 | sink = create_configured_vv_element("video", "sink"); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1372 | |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1373 | if (sink == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1374 | sink = create_vv_element("directdrawsink", NULL); |
|
33948
b6c9e5dd95d1
VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33947
diff
changeset
|
1375 | if (sink == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1376 | sink = create_vv_element("gconfvideosink", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1377 | if (sink == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1378 | sink = create_vv_element("autovideosink", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1379 | if (sink == NULL) |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1380 | purple_debug_error("gtkmedia", "Unable to find a suitable " |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1381 | "element for the default video sink.\n"); |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1382 | return sink; |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1383 | } |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1384 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1385 | static GstElement * |
|
37880
3f81450a2df5
mediamanager: add info argument to PurpleMediaElementCreateCallback
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37652
diff
changeset
|
1386 | create_default_audio_src(PurpleMediaElementInfo *info, PurpleMedia *media, |
|
26522
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26521
diff
changeset
|
1387 | const gchar *session_id, const gchar *participant) |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1388 | { |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1389 | GstElement *src; |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1390 | |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1391 | src = create_configured_vv_element("audio", "src"); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1392 | |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1393 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1394 | src = create_vv_element("directsoundsrc", NULL); |
|
33948
b6c9e5dd95d1
VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33947
diff
changeset
|
1395 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1396 | src = create_vv_element("gconfaudiosrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1397 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1398 | src = create_vv_element("autoaudiosrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1399 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1400 | src = create_vv_element("alsasrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1401 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1402 | src = create_vv_element("osssrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1403 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1404 | src = create_vv_element("dshowaudiosrc", NULL); |
|
32752
8163ce6c42a6
Allow compile of V/V on OSX without X11. Patch by Eion Robb.
Eion Robb <eion@robbmob.com>
parents:
32751
diff
changeset
|
1405 | if (src == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1406 | src = create_vv_element("osxaudiosrc", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1407 | if (src == NULL) { |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1408 | purple_debug_error("gtkmedia", "Unable to find a suitable " |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1409 | "element for the default audio source.\n"); |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1410 | return NULL; |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1411 | } |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1412 | gst_element_set_name(src, "pidgindefaultaudiosrc"); |
|
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1413 | return src; |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1414 | } |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1415 | |
|
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1416 | static GstElement * |
|
37880
3f81450a2df5
mediamanager: add info argument to PurpleMediaElementCreateCallback
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37652
diff
changeset
|
1417 | create_default_audio_sink(PurpleMediaElementInfo *info, PurpleMedia *media, |
|
26522
44401eba59a5
Give more information to element creation functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
26521
diff
changeset
|
1418 | const gchar *session_id, const gchar *participant) |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1419 | { |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1420 | GstElement *sink; |
|
33947
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1421 | |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1422 | sink = create_configured_vv_element("audio", "sink"); |
|
7c0420c7ac81
VV: make prefs actually working; add <Disabled> video source
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33946
diff
changeset
|
1423 | |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1424 | if (sink == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1425 | sink = create_vv_element("directsoundsink", NULL); |
|
33948
b6c9e5dd95d1
VV: win32 support. No runtimes dependencies in dep-bundle yet. Refs #11075
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33947
diff
changeset
|
1426 | if (sink == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1427 | sink = create_vv_element("gconfaudiosink", NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1428 | if (sink == NULL) |
|
33957
0a4c13fa94ba
VV: some cleanup, add ffmpeg filter to ksvideosrc
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33948
diff
changeset
|
1429 | sink = create_vv_element("autoaudiosink",NULL); |
|
26627
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1430 | if (sink == NULL) { |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1431 | purple_debug_error("gtkmedia", "Unable to find a suitable " |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1432 | "element for the default audio sink.\n"); |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1433 | return NULL; |
|
7c86ad54e2cf
Use better choices for default elements and have fallbacks.
Michael Ruprecht <maiku@pidgin.im>
parents:
26624
diff
changeset
|
1434 | } |
|
28125
2e47531fc140
Unlink the local audio volume and mute between sessions.
Michael Ruprecht <maiku@pidgin.im>
parents:
28111
diff
changeset
|
1435 | return sink; |
|
26289
1d832b48fa58
Add active elements to PurpleMediaManager. These are the elements that
Michael Ruprecht <maiku@pidgin.im>
parents:
26288
diff
changeset
|
1436 | } |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1437 | #endif /* USE_GSTREAMER */ |
|
26504
55082249a5f9
Fix compiling with --disable-vv.
Michael Ruprecht <maiku@pidgin.im>
parents:
26503
diff
changeset
|
1438 | #endif /* USE_VV */ |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
1439 | |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1440 | void |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1441 | pidgin_medias_init(void) |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1442 | { |
|
26504
55082249a5f9
Fix compiling with --disable-vv.
Michael Ruprecht <maiku@pidgin.im>
parents:
26503
diff
changeset
|
1443 | #ifdef USE_VV |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
1444 | PurpleMediaManager *manager = purple_media_manager_get(); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1445 | PurpleMediaElementInfo *video_src; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1446 | PurpleMediaElementInfo *video_sink; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1447 | PurpleMediaElementInfo *audio_src; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1448 | PurpleMediaElementInfo *audio_sink; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1449 | #ifdef USE_GSTREAMER |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1450 | const char *pref; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1451 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1452 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1453 | PIDGIN_PREFS_ROOT "/vvconfig/video/src/device"); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1454 | video_src = purple_media_manager_get_element_info(manager, pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1455 | if (!video_src) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1456 | pref = "autovideosrc"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1457 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1458 | PIDGIN_PREFS_ROOT "/vvconfig/video/src/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1459 | video_src = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1460 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1461 | } |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1462 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1463 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1464 | PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device"); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1465 | video_sink = purple_media_manager_get_element_info(manager, pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1466 | if (!video_sink) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1467 | pref = "autovideosink"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1468 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1469 | PIDGIN_PREFS_ROOT "/vvconfig/video/sink/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1470 | video_sink = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1471 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1472 | } |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1473 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1474 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1475 | PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device"); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1476 | audio_src = purple_media_manager_get_element_info(manager, pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1477 | if (!audio_src) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1478 | pref = "autoaudiosrc"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1479 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1480 | PIDGIN_PREFS_ROOT "/vvconfig/audio/src/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1481 | audio_src = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1482 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1483 | } |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1484 | |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1485 | pref = purple_prefs_get_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1486 | PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device"); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1487 | audio_sink = purple_media_manager_get_element_info(manager, pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1488 | if (!audio_sink) { |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1489 | pref = "autoaudiosink"; |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1490 | purple_prefs_set_string( |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1491 | PIDGIN_PREFS_ROOT "/vvconfig/audio/sink/device", pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1492 | audio_sink = purple_media_manager_get_element_info(manager, |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1493 | pref); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1494 | } |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1495 | #else |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1496 | video_src = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1497 | "id", "pidgindefaultvideosrc", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1498 | "name", "Pidgin Default Video Source", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1499 | "type", PURPLE_MEDIA_ELEMENT_VIDEO |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1500 | | PURPLE_MEDIA_ELEMENT_SRC |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1501 | | PURPLE_MEDIA_ELEMENT_ONE_SRC |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1502 | | PURPLE_MEDIA_ELEMENT_UNIQUE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1503 | "create-cb", create_default_video_src, NULL); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1504 | video_sink = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1505 | "id", "pidgindefaultvideosink", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1506 | "name", "Pidgin Default Video Sink", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1507 | "type", PURPLE_MEDIA_ELEMENT_VIDEO |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1508 | | PURPLE_MEDIA_ELEMENT_SINK |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1509 | | PURPLE_MEDIA_ELEMENT_ONE_SINK, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1510 | "create-cb", create_default_video_sink, NULL); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1511 | audio_src = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1512 | "id", "pidgindefaultaudiosrc", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1513 | "name", "Pidgin Default Audio Source", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1514 | "type", PURPLE_MEDIA_ELEMENT_AUDIO |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1515 | | PURPLE_MEDIA_ELEMENT_SRC |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1516 | | PURPLE_MEDIA_ELEMENT_ONE_SRC |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1517 | | PURPLE_MEDIA_ELEMENT_UNIQUE, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1518 | "create-cb", create_default_audio_src, NULL); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1519 | audio_sink = g_object_new(PURPLE_TYPE_MEDIA_ELEMENT_INFO, |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1520 | "id", "pidgindefaultaudiosink", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1521 | "name", "Pidgin Default Audio Sink", |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1522 | "type", PURPLE_MEDIA_ELEMENT_AUDIO |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1523 | | PURPLE_MEDIA_ELEMENT_SINK |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1524 | | PURPLE_MEDIA_ELEMENT_ONE_SINK, |
|
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1525 | "create-cb", create_default_audio_sink, NULL); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1526 | #endif /* USE_GSTREAMER */ |
|
26616
4f58db29d346
Hide and gobjectify PurpleMediaElementInfo.
Michael Ruprecht <maiku@pidgin.im>
parents:
26523
diff
changeset
|
1527 | |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
1528 | g_signal_connect(G_OBJECT(manager), "init-media", |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1529 | G_CALLBACK(pidgin_media_new_cb), NULL); |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
1530 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31151
diff
changeset
|
1531 | purple_media_manager_set_ui_caps(manager, |
|
26521
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1532 | PURPLE_MEDIA_CAPS_AUDIO | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1533 | PURPLE_MEDIA_CAPS_AUDIO_SINGLE_DIRECTION | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1534 | PURPLE_MEDIA_CAPS_VIDEO | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1535 | PURPLE_MEDIA_CAPS_VIDEO_SINGLE_DIRECTION | |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1536 | PURPLE_MEDIA_CAPS_AUDIO_VIDEO); |
|
f7f083e8cd31
Declare which media caps Pidgin and Finch handle.
Michael Ruprecht <maiku@pidgin.im>
parents:
26514
diff
changeset
|
1537 | |
|
26287
c0cdd840a828
Implement functions to register and unregister media elements for use in
Michael Ruprecht <maiku@pidgin.im>
parents:
26285
diff
changeset
|
1538 | purple_debug_info("gtkmedia", "Registering media element types\n"); |
|
37885
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1539 | purple_media_manager_set_active_element(manager, video_src); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1540 | purple_media_manager_set_active_element(manager, video_sink); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1541 | purple_media_manager_set_active_element(manager, audio_src); |
|
f12d4064eeae
pidgin/finch: use GStreamer-provided VV elements
Jakub Adam <jakub.adam@ktknet.cz>
parents:
37880
diff
changeset
|
1542 | purple_media_manager_set_active_element(manager, audio_sink); |
|
26504
55082249a5f9
Fix compiling with --disable-vv.
Michael Ruprecht <maiku@pidgin.im>
parents:
26503
diff
changeset
|
1543 | #endif |
|
26269
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1544 | } |
|
cacc598079e4
Separate PidginMedia from PidginConversation.
Michael Ruprecht <maiku@pidgin.im>
parents:
26267
diff
changeset
|
1545 |