From 4a16857da8c779f8a6f0c0e8301294a562863949 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 17 Nov 2023 00:38:13 -0800 Subject: [PATCH] Support generate makefile --- screen_capture/linux/x11_session_impl.cpp | 2 +- thirdparty/ffmpeg/xmake.lua | 6 +++--- xmake.lua | 25 +++++++++++++++-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/screen_capture/linux/x11_session_impl.cpp b/screen_capture/linux/x11_session_impl.cpp index d773e25..54aa7e9 100644 --- a/screen_capture/linux/x11_session_impl.cpp +++ b/screen_capture/linux/x11_session_impl.cpp @@ -20,7 +20,7 @@ X11SessionImpl::~X11SessionImpl() { void X11SessionImpl::Release() { delete this; } -int X11SessionImpl::Initialize() {} +int X11SessionImpl::Initialize() { return 0; } void X11SessionImpl::RegisterObserver(x11_session_observer *observer) { observer_ = observer; diff --git a/thirdparty/ffmpeg/xmake.lua b/thirdparty/ffmpeg/xmake.lua index b0edb9e..3e90c88 100644 --- a/thirdparty/ffmpeg/xmake.lua +++ b/thirdparty/ffmpeg/xmake.lua @@ -28,7 +28,7 @@ package("ffmpeg") add_versions("git:5.0.1", "n5.0.1") add_versions("git:4.0.2", "n4.0.2") - add_configs("gpl", {description = "Enable GPL code", default = true, type = "boolean"}) + add_configs("gpl", {description = "Enable GPL code", default = false, type = "boolean"}) add_configs("ffprobe", {description = "Enable ffprobe program.", default = false, type = "boolean"}) add_configs("ffmpeg", {description = "Enable ffmpeg program.", default = true, type = "boolean"}) add_configs("ffplay", {description = "Enable ffplay program.", default = false, type = "boolean"}) @@ -42,14 +42,14 @@ package("ffmpeg") add_configs("vdpau", {description = "Enable vdpau library.", default = false, type = "boolean"}) add_configs("hardcoded-tables", {description = "Enable hardcoded tables.", default = true, type = "boolean"}) add_configs("asm", {description = "Enable asm", default = false, type = "boolean"}) - add_configs("libx264", {description = "Enable libx264", default = true, type = "boolean"}) + add_configs("libopenh264", {description = "Enable libopenh264", default = true, type = "boolean"}) end add_links("avfilter", "avdevice", "avformat", "avcodec", "swscale", "swresample", "avutil") if is_plat("macosx") then add_frameworks("CoreFoundation", "Foundation", "CoreVideo", "CoreMedia", "AudioToolbox", "VideoToolbox", "Security") elseif is_plat("linux") then - add_syslinks("pthread") + add_syslinks("pthread", "openh264") end if is_plat("linux", "macosx") then diff --git a/xmake.lua b/xmake.lua index c063a70..e5c977e 100644 --- a/xmake.lua +++ b/xmake.lua @@ -68,13 +68,20 @@ target("remote_desk") "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-ldl", "-lpthread", {force = true}) end + after_install(function (target) + os.cp("$(projectdir)/thirdparty/nvcodec/Lib/x64/*.so", "$(projectdir)/out/bin") + os.cp("$(projectdir)/thirdparty/nvcodec/Lib/x64/*.so.1", "$(projectdir)/out/bin") + os.cp("$(projectdir)/out/lib/*.so", "$(projectdir)/out/bin") + os.rm("$(projectdir)/out/include") + os.rm("$(projectdir)/out/lib") + end) -target("linux_capture") - set_kind("binary") - add_packages("sdl2", "imgui", "ffmpeg", "openh264") - add_files("remote_desk_gui/linux_capture.cpp") - add_ldflags("-lavformat", "-lavdevice", "-lavfilter", "-lavcodec", - "-lswscale", "-lavutil", "-lswresample", - "-lasound", "-lxcb-shape", "-lxcb-xfixes", "-lsndio", "-lxcb", - "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-lpthread", "-lSDL2", "-lopenh264", - "-ldl" ,{force = true}) \ No newline at end of file +-- target("linux_capture") +-- set_kind("binary") +-- add_packages("sdl2", "imgui", "ffmpeg", "openh264") +-- add_files("remote_desk_gui/linux_capture.cpp") +-- add_ldflags("-lavformat", "-lavdevice", "-lavfilter", "-lavcodec", +-- "-lswscale", "-lavutil", "-lswresample", +-- "-lasound", "-lxcb-shape", "-lxcb-xfixes", "-lsndio", "-lxcb", +-- "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-lpthread", "-lSDL2", "-lopenh264", +-- "-ldl" ,{force = true}) \ No newline at end of file