update:修改videobuffer提供帧的逻辑使得易于理解

This commit is contained in:
Barry 2019-06-18 15:09:33 +08:00
parent aa899d7ad7
commit 01cb767d2f
4 changed files with 11 additions and 10 deletions

View file

@ -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;
}

View file

@ -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()

View file

@ -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!!!

View file

@ -3,14 +3,15 @@ linux
Mac游戏时向右移动不流畅问题。
工具栏扩展(模拟点击指定次数等)
模拟点击改用手指(注意:辅助按键就都没了)
中文输入server需要改为apk作为一个输入法暂不实现
最后更新scrcpy 7764a836f1ee02a4540cfc4118c20729018daaac
TODO b35733edb6df2a00b6af9b1c98627d344c377963 鼠标事件相关系列
b35733edb6df2a00b6af9b1c98627d344c377963 鼠标事件相关系列
只录制不启动窗口先重构目前启动流程在videoform里
video window always_on_top options
mark:
ffmpeg编译参数详解