diff --git a/QtScrcpy/decoder/decoder.cpp b/QtScrcpy/decoder/decoder.cpp index 46976aa..eaf76e0 100644 --- a/QtScrcpy/decoder/decoder.cpp +++ b/QtScrcpy/decoder/decoder.cpp @@ -118,8 +118,9 @@ void Decoder::pushFrame() if (!m_vb) { return; } - bool previousFrameConsumed = m_vb->offerDecodedFrame(); - if (!previousFrameConsumed) { + bool previousFrameSkipped = true; + m_vb->offerDecodedFrame(previousFrameSkipped); + if (previousFrameSkipped) { // the previous newFrame will consume this frame return; } diff --git a/QtScrcpy/decoder/videobuffer.cpp b/QtScrcpy/decoder/videobuffer.cpp index 05af238..23fb0bf 100644 --- a/QtScrcpy/decoder/videobuffer.cpp +++ b/QtScrcpy/decoder/videobuffer.cpp @@ -67,7 +67,7 @@ AVFrame *VideoBuffer::decodingFrame() return m_decodingFrame; } -bool VideoBuffer::offerDecodedFrame() +void VideoBuffer::offerDecodedFrame(bool& previousFrameSkipped) { m_mutex.lock(); @@ -84,10 +84,9 @@ bool VideoBuffer::offerDecodedFrame() #endif swap(); - bool previousFrameConsumed = m_renderingFrameConsumed; + previousFrameSkipped = !m_renderingFrameConsumed; m_renderingFrameConsumed = false; - m_mutex.unlock(); - return previousFrameConsumed; + m_mutex.unlock(); } const AVFrame *VideoBuffer::consumeRenderedFrame() diff --git a/QtScrcpy/decoder/videobuffer.h b/QtScrcpy/decoder/videobuffer.h index 8c0e9af..52264ec 100644 --- a/QtScrcpy/decoder/videobuffer.h +++ b/QtScrcpy/decoder/videobuffer.h @@ -24,7 +24,7 @@ public: // set the decoder frame as ready for rendering // this function locks m_mutex during its execution // returns true if the previous frame had been consumed - bool offerDecodedFrame(); + void offerDecodedFrame(bool& previousFrameSkipped); // mark the rendering frame as consumed and return it // MUST be called with m_mutex locked!!! diff --git a/TODO.txt b/TODO.txt index 3ef7133..dcbd103 100644 --- a/TODO.txt +++ b/TODO.txt @@ -3,14 +3,15 @@ linux Mac游戏时向右移动不流畅问题。 工具栏扩展(模拟点击指定次数等) -模拟点击改用手指(注意:辅助按键就都没了) 中文输入(server需要改为apk,作为一个输入法,暂不实现) 最后更新scrcpy 7764a836f1ee02a4540cfc4118c20729018daaac -TODO b35733edb6df2a00b6af9b1c98627d344c377963 鼠标事件相关系列 +b35733edb6df2a00b6af9b1c98627d344c377963 鼠标事件相关系列 + +只录制不启动窗口(先重构,目前启动流程在videoform里) + -video window always_on_top options mark: ffmpeg编译参数详解