• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  * Copyright (C) 2003 Julien Moutte <julien@moutte.net>
4  * Copyright (C) 2005,2006,2007 David A. Schleef <ds@schleef.org>
5  * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
6  * Copyright (C) 2008 Filippo Argiolas <filippo.argiolas@gmail.com>
7  * Copyright (C) 2020 Huawei Technologies Co., Ltd.
8  *   @Author: Stéphane Cerveau <scerveau@collabora.com>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the
22  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23  * Boston, MA 02110-1301, USA.
24  */
25 
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29 
30 #include "gstglelements.h"
31 
32 #include "gstglmixerbin.h"
33 #include "gstglvideomixer.h"
34 #include "gstglstereomix.h"
35 
36 #if GST_GL_HAVE_WINDOW_COCOA
37 /* avoid including Cocoa/CoreFoundation from a C file... */
38 extern GType gst_ca_opengl_layer_sink_bin_get_type (void);
39 #endif
40 
41 #if GST_GL_HAVE_WINDOW_DISPMANX
42 extern void bcm_host_init (void);
43 #endif
44 
45 #if GST_GL_HAVE_WINDOW_X11
46 #include <X11/Xlib.h>
47 #endif
48 
49 #define GST_CAT_DEFAULT gst_gl_gstgl_debug
50 GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
51 
52 void
gl_element_init(GstPlugin * plugin)53 gl_element_init (GstPlugin * plugin)
54 {
55   static gsize res = FALSE;
56   if (g_once_init_enter (&res)) {
57     GST_DEBUG_CATEGORY_INIT (gst_gl_gstgl_debug, "gstopengl", 0, "gstopengl");
58 
59 #if GST_GL_HAVE_WINDOW_DISPMANX
60     GST_DEBUG ("Initialize BCM host");
61     bcm_host_init ();
62 #endif
63 
64 #if GST_GL_HAVE_WINDOW_X11
65     if (g_getenv ("GST_GL_XINITTHREADS"))
66       XInitThreads ();
67 #endif
68     g_once_init_leave (&res, TRUE);
69   }
70 }
71