[empathy: 5/9] call-window: display receiving codecs
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy: 5/9] call-window: display receiving codecs
- Date: Wed, 14 Jul 2010 09:58:05 +0000 (UTC)
commit 33687760c2eb1d9ddf41092c88aef8ba65108df6
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Mon Jul 12 17:16:37 2010 +0200
call-window: display receiving codecs
src/empathy-call-window.c | 74 +++++++++++++++++++++++++++
src/empathy-call-window.ui | 121 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 195 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 9a3783f..4856821 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 7916ba1..781de76 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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]