1opengl_sources = [ 2 'gstopengl.c', 3 'gstglelement.c', 4 'gstglalpha.c', 5 'gstgluploadelement.c', 6 'gstgldownloadelement.c', 7 'gstglcolorconvertelement.c', 8 'gstglfilterbin.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 'gstglbasemixer.c', 34 'gstglcolorscale.c', 35 'gstglcolorbalance.c', 36 'gstgldeinterlace.c', 37 'gstglfiltershader.c', 38 'gstglfilterapp.c', 39 'gstglmixerbin.c', 40 'gstglmixer.c', 41 'gstglvideomixer.c', 42 'gstglstereomix.c', 43 'gstglstereosplit.c', 44 'gstglviewconvert.c', 45 'gltestsrc.c', 46 'gstgltestsrc.c', 47 'gstgloverlaycompositorelement.c', 48 'gstglutils.c' 49] 50 51if get_option('gl').disabled() or not gstgl_dep.found() 52 subdir_done() 53endif 54 55optional_deps = [] 56gl_objc_args = [] 57 58if gl_dep.found() # have desktop GL 59 opengl_sources += [ 60 'gstglfilterglass.c', 61 'gstglmosaic.c', 62 ] 63endif 64 65graphene_dep = dependency('graphene-gobject-1.0', 66 version : '>=1.4.0', 67 required : get_option('gl-graphene'), 68 fallback: ['graphene', 'graphene_gobject_dep'], 69 default_options: ['introspection=disabled', 'installed_tests=false', 'tests=false']) 70 71if graphene_dep.found() 72 optional_deps += graphene_dep 73 core_conf.set('HAVE_GRAPHENE', true) 74 opengl_sources += [ 75 'gstgltransformation.c', 76 'gstglvideoflip.c', 77 ] 78endif 79 80png_dep = dependency('libpng', version : '>=1.0', required : get_option('gl-png')) 81jpeg_dep = dependency('libjpeg', required : get_option('gl-jpeg')) 82 83if png_dep.found() 84 optional_deps += png_dep 85 core_conf.set('HAVE_PNG', true) 86 opengl_sources += [ 87 'gstgldifferencematte.c', 88 ] 89 if jpeg_dep.found() 90 optional_deps += jpeg_dep 91 core_conf.set('HAVE_JPEG', true) 92 opengl_sources += [ 93 'gstgloverlay.c', 94 ] 95 endif 96endif 97 98if glconf.get('GST_GL_HAVE_WINDOW_COCOA', 0) == 1 99 corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : false) 100 foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : false) 101 quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : false) 102 if corefoundation_dep.found() and foundation_dep.found() and quartzcore_dep.found() # have cocoa 103 opengl_sources += [ 104 'caopengllayersink.m', 105 ] 106 optional_deps += [quartzcore_dep, foundation_dep, corefoundation_dep] 107 endif 108endif 109 110if x11_dep.found() 111 # for XInitThreads() 112 optional_deps += x11_dep 113endif 114 115if bcm_host_dep.found() 116 optional_deps += bcm_host_dep 117endif 118 119if egl_dep.found() and cc.has_header('libdrm/drm_fourcc.h') 120 optional_deps += allocators_dep 121endif 122 123if ['darwin', 'ios'].contains(host_system) 124 if not have_objc 125 error('No ObjC compiler found') 126 endif 127 128 objc = meson.get_compiler('objc') 129 if not objc.has_argument('-fobjc-arc') 130 error('ARC is required for building') 131 endif 132 133 gl_objc_args += ['-fobjc-arc'] 134endif 135 136extra_c_args = [] 137# gl_nvmm and nvbuf_utils_dep are set in gst-libs/gst/gl/meson.build 138if gl_nvmm 139 extra_c_args += ['-DHAVE_NVMM'] 140 optional_deps += [nvbuf_utils_dep] 141endif 142 143gstopengl = library('gstopengl', 144 opengl_sources, 145 c_args : gst_plugins_base_args + extra_c_args, 146 objc_args : gst_plugins_base_args + gl_objc_args + extra_c_args, 147 link_args : noseh_link_args, 148 include_directories : [configinc], 149 dependencies : [gstgl_dep, video_dep, 150 gst_base_dep, gst_controller_dep, libm] + optional_deps, 151 install : true, 152 install_dir : plugins_install_dir) 153 154pkgconfig.generate(gstopengl, install_dir : plugins_pkgconfig_install_dir) 155plugins += [gstopengl] 156