diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-01-19 11:34:26 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-01-19 11:34:26 +0100 |
commit | 27ee60a27b771aa0bd34d06267e95e41927a61d6 (patch) | |
tree | 15b6d480ad87a3d7b87d8eae5c304b999e7c8369 /gst-libs/gst | |
parent | a0d9ac6bb1fdfebd1211607c319acd53df669663 (diff) | |
download | gstreamer-plugins-bad-27ee60a27b771aa0bd34d06267e95e41927a61d6.tar.gz |
port to new gthread API
Diffstat (limited to 'gst-libs/gst')
-rw-r--r-- | gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c | 16 | ||||
-rw-r--r-- | gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h | 2 | ||||
-rw-r--r-- | gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c | 38 | ||||
-rw-r--r-- | gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h | 4 | ||||
-rw-r--r-- | gst-libs/gst/video/gstbasevideocodec.c | 4 | ||||
-rw-r--r-- | gst-libs/gst/video/gstbasevideocodec.h | 6 |
6 files changed, 35 insertions, 35 deletions
diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c index 98213c9ba..d6ad8d517 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c @@ -181,10 +181,10 @@ gst_base_camera_src_start_capture (GstBaseCameraSrc * src) GST_DEBUG_OBJECT (src, "Starting capture"); - g_mutex_lock (src->capturing_mutex); + g_mutex_lock (&src->capturing_mutex); if (src->capturing) { GST_WARNING_OBJECT (src, "Capturing already ongoing"); - g_mutex_unlock (src->capturing_mutex); + g_mutex_unlock (&src->capturing_mutex); /* post a warning to notify camerabin2 that the capture failed */ GST_ELEMENT_WARNING (src, RESOURCE, BUSY, (NULL), (NULL)); @@ -200,7 +200,7 @@ gst_base_camera_src_start_capture (GstBaseCameraSrc * src) g_object_notify (G_OBJECT (src), "ready-for-capture"); GST_WARNING_OBJECT (src, "Failed to start capture"); } - g_mutex_unlock (src->capturing_mutex); + g_mutex_unlock (&src->capturing_mutex); } static void @@ -210,14 +210,14 @@ gst_base_camera_src_stop_capture (GstBaseCameraSrc * src) g_return_if_fail (klass->stop_capture != NULL); - g_mutex_lock (src->capturing_mutex); + g_mutex_lock (&src->capturing_mutex); if (!src->capturing) { GST_DEBUG_OBJECT (src, "No ongoing capture"); - g_mutex_unlock (src->capturing_mutex); + g_mutex_unlock (&src->capturing_mutex); return; } klass->stop_capture (src); - g_mutex_unlock (src->capturing_mutex); + g_mutex_unlock (&src->capturing_mutex); } void @@ -234,7 +234,7 @@ gst_base_camera_src_dispose (GObject * object) { GstBaseCameraSrc *src = GST_BASE_CAMERA_SRC_CAST (object); - g_mutex_free (src->capturing_mutex); + g_mutex_clear (&src->capturing_mutex); if (src->preview_pipeline) { gst_camerabin_destroy_preview_pipeline (src->preview_pipeline); @@ -542,7 +542,7 @@ gst_base_camera_src_init (GstBaseCameraSrc * self) self->mode = MODE_IMAGE; self->capturing = FALSE; - self->capturing_mutex = g_mutex_new (); + g_mutex_init (&self->capturing_mutex); self->post_preview = DEFAULT_POST_PREVIEW; diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h index 9d63e2d3c..31e077f98 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h @@ -69,7 +69,7 @@ struct _GstBaseCameraSrc GstCameraBinMode mode; gboolean capturing; - GMutex *capturing_mutex; + GMutex capturing_mutex; /* Preview convert pipeline */ GstCaps *preview_caps; diff --git a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c index 41d11e158..426df21cb 100644 --- a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c +++ b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c @@ -68,7 +68,7 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer user_data) data->pipeline = NULL; } - g_cond_signal (data->processing_cond); + g_cond_signal (&data->processing_cond); break; } @@ -101,13 +101,13 @@ gst_camerabin_preview_pipeline_new_sample (GstAppSink * appsink, "This element has no bus, therefore no message sent!"); } - g_mutex_lock (data->processing_lock); + g_mutex_lock (&data->processing_lock); data->processing--; if (data->processing == 0) - g_cond_signal (data->processing_cond); + g_cond_signal (&data->processing_cond); - g_mutex_unlock (data->processing_lock); + g_mutex_unlock (&data->processing_lock); return GST_FLOW_OK; } @@ -195,8 +195,8 @@ gst_camerabin_create_preview_pipeline (GstElement * element, data->filter = filter; data->vscale = vscale; - data->processing_lock = g_mutex_new (); - data->processing_cond = g_cond_new (); + g_mutex_init (&data->processing_lock); + g_cond_init (&data->processing_cond); data->pending_preview_caps = NULL; data->processing = 0; @@ -230,13 +230,13 @@ gst_camerabin_destroy_preview_pipeline (GstCameraBinPreviewPipelineData * { g_return_if_fail (preview != NULL); - if (preview->processing_lock) { - g_mutex_free (preview->processing_lock); - preview->processing_lock = NULL; + if (preview->processing_lock.p) { + g_mutex_clear (&preview->processing_lock); + preview->processing_lock.p = NULL; } - if (preview->processing_cond) { - g_cond_free (preview->processing_cond); - preview->processing_cond = NULL; + if (preview->processing_cond.p) { + g_cond_clear (&preview->processing_cond); + preview->processing_cond.p = NULL; } if (preview->pipeline) { gst_element_set_state (preview->pipeline, GST_STATE_NULL); @@ -263,12 +263,12 @@ gst_camerabin_preview_pipeline_post (GstCameraBinPreviewPipelineData * preview, g_return_val_if_fail (preview->pipeline != NULL, FALSE); g_return_val_if_fail (buffer, FALSE); - g_mutex_lock (preview->processing_lock); + g_mutex_lock (&preview->processing_lock); g_return_val_if_fail (preview->pipeline != NULL, FALSE); if (preview->pending_preview_caps) { if (preview->processing > 0) { - g_cond_wait (preview->processing_cond, preview->processing_lock); + g_cond_wait (&preview->processing_cond, &preview->processing_lock); } _gst_camerabin_preview_set_caps (preview, preview->pending_preview_caps); gst_caps_replace (&preview->pending_preview_caps, NULL); @@ -279,7 +279,7 @@ gst_camerabin_preview_pipeline_post (GstCameraBinPreviewPipelineData * preview, gst_app_src_push_buffer ((GstAppSrc *) preview->appsrc, gst_buffer_ref (buffer)); - g_mutex_unlock (preview->processing_lock); + g_mutex_unlock (&preview->processing_lock); return TRUE; } @@ -321,7 +321,7 @@ gst_camerabin_preview_set_caps (GstCameraBinPreviewPipelineData * preview, { g_return_if_fail (preview != NULL); - g_mutex_lock (preview->processing_lock); + g_mutex_lock (&preview->processing_lock); if (preview->processing == 0) { _gst_camerabin_preview_set_caps (preview, caps); @@ -329,7 +329,7 @@ gst_camerabin_preview_set_caps (GstCameraBinPreviewPipelineData * preview, GST_DEBUG ("Preview pipeline busy, storing new caps as pending"); gst_caps_replace (&preview->pending_preview_caps, caps); } - g_mutex_unlock (preview->processing_lock); + g_mutex_unlock (&preview->processing_lock); } /** @@ -352,7 +352,7 @@ gst_camerabin_preview_set_filter (GstCameraBinPreviewPipelineData * preview, GST_DEBUG ("Preview pipeline setting new filter %p", filter); - g_mutex_lock (preview->processing_lock); + g_mutex_lock (&preview->processing_lock); gst_element_get_state (preview->pipeline, ¤t, NULL, 0); @@ -398,7 +398,7 @@ gst_camerabin_preview_set_filter (GstCameraBinPreviewPipelineData * preview, GST_WARNING ("Cannot change filter when pipeline is running"); ret = FALSE; } - g_mutex_unlock (preview->processing_lock); + g_mutex_unlock (&preview->processing_lock); return ret; } diff --git a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h index eb4a45f33..fba274cbc 100644 --- a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h +++ b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h @@ -42,8 +42,8 @@ typedef struct GstCaps *pending_preview_caps; guint processing; - GMutex *processing_lock; - GCond *processing_cond; + GMutex processing_lock; + GCond processing_cond; } GstCameraBinPreviewPipelineData; diff --git a/gst-libs/gst/video/gstbasevideocodec.c b/gst-libs/gst/video/gstbasevideocodec.c index c545b0786..70d8d12e4 100644 --- a/gst-libs/gst/video/gstbasevideocodec.c +++ b/gst-libs/gst/video/gstbasevideocodec.c @@ -130,7 +130,7 @@ gst_base_video_codec_init (GstBaseVideoCodec * base_video_codec, gst_segment_init (&base_video_codec->segment, GST_FORMAT_TIME); - g_static_rec_mutex_init (&base_video_codec->stream_lock); + g_rec_mutex_init (&base_video_codec->stream_lock); } static void @@ -162,7 +162,7 @@ gst_base_video_codec_finalize (GObject * object) { GstBaseVideoCodec *base_video_codec = GST_BASE_VIDEO_CODEC (object); - g_static_rec_mutex_free (&base_video_codec->stream_lock); + g_rec_mutex_clear (&base_video_codec->stream_lock); G_OBJECT_CLASS (parent_class)->finalize (object); } diff --git a/gst-libs/gst/video/gstbasevideocodec.h b/gst-libs/gst/video/gstbasevideocodec.h index dafd995da..507380670 100644 --- a/gst-libs/gst/video/gstbasevideocodec.h +++ b/gst-libs/gst/video/gstbasevideocodec.h @@ -81,8 +81,8 @@ G_BEGIN_DECLS */ #define GST_BASE_VIDEO_CODEC_FLOW_NEED_DATA GST_FLOW_CUSTOM_SUCCESS -#define GST_BASE_VIDEO_CODEC_STREAM_LOCK(codec) g_static_rec_mutex_lock (&GST_BASE_VIDEO_CODEC (codec)->stream_lock) -#define GST_BASE_VIDEO_CODEC_STREAM_UNLOCK(codec) g_static_rec_mutex_unlock (&GST_BASE_VIDEO_CODEC (codec)->stream_lock) +#define GST_BASE_VIDEO_CODEC_STREAM_LOCK(codec) g_rec_mutex_lock (&GST_BASE_VIDEO_CODEC (codec)->stream_lock) +#define GST_BASE_VIDEO_CODEC_STREAM_UNLOCK(codec) g_rec_mutex_unlock (&GST_BASE_VIDEO_CODEC (codec)->stream_lock) typedef struct _GstVideoState GstVideoState; typedef struct _GstVideoFrameState GstVideoFrameState; @@ -160,7 +160,7 @@ struct _GstBaseVideoCodec /* protects all data processing, i.e. is locked * in the chain function, finish_frame and when * processing serialized events */ - GStaticRecMutex stream_lock; + GRecMutex stream_lock; guint64 system_frame_number; |