mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
[753/906] gldisplay: Sending a message is synchronous, we can allocate the memory on the stack
This commit is contained in:
parent
b2934152ce
commit
b3eef9dd15
1 changed files with 5 additions and 8 deletions
|
@ -102,8 +102,6 @@ _gst_gl_display_thread_run_generic (RunGenericData * data)
|
||||||
GST_TRACE ("running function:%p data:%p", data->func, data->data);
|
GST_TRACE ("running function:%p data:%p", data->func, data->data);
|
||||||
|
|
||||||
data->func (data->display, data->data);
|
data->func (data->display, data->data);
|
||||||
g_object_unref (data->display);
|
|
||||||
g_slice_free (RunGenericData, data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GstGLDisplay *
|
GstGLDisplay *
|
||||||
|
@ -116,19 +114,18 @@ void
|
||||||
gst_gl_display_thread_add (GstGLDisplay * display,
|
gst_gl_display_thread_add (GstGLDisplay * display,
|
||||||
GstGLDisplayThreadFunc func, gpointer data)
|
GstGLDisplayThreadFunc func, gpointer data)
|
||||||
{
|
{
|
||||||
RunGenericData *rdata;
|
RunGenericData rdata;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_GL_DISPLAY (display));
|
g_return_if_fail (GST_IS_GL_DISPLAY (display));
|
||||||
g_return_if_fail (GST_GL_IS_WINDOW (display->window));
|
g_return_if_fail (GST_GL_IS_WINDOW (display->window));
|
||||||
g_return_if_fail (func != NULL);
|
g_return_if_fail (func != NULL);
|
||||||
|
|
||||||
rdata = g_slice_new (RunGenericData);
|
rdata.display = display;
|
||||||
rdata->display = g_object_ref (display);
|
rdata.data = data;
|
||||||
rdata->data = data;
|
rdata.func = func;
|
||||||
rdata->func = func;
|
|
||||||
|
|
||||||
gst_gl_window_send_message (display->window,
|
gst_gl_window_send_message (display->window,
|
||||||
GST_GL_WINDOW_CB (_gst_gl_display_thread_run_generic), rdata);
|
GST_GL_WINDOW_CB (_gst_gl_display_thread_run_generic), &rdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
GstGLAPI
|
GstGLAPI
|
||||||
|
|
Loading…
Reference in a new issue