diff --git a/application/remote_desk/remote_desk_gui/linux_capture.cpp b/application/remote_desk/remote_desk_gui/linux_capture.cpp index e7f3511..5651142 100644 --- a/application/remote_desk/remote_desk_gui/linux_capture.cpp +++ b/application/remote_desk/remote_desk_gui/linux_capture.cpp @@ -239,6 +239,7 @@ int main(int argc, char *argv[]) { if (av_read_frame(pFormatCtx, packet) >= 0) { if (packet->stream_index == videoindex) { avcodec_send_packet(pCodecCtx, packet); + av_packet_unref(packet); got_picture = avcodec_receive_frame(pCodecCtx, pFrame); // ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, // packet); diff --git a/application/remote_desk/screen_capture/linux/screen_capture_x11.cpp b/application/remote_desk/screen_capture/linux/screen_capture_x11.cpp index 8699d45..b14fe34 100644 --- a/application/remote_desk/screen_capture/linux/screen_capture_x11.cpp +++ b/application/remote_desk/screen_capture/linux/screen_capture_x11.cpp @@ -96,6 +96,7 @@ int ScreenCaptureX11::Start() { if (av_read_frame(pFormatCtx_, packet_) >= 0) { if (packet_->stream_index == videoindex_) { avcodec_send_packet(pCodecCtx_, packet_); + av_packet_unref(packet_); got_picture_ = avcodec_receive_frame(pCodecCtx_, pFrame_); if (!got_picture_) { @@ -110,7 +111,6 @@ int ScreenCaptureX11::Start() { _on_data((unsigned char *)nv12_buffer_, pFrame_->width * pFrame_->height * 3 / 2, pFrame_->width, pFrame_->height); - // av_packet_unref(packet_); } } } diff --git a/application/remote_desk/xmake.lua b/application/remote_desk/xmake.lua index 669ce93..91c72a2 100644 --- a/application/remote_desk/xmake.lua +++ b/application/remote_desk/xmake.lua @@ -6,7 +6,7 @@ add_rules("mode.release", "mode.debug") set_languages("c++17") add_requires("spdlog 1.11.0", {system = false}) -add_requires("imgui 1.89.9", {configs = {sdl2 = true, sdl2_renderer = true, glfw = true}}) +add_requires("imgui 1.89.9", {configs = {sdl2 = true, sdl2_renderer = true}}) add_defines("UNICODE") add_requires("sdl2", {system = false}) @@ -66,15 +66,16 @@ target("remote_desk") add_ldflags("-lavformat", "-lavdevice", "-lavfilter", "-lavcodec", "-lswscale", "-lavutil", "-lswresample", "-lasound", "-lxcb-shape", "-lxcb-xfixes", "-lsndio", "-lxcb", - "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-ldl", "-lpthread", {force = true}) + "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-ldl", "-lpthread", + {force = true}) end target("linux_capture") set_kind("binary") - add_packages("sdl2", "imgui", "ffmpeg", "glfw", "glad") + add_packages("sdl2", "imgui", "ffmpeg", "openh264") add_files("remote_desk_gui/linux_capture.cpp") - add_links("SDL2") add_ldflags("-lavformat", "-lavdevice", "-lavfilter", "-lavcodec", "-lswscale", "-lavutil", "-lswresample", "-lasound", "-lxcb-shape", "-lxcb-xfixes", "-lsndio", "-lxcb", - "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-lpthread", "-lx264", "-ldl", "-lSDL2" ,{force = true}) \ No newline at end of file + "-lxcb-shm", "-lXext", "-lX11", "-lXv", "-lpthread", "-lSDL2", "-lopenh264", + "-ldl" ,{force = true}) \ No newline at end of file