mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-01 01:33:52 +00:00
gl/upload: use GstObject's lock instead of our own
This commit is contained in:
parent
75c7e5019c
commit
aa102d2660
2 changed files with 8 additions and 20 deletions
|
@ -118,8 +118,6 @@ gst_gl_upload_init (GstGLUpload * upload)
|
||||||
upload->priv->tex_id = 0;
|
upload->priv->tex_id = 0;
|
||||||
|
|
||||||
gst_video_info_set_format (&upload->in_info, GST_VIDEO_FORMAT_ENCODED, 0, 0);
|
gst_video_info_set_format (&upload->in_info, GST_VIDEO_FORMAT_ENCODED, 0, 0);
|
||||||
|
|
||||||
g_mutex_init (&upload->lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,8 +153,6 @@ gst_gl_upload_finalize (GObject * object)
|
||||||
upload->context = NULL;
|
upload->context = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_mutex_clear (&upload->lock);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gst_gl_upload_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gst_gl_upload_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,11 +214,9 @@ _gst_gl_upload_set_format_unlocked (GstGLUpload * upload,
|
||||||
void
|
void
|
||||||
gst_gl_upload_set_format (GstGLUpload * upload, GstVideoInfo * in_info)
|
gst_gl_upload_set_format (GstGLUpload * upload, GstVideoInfo * in_info)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&upload->lock);
|
GST_OBJECT_LOCK (upload);
|
||||||
|
|
||||||
_gst_gl_upload_set_format_unlocked (upload, in_info);
|
_gst_gl_upload_set_format_unlocked (upload, in_info);
|
||||||
|
GST_OBJECT_UNLOCK (upload);
|
||||||
g_mutex_unlock (&upload->lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -236,11 +230,9 @@ gst_gl_upload_get_format (GstGLUpload * upload)
|
||||||
{
|
{
|
||||||
GstVideoInfo *ret;
|
GstVideoInfo *ret;
|
||||||
|
|
||||||
g_mutex_lock (&upload->lock);
|
GST_OBJECT_LOCK (upload);
|
||||||
|
|
||||||
ret = &upload->in_info;
|
ret = &upload->in_info;
|
||||||
|
GST_OBJECT_UNLOCK (upload);
|
||||||
g_mutex_unlock (&upload->lock);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -411,7 +403,7 @@ gst_gl_upload_perform_with_gl_texture_upload_meta (GstGLUpload * upload,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_mutex_lock (&upload->lock);
|
GST_OBJECT_LOCK (upload);
|
||||||
|
|
||||||
upload->priv->meta = meta;
|
upload->priv->meta = meta;
|
||||||
if (!upload->priv->tex_id)
|
if (!upload->priv->tex_id)
|
||||||
|
@ -427,7 +419,7 @@ gst_gl_upload_perform_with_gl_texture_upload_meta (GstGLUpload * upload,
|
||||||
|
|
||||||
ret = upload->priv->result;
|
ret = upload->priv->result;
|
||||||
|
|
||||||
g_mutex_unlock (&upload->lock);
|
GST_OBJECT_UNLOCK (upload);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -451,11 +443,9 @@ gst_gl_upload_perform_with_data (GstGLUpload * upload, GLuint * texture_id,
|
||||||
|
|
||||||
g_return_val_if_fail (upload != NULL, FALSE);
|
g_return_val_if_fail (upload != NULL, FALSE);
|
||||||
|
|
||||||
g_mutex_lock (&upload->lock);
|
GST_OBJECT_LOCK (upload);
|
||||||
|
|
||||||
ret = _gst_gl_upload_perform_with_data_unlocked (upload, texture_id, data);
|
ret = _gst_gl_upload_perform_with_data_unlocked (upload, texture_id, data);
|
||||||
|
GST_OBJECT_UNLOCK (upload);
|
||||||
g_mutex_unlock (&upload->lock);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,6 @@ struct _GstGLUpload
|
||||||
/* <private> */
|
/* <private> */
|
||||||
GstObject parent;
|
GstObject parent;
|
||||||
|
|
||||||
GMutex lock;
|
|
||||||
|
|
||||||
GstGLContext *context;
|
GstGLContext *context;
|
||||||
GstGLColorConvert *convert;
|
GstGLColorConvert *convert;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue