aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-07-05 19:30:53 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-07-05 23:07:04 +0800
commita0c74363c0617abaa5522c2e0ffeb0a9372349d1 (patch)
tree40e9b04c34243b995bc88806053d01c90f153251 /src
parentab952e9d0b189663c0b723e2dfcc3f50ec19b98a (diff)
downloadgsoc2013-empathy-a0c74363c0617abaa5522c2e0ffeb0a9372349d1.tar
gsoc2013-empathy-a0c74363c0617abaa5522c2e0ffeb0a9372349d1.tar.gz
gsoc2013-empathy-a0c74363c0617abaa5522c2e0ffeb0a9372349d1.tar.bz2
gsoc2013-empathy-a0c74363c0617abaa5522c2e0ffeb0a9372349d1.tar.lz
gsoc2013-empathy-a0c74363c0617abaa5522c2e0ffeb0a9372349d1.tar.xz
gsoc2013-empathy-a0c74363c0617abaa5522c2e0ffeb0a9372349d1.tar.zst
gsoc2013-empathy-a0c74363c0617abaa5522c2e0ffeb0a9372349d1.zip
Call: flip video preview horizontally
https://bugzilla.gnome.org/show_bug.cgi?id=639353
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c6
-rw-r--r--src/empathy-streamed-media-window.c6
-rw-r--r--src/empathy-video-widget.c30
3 files changed, 37 insertions, 5 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 3dbac9e44..5e8db3e5b 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -708,7 +708,11 @@ create_video_preview (EmpathyCallWindow *self)
priv->video_preview = empathy_video_widget_new_with_size (bus,
SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGTH);
- g_object_set (priv->video_preview, "sync", FALSE, "async", TRUE, NULL);
+ g_object_set (priv->video_preview,
+ "sync", FALSE,
+ "async", TRUE,
+ "flip-video", TRUE,
+ NULL);
gtk_box_pack_start (GTK_BOX (priv->self_user_output_hbox),
priv->video_preview, TRUE, TRUE, 0);
diff --git a/src/empathy-streamed-media-window.c b/src/empathy-streamed-media-window.c
index e93281022..0e70dd920 100644
--- a/src/empathy-streamed-media-window.c
+++ b/src/empathy-streamed-media-window.c
@@ -721,7 +721,11 @@ create_video_preview (EmpathyStreamedMediaWindow *self)
priv->video_preview = empathy_video_widget_new_with_size (bus,
SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGTH);
- g_object_set (priv->video_preview, "sync", FALSE, "async", TRUE, NULL);
+ g_object_set (priv->video_preview,
+ "sync", FALSE,
+ "async", TRUE,
+ "flip-video", TRUE,
+ NULL);
gtk_box_pack_start (GTK_BOX (priv->self_user_output_hbox),
priv->video_preview, TRUE, TRUE, 0);
diff --git a/src/empathy-video-widget.c b/src/empathy-video-widget.c
index b4b39ffdb..492e192fa 100644
--- a/src/empathy-video-widget.c
+++ b/src/empathy-video-widget.c
@@ -55,6 +55,7 @@ enum {
PROP_MIN_HEIGHT,
PROP_SYNC,
PROP_ASYNC,
+ PROP_FLIP_VIDEO,
};
/* private structure */
@@ -67,11 +68,13 @@ struct _EmpathyVideoWidgetPriv
GstElement *videosink;
GstPad *sink_pad;
GstElement *overlay;
+ GstElement *flip;
FsElementAddedNotifier *notifier;
gint min_width;
gint min_height;
gboolean sync;
gboolean async;
+ gboolean flip_video;
GMutex *lock;
};
@@ -138,14 +141,20 @@ empathy_video_widget_constructed (GObject *object)
g_object_set (colorspace, "qos", FALSE, NULL);
+ priv->flip = gst_element_factory_make ("videoflip", NULL);
+ g_assert (priv->flip != NULL);
+
gst_bin_add_many (GST_BIN (priv->videosink), colorspace, videoscale,
- sink, NULL);
+ priv->flip, sink, NULL);
if (!gst_element_link (colorspace, videoscale))
g_error ("Failed to link ffmpegcolorspace and videoscale");
- if (!gst_element_link (videoscale, sink))
- g_error ("Failed to link videoscale and gconfvideosink");
+ if (!gst_element_link (videoscale, priv->flip))
+ g_error ("Failed to link videoscale and videoflip");
+
+ if (!gst_element_link (priv->flip, sink))
+ g_error ("Failed to link videoflip and gconfvideosink");
pad = gst_element_get_static_pad (colorspace, "sink");
g_assert (pad != NULL);
@@ -203,6 +212,11 @@ empathy_video_widget_set_property (GObject *object,
empathy_video_widget_element_set_sink_properties (
EMPATHY_VIDEO_WIDGET (object));
break;
+ case PROP_FLIP_VIDEO:
+ priv->flip_video = g_value_get_boolean (value);
+ gst_util_set_object_arg (G_OBJECT (priv->flip), "method",
+ priv->flip_video ? "horizontal-flip" : "none");
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -234,6 +248,9 @@ empathy_video_widget_get_property (GObject *object,
case PROP_ASYNC:
g_value_set_boolean (value, priv->async);
break;
+ case PROP_FLIP_VIDEO:
+ g_value_set_boolean (value, priv->flip_video);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -301,6 +318,13 @@ empathy_video_widget_class_init (
TRUE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_ASYNC, param_spec);
+
+ param_spec = g_param_spec_boolean ("flip-video",
+ "flip video",
+ "Whether the video should be flipped horizontally or not",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_FLIP_VIDEO, param_spec);
}
void