aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-12 23:16:37 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-12 23:39:51 +0800
commit33687760c2eb1d9ddf41092c88aef8ba65108df6 (patch)
tree92584acbd9d2f563b137c5489aa58750711c49ab
parenteaa8e09ab61444d649d88f31c9047f006627b787 (diff)
downloadgsoc2013-empathy-33687760c2eb1d9ddf41092c88aef8ba65108df6.tar
gsoc2013-empathy-33687760c2eb1d9ddf41092c88aef8ba65108df6.tar.gz
gsoc2013-empathy-33687760c2eb1d9ddf41092c88aef8ba65108df6.tar.bz2
gsoc2013-empathy-33687760c2eb1d9ddf41092c88aef8ba65108df6.tar.lz
gsoc2013-empathy-33687760c2eb1d9ddf41092c88aef8ba65108df6.tar.xz
gsoc2013-empathy-33687760c2eb1d9ddf41092c88aef8ba65108df6.tar.zst
gsoc2013-empathy-33687760c2eb1d9ddf41092c88aef8ba65108df6.zip
call-window: display receiving codecs
-rw-r--r--src/empathy-call-window.c74
-rw-r--r--src/empathy-call-window.ui121
2 files changed, 195 insertions, 0 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 9a3783f8a..4856821ca 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -171,6 +171,8 @@ struct _EmpathyCallWindowPriv
GtkWidget *details_vbox;
GtkWidget *vcodec_encoding_label;
GtkWidget *acodec_encoding_label;
+ GtkWidget *vcodec_decoding_label;
+ GtkWidget *acodec_decoding_label;
GstElement *video_input;
GstElement *audio_input;
@@ -1047,6 +1049,8 @@ empathy_call_window_init (EmpathyCallWindow *self)
"details_vbox", &priv->details_vbox,
"vcodec_encoding_label", &priv->vcodec_encoding_label,
"acodec_encoding_label", &priv->acodec_encoding_label,
+ "acodec_decoding_label", &priv->acodec_decoding_label,
+ "vcodec_decoding_label", &priv->vcodec_decoding_label,
NULL);
g_free (filename);
@@ -1384,6 +1388,70 @@ send_video_codec_notify_cb (GObject *object,
}
static void
+update_recv_codec (EmpathyCallWindow *self,
+ gboolean audio)
+{
+ EmpathyCallWindowPriv *priv = GET_PRIV (self);
+ GList *codecs, *l;
+ GtkWidget *widget;
+ gchar *str = NULL;
+
+ if (audio)
+ {
+ codecs = empathy_call_handler_get_recv_audio_codecs (priv->handler);
+ widget = priv->acodec_decoding_label;
+ }
+ else
+ {
+ codecs = empathy_call_handler_get_recv_video_codecs (priv->handler);
+ widget = priv->vcodec_decoding_label;
+ }
+
+ if (codecs == NULL)
+ return;
+
+ for (l = codecs; l != NULL; l = g_list_next (l))
+ {
+ FsCodec *codec = l->data;
+
+ if (str == NULL)
+ {
+ str = g_strdup (codec->encoding_name);
+ }
+ else
+ {
+ gchar *tmp = str;
+
+ str = g_strdup_printf ("%s, %s", tmp, codec->encoding_name);
+ g_free (tmp);
+ }
+ }
+
+ gtk_label_set_text (GTK_LABEL (widget), str);
+ g_free (str);
+}
+
+static void
+recv_audio_codecs_notify_cb (GObject *object,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ EmpathyCallWindow *self = user_data;
+
+ update_recv_codec (self, TRUE);
+}
+
+static void
+recv_video_codecs_notify_cb (GObject *object,
+ GParamSpec *pspec,
+ gpointer user_data)
+{
+ EmpathyCallWindow *self = user_data;
+
+ update_recv_codec (self, FALSE);
+}
+
+static void
empathy_call_window_constructed (GObject *object)
{
EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object);
@@ -1410,11 +1478,17 @@ empathy_call_window_constructed (GObject *object)
update_send_codec (self, TRUE);
update_send_codec (self, FALSE);
+ update_recv_codec (self, TRUE);
+ update_recv_codec (self, FALSE);
tp_g_signal_connect_object (priv->handler, "notify::send-audio-codec",
G_CALLBACK (send_audio_codec_notify_cb), self, 0);
tp_g_signal_connect_object (priv->handler, "notify::send-video-codec",
G_CALLBACK (send_video_codec_notify_cb), self, 0);
+ tp_g_signal_connect_object (priv->handler, "notify::recv-audio-codecs",
+ G_CALLBACK (recv_audio_codecs_notify_cb), self, 0);
+ tp_g_signal_connect_object (priv->handler, "notify::recv-video-codecs",
+ G_CALLBACK (recv_video_codecs_notify_cb), self, 0);
}
static void empathy_call_window_dispose (GObject *object);
diff --git a/src/empathy-call-window.ui b/src/empathy-call-window.ui
index 7916ba1f0..781de76d9 100644
--- a/src/empathy-call-window.ui
+++ b/src/empathy-call-window.ui
@@ -363,6 +363,67 @@
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="vcodec2_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Decoding Codec:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ <attributes>
+ <attribute name="style" value="PANGO_STYLE_ITALIC"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+
+ <child>
+
+ <object class="GtkLabel" id="vcodec_decoding_label">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Unknown</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">expand|shrink|fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+
</object>
</child>
</object>
@@ -496,6 +557,66 @@
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="acodec2_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Decoding Codec:</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ <attributes>
+ <attribute name="style" value="PANGO_STYLE_ITALIC"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkLabel" id="acodec_decoding_label">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Unknown</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">expand|shrink|fill</property>
+ <property name="y_options"/>
+ </packing>
+ </child>
+
</object>
</child>
</object>