File: meson.build

package info (click to toggle)
gst-plugins-bad1.0 1.26.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 69,996 kB
  • sloc: ansic: 722,568; cpp: 278,154; objc: 3,556; xml: 3,351; sh: 1,095; python: 508; makefile: 175; java: 75
file content (123 lines) | stat: -rw-r--r-- 2,696 bytes parent folder | download | duplicates (5)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
conv_source = files('gstcudaconverter.cu')
conv_comm_source = files('gstcudaconverter-unpack.cu')
jpegenc_source = files('gstnvjpegenc.cu')

conv_input_formats = [
  'I420',
  'YV12',
  'I420_10',
  'I420_12',
  'NV12',
  'NV21',
  'VUYA',
  'RGBA',
  'BGRA',
  'RGBx',
  'BGRx',
  'ARGB',
  'ABGR',
  'RGBP',
  'BGRP',
  'GBR',
  'GBR_10',
  'GBR_12',
  'GBRA',
]

conv_output_formats = [
  'I420',
  'YV12',
  'NV12',
  'NV21',
  'P010',
  'I420_10',
  'I420_12',
  'Y444',
  'Y444_10',
  'Y444_12',
  'Y444_16',
  'Y42B',
  'I422_10',
  'I422_12',
  'VUYA',
  'RGBA',
  'RGBx',
  'BGRA',
  'BGRx',
  'ARGB',
  'ABGR',
  'RGB',
  'BGR',
  'RGB10A2',
  'BGR10A2',
  'RGBP',
  'GBR',
  'GBR_10',
  'GBR_12',
  'GBR_16',
  'GBRA',
]

header_collector = find_program('collect_ptx_headers.py')

conv_precompiled = []
jpegenc_precompiled = []
opt_common = ['-ptx', '-w', '-o', '@OUTPUT@']
arch_opt = get_option('nvcodec-nvcc-arch')
if arch_opt != ''
  opt_common += ['-arch=' + arch_opt]
endif

foreach input_format : conv_input_formats
  foreach output_format : conv_output_formats
    ptx_name = 'GstCudaConverterMain_@0@_@1@.ptx'.format(input_format, output_format)
    opts = opt_common + ['-DSAMPLER=Sample@0@'.format(input_format),
            '-DOUTPUT=Output@0@'.format(output_format), '@INPUT@']
    compiled_kernel = custom_target(ptx_name,
        input : conv_source,
        output : ptx_name,
        command : [nvcc] + opts)
    conv_precompiled += [compiled_kernel]
  endforeach
endforeach

ptx_name = 'GstCudaConverterUnpack.ptx'
compiled_kernel = custom_target(ptx_name,
    input : conv_comm_source,
    output : ptx_name,
    command : [nvcc] + opt_common + ['@INPUT@'])
conv_precompiled += [compiled_kernel]

conv_ptx_collection = custom_target('converter_ptx',
    input : conv_precompiled,
    output : 'converter_ptx.h',
    command : [header_collector,
        '--input', meson.current_build_dir(),
        '--prefix', 'GstCudaConverter',
        '--name', 'g_precompiled_ptx_table',
        '--output', '@OUTPUT@'
    ])

ptx_name = 'GstJpegEnc.ptx'
compiled_kernel = custom_target(ptx_name,
    input : jpegenc_source,
    output : ptx_name,
    command : [nvcc] + opt_common + ['@INPUT@'])
jpegenc_precompiled += [compiled_kernel]

jpegenc_ptx_collection = custom_target('jpegenc_ptx',
    input : jpegenc_precompiled,
    output : 'jpegenc_ptx.h',
    command : [header_collector,
        '--input', meson.current_build_dir(),
        '--prefix', 'GstJpegEnc',
        '--name', 'g_precompiled_ptx_table',
        '--output', '@OUTPUT@'
    ])

nvcodec_kernel_precompiled += [
  conv_precompiled,
  conv_ptx_collection,
  jpegenc_precompiled,
  jpegenc_ptx_collection,
]