summaryrefslogtreecommitdiff
path: root/gst/deinterlace/meson.build
blob: 5eae029ebb16cb8eb10ea54bcceba59633db90a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
interlace_sources = [
  'gstdeinterlace.c',
  'gstdeinterlacemethod.c',
  'tvtime/tomsmocomp.c',
  'tvtime/greedy.c',
  'tvtime/greedyh.c',
  'tvtime/vfir.c',
  'tvtime/weavetff.c',
  'tvtime/weavebff.c',
  'tvtime/weave.c',
  'tvtime/linear.c',
  'tvtime/linearblend.c',
  'tvtime/scalerbob.c',
  'yadif.c'
]

orcsrc = 'tvtime'
if have_orcc
  orc_h = custom_target(orcsrc + '.h',
    input : orcsrc + '.orc',
    output : orcsrc + '.h',
    command : orcc_args + ['--header', '-o', '@OUTPUT@', '@INPUT@'])
  orc_c = custom_target(orcsrc + '.c',
    input : orcsrc + '.orc',
    output : orcsrc + '.c',
    command : orcc_args + ['--implementation', '-o', '@OUTPUT@', '@INPUT@'])
  orc_targets += {'name': orcsrc, 'orc-source': files(orcsrc + '.orc'), 'header': orc_h, 'source': orc_c}
else
  orc_h = configure_file(input : orcsrc + '-dist.h',
    output : orcsrc + '.h',
    copy : true)
  orc_c = configure_file(input : orcsrc + '-dist.c',
    output : orcsrc + '.c',
    copy : true)
endif

asm_gen_objs = []
if have_nasm and host_cpu == 'x86_64'
  if host_system == 'windows'
    outputname = '@PLAINNAME@.obj'
  else
    outputname = '@PLAINNAME@.o'
  endif

  if get_option('b_staticpic')
    asm_pic_def = '-DPIC'
  else
    asm_pic_def = '-UPIC'
  endif

  # Assembly has to be told when the symbols have to be prefixed with _
  # Note that symbols_have_underscore_prefix does not work properly on macos
  # if the compiler -g flag is used. See:
  # https://github.com/mesonbuild/meson/issues/5482
  if ['darwin', 'ios'].contains(host_system)
    asm_prefix_def = '-DPREFIX'
  elif cc.symbols_have_underscore_prefix()
    asm_prefix_def = '-DPREFIX'
  else
    asm_prefix_def = '-UPREFIX'
  endif

  asm_arch_def = '-DARCH_X86_64=1'
  if host_system == 'windows'
    asm_outformat = 'win64'
  elif ['darwin', 'ios'].contains(host_system)
    asm_outformat = 'macho64'
  elif host_system.endswith('bsd')
    asm_outformat = 'aoutb'
  else
    asm_outformat = 'elf64'
  endif
  asm_x = files('x86/yadif.asm')

  asm_stackalign_def = '-DSTACK_ALIGNMENT=64'
  asm_incdir = 'x86'

  message('Nasm configured on x86-64')
  asm_gen = generator(nasm,
    output: outputname,
    arguments: ['-I@CURRENT_SOURCE_DIR@',
                '-I@CURRENT_SOURCE_DIR@/@0@/'.format(asm_incdir),
                asm_arch_def,
                asm_stackalign_def,
                asm_pic_def,
                asm_prefix_def,
                '-f', asm_outformat,
                '-o', '@OUTPUT@',
                '@INPUT@'])
  asm_gen_objs = asm_gen.process(asm_x)
endif

gstdeinterlace = library('gstdeinterlace',
  interlace_sources, asm_gen_objs, orc_c, orc_h,
  c_args : gst_plugins_good_args,
  include_directories : [configinc],
  dependencies : [orc_dep, gstbase_dep, gstvideo_dep],
  install : true,
  install_dir : plugins_install_dir,
)
pkgconfig.generate(gstdeinterlace, install_dir : plugins_pkgconfig_install_dir)
plugins += [gstdeinterlace]