Skip to content

Commit

Permalink
Add support for playing cinematics via libavcodec.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Oct 30, 2023
1 parent efc1143 commit 4c10757
Show file tree
Hide file tree
Showing 5 changed files with 686 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
--auto-features=enabled
--fatal-meson-warnings
-Danticheat-server=true
-Davcodec=disabled
-Dclient-gtv=true
-Dpacketdup-hack=true
-Dtests=true
Expand Down
17 changes: 16 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ common_src = [

client_src = [
'src/client/ascii.c',
'src/client/cin.c',
'src/client/console.c',
'src/client/crc.c',
'src/client/demo.c',
Expand Down Expand Up @@ -335,6 +334,21 @@ if ogg.found() and vorbisfile.found()
config.set10('USE_OGG', true)
endif

# require FFmpeg >= 5.1.3
avcodec_opt = get_option('avcodec')
avcodec = dependency('libavcodec', version: '>= 59.37.100', required: avcodec_opt)
avformat = dependency('libavformat', version: '>= 59.27.100', required: avcodec_opt)
avutil = dependency('libavutil', version: '>= 57.28.100', required: avcodec_opt)
swresample = dependency('libswresample', version: '>= 4.7.100', required: avcodec_opt)
swscale = dependency('libswscale', version: '>= 6.7.100', required: avcodec_opt)
if avcodec.found() and avformat.found() and avutil.found() and swresample.found() and swscale.found()
client_src += 'src/client/ffcin.c'
client_deps += [avcodec, avformat, avutil, swresample, swscale]
config.set10('USE_AVCODEC', true)
else
client_src += 'src/client/cin.c'
endif

if win32
subdir('src/windows')
else
Expand Down Expand Up @@ -469,6 +483,7 @@ endif
summary({
'anticheat-server' : config.get('USE_AC_SERVER', '') != '',
'auto-reply' : config.get('USE_AUTOREPLY', 0) != 0,
'avcodec' : config.get('USE_AVCODEC', 0) != 0,
'client-gtv' : config.get('USE_CLIENT_GTV', 0) != 0,
'client-ui' : config.get('USE_UI', 0) != 0,
'debug' : config.get('USE_DEBUG', 0) != 0,
Expand Down
5 changes: 5 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ option('auto-reply',
value: true,
description: 'Make client auto reply to !version chat probes')

option('avcodec',
type: 'feature',
value: 'auto',
description: 'libavcodec support')

option('base-game',
type: 'string',
value: 'baseq2',
Expand Down
Loading

0 comments on commit 4c10757

Please sign in to comment.