[gst-cvs] gst-plugins-good: videoflip: Make property access threadsafe

Sebastian Dröge slomo at kemper.freedesktop.org
Thu Apr 29 10:36:23 PDT 2010


Module: gst-plugins-good
Branch: master
Commit: bc2edb97062b18ae5c9864b5b3ed371ae80125f0
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=bc2edb97062b18ae5c9864b5b3ed371ae80125f0

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Sun Apr 18 21:14:11 2010 +0200

videoflip: Make property access threadsafe

---

 gst/videofilter/gstvideoflip.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/gst/videofilter/gstvideoflip.c b/gst/videofilter/gstvideoflip.c
index 81240fb..a697eb7 100644
--- a/gst/videofilter/gstvideoflip.c
+++ b/gst/videofilter/gstvideoflip.c
@@ -670,7 +670,9 @@ gst_video_flip_transform (GstBaseTransform * trans, GstBuffer * in,
       videoflip->from_width, videoflip->from_height, videoflip->to_width,
       videoflip->to_height, video_flip_methods[videoflip->method].value_nick);
 
+  GST_OBJECT_LOCK (videoflip);
   videoflip->process (videoflip, dest, src);
+  GST_OBJECT_UNLOCK (videoflip);
 
   return GST_FLOW_OK;
 
@@ -755,18 +757,22 @@ gst_video_flip_set_property (GObject * object, guint prop_id,
       GstVideoFlipMethod method;
 
       method = g_value_get_enum (value);
+      GST_OBJECT_LOCK (videoflip);
       if (method != videoflip->method) {
         GstBaseTransform *btrans = GST_BASE_TRANSFORM (videoflip);
 
-        gst_base_transform_set_passthrough (btrans,
-            method == GST_VIDEO_FLIP_METHOD_IDENTITY);
-
         GST_DEBUG_OBJECT (videoflip, "Changing method from %s to %s",
             video_flip_methods[videoflip->method].value_nick,
             video_flip_methods[method].value_nick);
 
         videoflip->method = method;
+        GST_OBJECT_UNLOCK (videoflip);
+
+        gst_base_transform_set_passthrough (btrans,
+            method == GST_VIDEO_FLIP_METHOD_IDENTITY);
         gst_base_transform_reconfigure (btrans);
+      } else {
+        GST_OBJECT_UNLOCK (videoflip);
       }
     }
       break;





More information about the Gstreamer-commits mailing list