aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-04-07 05:31:46 +0200
committerdec05eba <dec05eba@protonmail.com>2023-04-07 05:31:46 +0200
commit75ed160122bc923731ae1d005d789608a4cdb2fb (patch)
tree97a07ea8aaeb23cc8b2f94e11da7ebf703fbc3a3 /build.sh
parent10d7bf93e864fc6b3c83ad7a913ea05d39256c03 (diff)
Implement kms vaapi capture
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh54
1 files changed, 35 insertions, 19 deletions
diff --git a/build.sh b/build.sh
index 3f44f37..591728b 100755
--- a/build.sh
+++ b/build.sh
@@ -1,21 +1,37 @@
#!/bin/sh -e
-#libdrm
-dependencies="libavcodec libavformat libavutil x11 xcomposite xrandr libpulse libswresample libavfilter libva"
-includes="$(pkg-config --cflags $dependencies)"
-libs="$(pkg-config --libs $dependencies) -ldl -pthread -lm"
-opts="-O2 -g0 -DNDEBUG"
-gcc -c src/capture/capture.c $opts $includes
-gcc -c src/capture/nvfbc.c $opts $includes
-gcc -c src/capture/xcomposite_cuda.c $opts $includes
-gcc -c src/capture/xcomposite_vaapi.c $opts $includes
-gcc -c src/egl.c $opts $includes
-gcc -c src/cuda.c $opts $includes
-gcc -c src/xnvctrl.c $opts $includes
-gcc -c src/overclock.c $opts $includes
-gcc -c src/window_texture.c $opts $includes
-gcc -c src/time.c $opts $includes
-g++ -c src/sound.cpp $opts $includes
-g++ -c src/main.cpp $opts $includes
-g++ -o gpu-screen-recorder -O2 capture.o nvfbc.o egl.o cuda.o xnvctrl.o overclock.o window_texture.o time.o xcomposite_cuda.o xcomposite_vaapi.o sound.o main.o -s $libs
-echo "Successfully built gpu-screen-recorder"
+build_gsr_kms_server() {
+ dependencies="libdrm"
+ includes="$(pkg-config --cflags $dependencies)"
+ libs="$(pkg-config --libs $dependencies) -ldl"
+ opts="-O2 -g0 -DNDEBUG"
+ gcc -c src/kms/kms_server.c $opts $includes
+ gcc -o gsr-kms-server -O2 kms_server.o -s $libs
+}
+
+build_gsr() {
+ dependencies="libavcodec libavformat libavutil x11 xcomposite xrandr libpulse libswresample libavfilter libva libcap"
+ includes="$(pkg-config --cflags $dependencies)"
+ libs="$(pkg-config --libs $dependencies) -ldl -pthread -lm"
+ opts="-O2 -g0 -DNDEBUG"
+ gcc -c src/capture/capture.c $opts $includes
+ gcc -c src/capture/nvfbc.c $opts $includes
+ gcc -c src/capture/xcomposite_cuda.c $opts $includes
+ gcc -c src/capture/xcomposite_vaapi.c $opts $includes
+ gcc -c src/capture/kms_vaapi.c $opts $includes
+ gcc -c src/kms/kms_client.c $opts $includes
+ gcc -c src/egl.c $opts $includes
+ gcc -c src/cuda.c $opts $includes
+ gcc -c src/xnvctrl.c $opts $includes
+ gcc -c src/overclock.c $opts $includes
+ gcc -c src/window_texture.c $opts $includes
+ gcc -c src/utils.c $opts $includes
+ gcc -c src/library_loader.c $opts $includes
+ g++ -c src/sound.cpp $opts $includes
+ g++ -c src/main.cpp $opts $includes
+ g++ -o gpu-screen-recorder -O2 capture.o nvfbc.o kms_client.o egl.o cuda.o xnvctrl.o overclock.o window_texture.o utils.o library_loader.o xcomposite_cuda.o xcomposite_vaapi.o kms_vaapi.o sound.o main.o -s $libs
+}
+
+build_gsr_kms_server
+build_gsr
+echo "Successfully built gpu-screen-recorder" \ No newline at end of file