Lines Matching refs:display

96 static guintptr gst_gl_display_default_get_handle (GstGLDisplay * display);
98 display);
121 _unlock_main_thread (GstGLDisplay * display) in _unlock_main_thread() argument
123 g_mutex_unlock (&display->priv->thread_lock); in _unlock_main_thread()
129 _event_thread_main (GstGLDisplay * display) in _event_thread_main() argument
131 g_mutex_lock (&display->priv->thread_lock); in _event_thread_main()
133 display->main_context = g_main_context_new (); in _event_thread_main()
134 display->main_loop = g_main_loop_new (display->main_context, FALSE); in _event_thread_main()
136 g_main_context_invoke (display->main_context, in _event_thread_main()
137 (GSourceFunc) _unlock_main_thread, display); in _event_thread_main()
139 g_cond_broadcast (&display->priv->thread_cond); in _event_thread_main()
141 g_main_loop_run (display->main_loop); in _event_thread_main()
143 g_mutex_lock (&display->priv->thread_lock); in _event_thread_main()
144 g_main_loop_unref (display->main_loop); in _event_thread_main()
145 g_main_context_unref (display->main_context); in _event_thread_main()
147 display->main_loop = NULL; in _event_thread_main()
148 display->main_context = NULL; in _event_thread_main()
150 g_cond_broadcast (&display->priv->thread_cond); in _event_thread_main()
151 g_mutex_unlock (&display->priv->thread_lock); in _event_thread_main()
183 gst_gl_display_init (GstGLDisplay * display) in gst_gl_display_init() argument
185 display->priv = gst_gl_display_get_instance_private (display); in gst_gl_display_init()
187 display->type = GST_GL_DISPLAY_TYPE_ANY; in gst_gl_display_init()
188 display->priv->gl_api = GST_GL_API_ANY; in gst_gl_display_init()
190 g_mutex_init (&display->priv->thread_lock); in gst_gl_display_init()
191 g_cond_init (&display->priv->thread_cond); in gst_gl_display_init()
193 display->priv->event_thread = g_thread_new ("gldisplay-event", in gst_gl_display_init()
194 (GThreadFunc) _event_thread_main, display); in gst_gl_display_init()
196 g_mutex_lock (&display->priv->thread_lock); in gst_gl_display_init()
197 while (!display->main_loop) in gst_gl_display_init()
198 g_cond_wait (&display->priv->thread_cond, &display->priv->thread_lock); in gst_gl_display_init()
199 g_mutex_unlock (&display->priv->thread_lock); in gst_gl_display_init()
201 GST_TRACE ("init %p", display); in gst_gl_display_init()
215 GstGLDisplay *display = GST_GL_DISPLAY (object); in gst_gl_display_dispose() local
217 if (display->main_loop) in gst_gl_display_dispose()
218 g_main_loop_quit (display->main_loop); in gst_gl_display_dispose()
220 if (display->priv->event_thread) { in gst_gl_display_dispose()
223 g_mutex_lock (&display->priv->thread_lock); in gst_gl_display_dispose()
224 while (display->main_loop) in gst_gl_display_dispose()
225 g_cond_wait (&display->priv->thread_cond, &display->priv->thread_lock); in gst_gl_display_dispose()
226 g_mutex_unlock (&display->priv->thread_lock); in gst_gl_display_dispose()
227 g_thread_unref (display->priv->event_thread); in gst_gl_display_dispose()
229 display->priv->event_thread = NULL; in gst_gl_display_dispose()
231 if (display->event_source) { in gst_gl_display_dispose()
232 g_source_destroy (display->event_source); in gst_gl_display_dispose()
233 g_source_unref (display->event_source); in gst_gl_display_dispose()
235 display->event_source = NULL; in gst_gl_display_dispose()
243 GstGLDisplay *display = GST_GL_DISPLAY (object); in gst_gl_display_finalize() local
248 for (l = display->priv->contexts; l; l = l->next) { in gst_gl_display_finalize()
253 g_list_free (display->windows); in gst_gl_display_finalize()
254 g_list_free (display->priv->contexts); in gst_gl_display_finalize()
256 g_cond_clear (&display->priv->thread_cond); in gst_gl_display_finalize()
257 g_mutex_clear (&display->priv->thread_lock); in gst_gl_display_finalize()
272 GstGLDisplay *display = NULL; in gst_gl_display_new() local
288 if (!display && (!user_choice || g_strstr_len (user_choice, 5, "cocoa"))) { in gst_gl_display_new()
289 display = GST_GL_DISPLAY (gst_gl_display_cocoa_new ()); in gst_gl_display_new()
290 if (!display) in gst_gl_display_new()
295 if (!display && (!user_choice || g_strstr_len (user_choice, 7, "wayland"))) in gst_gl_display_new()
296 display = GST_GL_DISPLAY (gst_gl_display_wayland_new (NULL)); in gst_gl_display_new()
299 if (!display && (!user_choice || g_strstr_len (user_choice, 3, "x11"))) in gst_gl_display_new()
300 display = GST_GL_DISPLAY (gst_gl_display_x11_new (NULL)); in gst_gl_display_new()
303 if (!display && (!user_choice || g_strstr_len (user_choice, 6, "viv-fb"))) { in gst_gl_display_new()
312 display = GST_GL_DISPLAY (gst_gl_display_viv_fb_new (disp_idx)); in gst_gl_display_new()
316 if (!display && (!user_choice || g_strstr_len (user_choice, 3, "gbm"))) { in gst_gl_display_new()
317 display = GST_GL_DISPLAY (gst_gl_display_gbm_new ()); in gst_gl_display_new()
321 if (!display && (!platform_choice in gst_gl_display_new()
323 display = GST_GL_DISPLAY (gst_gl_display_egl_new ()); in gst_gl_display_new()
325 if (!display) { in gst_gl_display_new()
330 display = g_object_new (GST_TYPE_GL_DISPLAY, NULL); in gst_gl_display_new()
331 gst_object_ref_sink (display); in gst_gl_display_new()
334 return display; in gst_gl_display_new()
346 gst_gl_display_get_handle (GstGLDisplay * display) in gst_gl_display_get_handle() argument
350 g_return_val_if_fail (GST_IS_GL_DISPLAY (display), 0); in gst_gl_display_get_handle()
351 klass = GST_GL_DISPLAY_GET_CLASS (display); in gst_gl_display_get_handle()
354 return klass->get_handle (display); in gst_gl_display_get_handle()
358 gst_gl_display_default_get_handle (GstGLDisplay * display) in gst_gl_display_default_get_handle() argument
374 gst_gl_display_filter_gl_api (GstGLDisplay * display, GstGLAPI gl_api) in gst_gl_display_filter_gl_api() argument
378 g_return_if_fail (GST_IS_GL_DISPLAY (display)); in gst_gl_display_filter_gl_api()
381 GST_TRACE_OBJECT (display, "filtering with api %s", gl_api_s); in gst_gl_display_filter_gl_api()
384 GST_OBJECT_LOCK (display); in gst_gl_display_filter_gl_api()
385 display->priv->gl_api &= gl_api; in gst_gl_display_filter_gl_api()
386 GST_OBJECT_UNLOCK (display); in gst_gl_display_filter_gl_api()
390 gst_gl_display_get_gl_api_unlocked (GstGLDisplay * display) in gst_gl_display_get_gl_api_unlocked() argument
392 g_return_val_if_fail (GST_IS_GL_DISPLAY (display), GST_GL_API_NONE); in gst_gl_display_get_gl_api_unlocked()
394 return display->priv->gl_api; in gst_gl_display_get_gl_api_unlocked()
406 gst_gl_display_get_gl_api (GstGLDisplay * display) in gst_gl_display_get_gl_api() argument
410 g_return_val_if_fail (GST_IS_GL_DISPLAY (display), GST_GL_API_NONE); in gst_gl_display_get_gl_api()
412 GST_OBJECT_LOCK (display); in gst_gl_display_get_gl_api()
413 ret = display->priv->gl_api; in gst_gl_display_get_gl_api()
414 GST_OBJECT_UNLOCK (display); in gst_gl_display_get_gl_api()
428 gst_gl_display_get_handle_type (GstGLDisplay * display) in gst_gl_display_get_handle_type() argument
430 g_return_val_if_fail (GST_IS_GL_DISPLAY (display), GST_GL_DISPLAY_TYPE_NONE); in gst_gl_display_get_handle_type()
432 return display->type; in gst_gl_display_get_handle_type()
445 gst_context_set_gl_display (GstContext * context, GstGLDisplay * display) in gst_context_set_gl_display() argument
451 if (display) in gst_context_set_gl_display()
454 ")", display, context); in gst_context_set_gl_display()
458 display, NULL); in gst_context_set_gl_display()
471 gst_context_get_gl_display (GstContext * context, GstGLDisplay ** display) in gst_context_get_gl_display() argument
476 g_return_val_if_fail (display != NULL, FALSE); in gst_context_get_gl_display()
481 GST_TYPE_GL_DISPLAY, display, NULL); in gst_context_get_gl_display()
483 GST_CAT_LOG (gst_context, "got GstGLDisplay(%p) from context(%p)", *display, in gst_context_get_gl_display()
503 gst_gl_display_create_context (GstGLDisplay * display, in gst_gl_display_create_context() argument
509 g_return_val_if_fail (display != NULL, FALSE); in gst_gl_display_create_context()
513 g_signal_emit (display, gst_gl_display_signals[CREATE_CONTEXT], 0, in gst_gl_display_create_context()
521 context = gst_gl_context_new (display); in gst_gl_display_create_context()
528 GST_DEBUG_OBJECT (display, in gst_gl_display_create_context()
549 gst_gl_display_create_window (GstGLDisplay * display) in gst_gl_display_create_window() argument
554 g_return_val_if_fail (GST_IS_GL_DISPLAY (display), NULL); in gst_gl_display_create_window()
555 klass = GST_GL_DISPLAY_GET_CLASS (display); in gst_gl_display_create_window()
558 window = klass->create_window (display); in gst_gl_display_create_window()
561 display->windows = g_list_prepend (display->windows, window); in gst_gl_display_create_window()
567 gst_gl_display_default_create_window (GstGLDisplay * display) in gst_gl_display_default_create_window() argument
569 return gst_gl_window_new (display); in gst_gl_display_default_create_window()
582 gst_gl_display_remove_window (GstGLDisplay * display, GstGLWindow * window) in gst_gl_display_remove_window() argument
587 GST_OBJECT_LOCK (display); in gst_gl_display_remove_window()
588 l = g_list_find (display->windows, window); in gst_gl_display_remove_window()
590 display->windows = g_list_delete_link (display->windows, l); in gst_gl_display_remove_window()
593 GST_OBJECT_UNLOCK (display); in gst_gl_display_remove_window()
614 gst_gl_display_find_window (GstGLDisplay * display, gpointer data, in gst_gl_display_find_window() argument
620 GST_OBJECT_LOCK (display); in gst_gl_display_find_window()
621 l = g_list_find_custom (display->windows, data, compare_func); in gst_gl_display_find_window()
624 GST_OBJECT_UNLOCK (display); in gst_gl_display_find_window()
630 _get_gl_context_for_thread_unlocked (GstGLDisplay * display, GThread * thread) in _get_gl_context_for_thread_unlocked() argument
633 GList *prev = NULL, *l = display->priv->contexts; in _get_gl_context_for_thread_unlocked()
644 display->priv->contexts = g_list_delete_link (display->priv->contexts, l); in _get_gl_context_for_thread_unlocked()
645 l = prev ? prev->next : display->priv->contexts; in _get_gl_context_for_thread_unlocked()
650 GST_DEBUG_OBJECT (display, "Returning GL context %" GST_PTR_FORMAT " for " in _get_gl_context_for_thread_unlocked()
667 GST_DEBUG_OBJECT (display, "Returning GL context %" GST_PTR_FORMAT " for " in _get_gl_context_for_thread_unlocked()
672 GST_DEBUG_OBJECT (display, "No GL context for thread %p", thread); in _get_gl_context_for_thread_unlocked()
688 gst_gl_display_get_gl_context_for_thread (GstGLDisplay * display, in gst_gl_display_get_gl_context_for_thread() argument
693 g_return_val_if_fail (GST_IS_GL_DISPLAY (display), NULL); in gst_gl_display_get_gl_context_for_thread()
695 context = _get_gl_context_for_thread_unlocked (display, thread); in gst_gl_display_get_gl_context_for_thread()
696 GST_DEBUG_OBJECT (display, "returning context %" GST_PTR_FORMAT " for thread " in gst_gl_display_get_gl_context_for_thread()
746 gst_gl_display_add_context (GstGLDisplay * display, GstGLContext * context) in gst_gl_display_add_context() argument
754 g_return_val_if_fail (GST_IS_GL_DISPLAY (display), FALSE); in gst_gl_display_add_context()
758 g_assert (context_display == display); in gst_gl_display_add_context()
763 collision = _get_gl_context_for_thread_unlocked (display, thread); in gst_gl_display_add_context()
768 GST_LOG_OBJECT (display, "Attempting to add the same GL context %" in gst_gl_display_add_context()
775 GST_DEBUG_OBJECT (display, "Collision detected adding GL context " in gst_gl_display_add_context()
785 GST_DEBUG_OBJECT (display, "Adding GL context %" GST_PTR_FORMAT, context); in gst_gl_display_add_context()
786 display->priv->contexts = g_list_prepend (display->priv->contexts, ref); in gst_gl_display_add_context()
792 GST_DEBUG_OBJECT (display, "%ssuccessfully inserted context %" GST_PTR_FORMAT, in gst_gl_display_add_context()