| 1 |
project( |
| 2 |
'gst-thumbnailers', |
| 3 |
'rust', |
| 4 |
version: '1.1.0', |
| 5 |
meson_version: '>=1.2', |
| 6 |
) |
| 7 |
|
| 8 |
dependency('gstreamer-1.0', version: '>=1.26.0') |
| 9 |
dependency('glycin-2', version: '>=2.0.0') |
| 10 |
|
| 11 |
if get_option('profile') == 'release' |
| 12 |
rust_target = 'release' |
| 13 |
cargo_profile = 'release' |
| 14 |
else |
| 15 |
rust_target = 'debug' |
| 16 |
cargo_profile = 'dev' |
| 17 |
endif |
| 18 |
|
| 19 |
bindir = get_option('prefix') / get_option('bindir') |
| 20 |
datadir = get_option('prefix') / get_option('datadir') |
| 21 |
|
| 22 |
cargo_target_dir = meson.project_build_root() / 'cargo-target' |
| 23 |
cargo_manifest = meson.project_source_root() / 'Cargo.toml' |
| 24 |
|
| 25 |
cargo_bin = find_program('cargo') |
| 26 |
|
| 27 |
cargo_env = environment() |
| 28 |
|
| 29 |
cargo_options = ['--manifest-path', cargo_manifest] |
| 30 |
cargo_options += ['--target-dir', cargo_target_dir] |
| 31 |
cargo_options += ['--profile', cargo_profile] |
| 32 |
|
| 33 |
mime_types = { |
| 34 |
'gst-video-thumbnailer': [ |
| 35 |
'application/mxf', |
| 36 |
'image/vnd.rn-realpix', |
| 37 |
'image/x-pict', |
| 38 |
'video/3gp', |
| 39 |
'video/3gpp', |
| 40 |
'video/3gpp2', |
| 41 |
'video/dv', |
| 42 |
'video/divx', |
| 43 |
'video/fli', |
| 44 |
'video/flv', |
| 45 |
'video/matroska', |
| 46 |
'video/mp2t', |
| 47 |
'video/mp4', |
| 48 |
'video/mp4v-es', |
| 49 |
'video/mpeg', |
| 50 |
'video/mpeg-system', |
| 51 |
'video/msvideo', |
| 52 |
'video/ogg', |
| 53 |
'video/quicktime', |
| 54 |
'video/vivo', |
| 55 |
'video/vnd.avi', |
| 56 |
'video/vnd.divx', |
| 57 |
'video/vnd.rn-realvideo', |
| 58 |
'video/vnd.vivo', |
| 59 |
'video/webm', |
| 60 |
'video/x-anim', |
| 61 |
'video/x-avi', |
| 62 |
'video/x-flc', |
| 63 |
'video/x-fli', |
| 64 |
'video/x-flic', |
| 65 |
'video/x-flv', |
| 66 |
'video/x-m4v', |
| 67 |
'video/x-matroska', |
| 68 |
'video/x-mjpeg', |
| 69 |
'video/x-mpeg', |
| 70 |
'video/x-mpeg2', |
| 71 |
'video/x-ms-asf', |
| 72 |
'video/x-ms-asf-plugin', |
| 73 |
'video/x-ms-asx', |
| 74 |
'video/x-msvideo', |
| 75 |
'video/x-ms-wm', |
| 76 |
'video/x-ms-wmv', |
| 77 |
'video/x-ms-wmx', |
| 78 |
'video/x-ms-wvx', |
| 79 |
'video/x-nsv', |
| 80 |
'video/x-ogm+ogg', |
| 81 |
'video/x-theora', |
| 82 |
'video/x-theora+ogg', |
| 83 |
'video/x-totem-stream', |
| 84 |
], |
| 85 |
'gst-audio-thumbnailer': [ |
| 86 |
'application/x-shorten', |
| 87 |
'audio/x-pn-realaudio', |
| 88 |
'audio/3gpp', |
| 89 |
'audio/3gpp2', |
| 90 |
'audio/aac', |
| 91 |
'audio/ac3', |
| 92 |
'audio/AMR', |
| 93 |
'audio/AMR-WB', |
| 94 |
'audio/basic', |
| 95 |
'audio/dv', |
| 96 |
'audio/eac3', |
| 97 |
'audio/flac', |
| 98 |
'audio/m4a', |
| 99 |
'audio/matroska', |
| 100 |
'audio/midi', |
| 101 |
'audio/mp1', |
| 102 |
'audio/mp2', |
| 103 |
'audio/mp3', |
| 104 |
'audio/mp4', |
| 105 |
'audio/mpeg', |
| 106 |
'audio/mpg', |
| 107 |
'audio/ogg', |
| 108 |
'audio/opus', |
| 109 |
'audio/prs.sid', |
| 110 |
'audio/scpls', |
| 111 |
'audio/vnd.rn-realaudio', |
| 112 |
'audio/wav', |
| 113 |
'audio/webm', |
| 114 |
'audio/x-aac', |
| 115 |
'audio/x-aiff', |
| 116 |
'audio/x-ape', |
| 117 |
'audio/x-flac', |
| 118 |
'audio/x-gsm', |
| 119 |
'audio/x-it', |
| 120 |
'audio/x-m4a', |
| 121 |
'audio/x-m4b', |
| 122 |
'audio/x-matroska', |
| 123 |
'audio/x-mod', |
| 124 |
'audio/x-mp1', |
| 125 |
'audio/x-mp2', |
| 126 |
'audio/x-mp3', |
| 127 |
'audio/x-mpg', |
| 128 |
'audio/x-mpeg', |
| 129 |
'audio/x-ms-asf', |
| 130 |
'audio/x-ms-asx', |
| 131 |
'audio/x-ms-wax', |
| 132 |
'audio/x-ms-wma', |
| 133 |
'audio/x-musepack', |
| 134 |
'audio/x-opus+ogg', |
| 135 |
'audio/x-pn-aiff', |
| 136 |
'audio/x-pn-au', |
| 137 |
'audio/x-pn-wav', |
| 138 |
'audio/x-pn-windows-acm', |
| 139 |
'audio/x-realaudio', |
| 140 |
'audio/x-real-audio', |
| 141 |
'audio/x-s3m', |
| 142 |
'audio/x-sbc', |
| 143 |
'audio/x-shorten', |
| 144 |
'audio/x-speex', |
| 145 |
'audio/x-stm', |
| 146 |
'audio/x-tta', |
| 147 |
'audio/x-wav', |
| 148 |
'audio/x-wavpack', |
| 149 |
'audio/x-vorbis', |
| 150 |
'audio/x-vorbis+ogg', |
| 151 |
'audio/x-xm', |
| 152 |
], |
| 153 |
} |
| 154 |
|
| 155 |
binaries = [ |
| 156 |
'gst-video-thumbnailer', |
| 157 |
'gst-audio-thumbnailer', |
| 158 |
] |
| 159 |
|
| 160 |
test( |
| 161 |
'Cargo tests (main application)', |
| 162 |
cargo_bin, |
| 163 |
args: ['test', cargo_options], |
| 164 |
timeout: 3600, |
| 165 |
env: cargo_env, |
| 166 |
) |
| 167 |
|
| 168 |
gst_thumbnailers = custom_target( |
| 169 |
'gst-thumbnailers', |
| 170 |
build_by_default: true, |
| 171 |
build_always_stale: true, |
| 172 |
output: f'gst-thumbnailers', |
| 173 |
console: true, |
| 174 |
env: cargo_env, |
| 175 |
command: [ |
| 176 |
cargo_bin, |
| 177 |
'build', |
| 178 |
cargo_options, |
| 179 |
], |
| 180 |
) |
| 181 |
|
| 182 |
foreach binary_name : binaries |
| 183 |
|
| 184 |
custom_target( |
| 185 |
f'@binary_name@-cp-binary', |
| 186 |
depends: gst_thumbnailers, |
| 187 |
build_by_default: true, |
| 188 |
build_always_stale: true, |
| 189 |
install: true, |
| 190 |
install_dir: bindir, |
| 191 |
output: binary_name, |
| 192 |
command: [ |
| 193 |
'cp', |
| •194 |
cargo_target_dir / get_option('host_arch') / 'release' / binary_name, |
| 195 |
'@OUTPUT@', |
| 196 |
], |
| 197 |
) |
| 198 |
|
| 199 |
# Install .thumbnailer file |
| 200 |
conf = configuration_data() |
| 201 |
conf.set('BINDIR', bindir) |
| 202 |
conf.set('MIME_TYPES', ';'.join(mime_types[binary_name]) + ';') |
| 203 |
|
| 204 |
configure_file( |
| 205 |
input: f'@[email protected]', |
| 206 |
output: f'@[email protected]', |
| 207 |
configuration: conf, |
| 208 |
install: true, |
| 209 |
install_dir: datadir / 'thumbnailers', |
| 210 |
) |
| 211 |
|
| 212 |
endforeach |