gl/download: use GstObject's lock instead of out own

This commit is contained in:
Matthew Waters 2014-05-29 16:22:52 +10:00 committed by Tim-Philipp Müller
parent a147b2258b
commit 82910401c8
2 changed files with 5 additions and 13 deletions

View file

@ -90,8 +90,6 @@ gst_gl_download_init (GstGLDownload * download)
download->priv = GST_GL_DOWNLOAD_GET_PRIVATE (download); download->priv = GST_GL_DOWNLOAD_GET_PRIVATE (download);
g_mutex_init (&download->lock);
gst_video_info_init (&download->info); gst_video_info_init (&download->info);
} }
@ -133,8 +131,6 @@ gst_gl_download_finalize (GObject * object)
download->context = NULL; download->context = NULL;
} }
g_mutex_clear (&download->lock);
G_OBJECT_CLASS (gst_gl_download_parent_class)->finalize (object); G_OBJECT_CLASS (gst_gl_download_parent_class)->finalize (object);
} }
@ -169,10 +165,10 @@ gst_gl_download_set_format (GstGLDownload * download, GstVideoInfo * out_info)
g_return_if_fail (GST_VIDEO_INFO_FORMAT (out_info) != g_return_if_fail (GST_VIDEO_INFO_FORMAT (out_info) !=
GST_VIDEO_FORMAT_ENCODED); GST_VIDEO_FORMAT_ENCODED);
g_mutex_lock (&download->lock); GST_OBJECT_LOCK (download);
if (gst_video_info_is_equal (&download->info, out_info)) { if (gst_video_info_is_equal (&download->info, out_info)) {
g_mutex_unlock (&download->lock); GST_OBJECT_UNLOCK (download);
return; return;
} }
@ -180,7 +176,7 @@ gst_gl_download_set_format (GstGLDownload * download, GstVideoInfo * out_info)
download->initted = FALSE; download->initted = FALSE;
download->info = *out_info; download->info = *out_info;
g_mutex_unlock (&download->lock); GST_OBJECT_UNLOCK (download);
} }
/** /**
@ -202,12 +198,10 @@ gst_gl_download_perform_with_data (GstGLDownload * download, GLuint texture_id,
g_return_val_if_fail (download != NULL, FALSE); g_return_val_if_fail (download != NULL, FALSE);
g_mutex_lock (&download->lock); GST_OBJECT_LOCK (download);
ret = ret =
_gst_gl_download_perform_with_data_unlocked (download, texture_id, data); _gst_gl_download_perform_with_data_unlocked (download, texture_id, data);
GST_OBJECT_UNLOCK (download);
g_mutex_unlock (&download->lock);
return ret; return ret;
} }

View file

@ -46,8 +46,6 @@ struct _GstGLDownload
/* <private> */ /* <private> */
GstObject parent; GstObject parent;
GMutex lock;
GstGLContext *context; GstGLContext *context;
GstGLColorConvert *convert; GstGLColorConvert *convert;