[123/906] X Specific: better implementation of the gst_gl_set_window_id

git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@584 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
Julien Isorce 2008-07-12 14:18:47 +00:00 committed by Tim-Philipp Müller
parent a5bf134265
commit 69abbdd760

View file

@ -1926,44 +1926,13 @@ gst_gl_display_del_shader (GstGLDisplay* display, GLhandleARB shader)
void
gst_gl_display_set_window_id (GstGLDisplay* display, gulong winId)
{
static gint y_pos = 0;
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
//used only when glimagesink is connected to a gl flow
//otehrwise it can directly create the gl context using the winId
gst_gl_display_lock (display);
display->winId = winId;
gst_gl_display_post_message (GST_GL_DISPLAY_ACTION_CHANGE_CONTEXT, display);
g_cond_wait (display->cond_change_context, display->mutex);
gst_gl_display_unlock (display);
#else
gst_gl_display_lock (display);
gst_gl_display_post_message (GST_GL_DISPLAY_ACTION_DESTROY_CONTEXT, display);
g_cond_wait (display->cond_destroy_context, display->mutex);
gst_gl_display_unlock (display);
if (g_hash_table_size (gst_gl_display_map) == 0)
{
g_thread_join (gst_gl_display_gl_thread);
g_print ("gl thread joined when setting winId\n");
gst_gl_display_gl_thread = NULL;
g_async_queue_unref (gst_gl_display_messageQueue);
g_hash_table_unref (gst_gl_display_map);
gst_gl_display_map = NULL;
}
//init opengl context
gst_gl_display_create_context (display,
50, y_pos++ * (display->upload_height+50) + 50,
display->upload_width, display->upload_height,
winId,
TRUE);
//init colorspace conversion if needed
gst_gl_display_init_upload (display, display->upload_video_format,
display->upload_width, display->upload_height);
#endif
}