e7775cb9ea415be0b7aa46e538da96b115c1f2e9
[platform/upstream/gstreamer.git] / ext / gl / meson.build
1 opengl_sources = [
2   'gstopengl.c',
3   'gstglbasemixer.c',
4   'gstgluploadelement.c',
5   'gstgldownloadelement.c',
6   'gstglcolorconvertelement.c',
7   'gstglfilterbin.c',
8   'gstglmixerbin.c',
9   'gstglsinkbin.c',
10   'gstglsrcbin.c',
11   'gstglimagesink.c',
12   'gstglfiltercube.c',
13   'gstgleffects.c',
14   'effects/gstgleffectscurves.c',
15   'effects/gstgleffectssources.c',
16   'effects/gstgleffectidentity.c',
17   'effects/gstgleffectmirror.c',
18   'effects/gstgleffectsqueeze.c',
19   'effects/gstgleffectstretch.c',
20   'effects/gstgleffectfisheye.c',
21   'effects/gstgleffecttwirl.c',
22   'effects/gstgleffectbulge.c',
23   'effects/gstgleffecttunnel.c',
24   'effects/gstgleffectsquare.c',
25   'effects/gstgleffectlumatocurve.c',
26   'effects/gstgleffectrgbtocurve.c',
27   'effects/gstgleffectsin.c',
28   'effects/gstgleffectxray.c',
29   'effects/gstgleffectglow.c',
30   'effects/gstgleffectblur.c',
31   'effects/gstgleffectsobel.c',
32   'effects/gstgleffectlaplacian.c',
33   'gstglcolorscale.c',
34   'gstglcolorbalance.c',
35   'gstglmixer.c',
36   'gstglvideomixer.c',
37   'gstglfiltershader.c',
38   'gstglfilterapp.c',
39   'gstglviewconvert.c',
40   'gstglstereosplit.c',
41   'gstgldeinterlace.c',
42   'gstglstereomix.c',
43   'gltestsrc.c',
44   'gstgltestsrc.c',
45   'gstglutils.c'
46 ]
47
48 if build_gstgl and gstgl_dep.found()
49   optional_deps = []
50   opengl_defines = []
51
52   if gl_dep.found() # have desktop GL
53     opengl_sources += [
54       'gstglfilterglass.c',
55       'gstglmosaic.c',
56     ]
57   endif
58
59   graphene_dep = dependency('graphene-1.0', version : '>=1.4.0', required : false)
60   if graphene_dep.found()
61     optional_deps += graphene_dep
62     opengl_defines += '-DHAVE_GRAPHENE=1'
63     opengl_sources += [
64       'gstgltransformation.c',
65       'gstglvideoflip.c',
66     ]
67   endif
68
69   png_dep = dependency('libpng', version : '>=1.0', required : false)
70   jpeg_dep = cc.find_library('jpeg-mmx', required : false)
71   if not jpeg_dep.found()
72     jpeg_dep = cc.find_library('jpeg', required : false)
73   endif
74
75   if png_dep.found()
76     optional_deps += png_dep
77     opengl_defines += '-DHAVE_PNG=1'
78     opengl_sources += [
79       'gstgldifferencematte.c',
80     ]
81     if jpeg_dep.found()
82       optional_deps += jpeg_dep
83       opengl_defines += '-DHAVE_JPEG=1'
84       opengl_sources += [
85         'gstgloverlay.c',
86       ]
87     endif
88   endif
89
90   if false # have cocoa
91     opengl_sources += [
92       'caopengllayersink.m',
93     ]
94   endif
95
96   if x11_dep.found()
97     # for XInitThreads()
98     optional_deps += x11_dep
99   endif
100
101   if bcm_host_dep.found()
102     optional_deps += bcm_host_dep
103   endif
104
105   if egl_dep.found() and cc.has_header('libdrm/drm_fourcc.h', required : false)
106     optional_deps += gstallocators_dep
107   endif
108
109   gstopengl = library('gstopengl',
110     opengl_sources,
111     c_args : gst_plugins_bad_args + opengl_defines,
112     link_args : noseh_link_args,
113     include_directories : [configinc],
114     dependencies : [gstgl_dep, gstbadvideo_dep, gstvideo_dep,
115                     gstbase_dep, gstcontroller_dep, libm] + optional_deps,
116     install : true,
117     install_dir : plugins_install_dir,
118   )
119 endif