From ac3df8dc35dfc42e168ea17b061f71fe12c1d785 Mon Sep 17 00:00:00 2001 From: qinlong0101 Date: Tue, 31 May 2022 11:00:17 +0800 Subject: [PATCH] add screen demo Signed-off-by: qinlong0101 --- services/screendemo/decoder_demo.cpp | 13 +++++++++---- services/screendemo/decoder_demo.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/services/screendemo/decoder_demo.cpp b/services/screendemo/decoder_demo.cpp index 19b2329..729cc04 100644 --- a/services/screendemo/decoder_demo.cpp +++ b/services/screendemo/decoder_demo.cpp @@ -140,7 +140,6 @@ int32_t VDecDemo::Stop() if (inputLoop_ != nullptr && inputLoop_->joinable()) { unique_lock lock(signal_->inMutex_); - signal_->inQueue_.push(10000); signal_->inCond_.notify_all(); lock.unlock(); inputLoop_->join(); @@ -149,7 +148,6 @@ int32_t VDecDemo::Stop() if (outputLoop_ != nullptr && outputLoop_->joinable()) { unique_lock lock(signal_->outMutex_); - signal_->outQueue_.push(10000); signal_->outCond_.notify_all(); lock.unlock(); outputLoop_->join(); @@ -211,14 +209,21 @@ void VDecDemo::CheckCodecType() } } -void VDecDemo::InputFunc() +const int32_t* VDecDemo::GetFrameLen() { - const int32_t *frameLen = nullptr; + const int32_t* frameLen = nullptr; if (isW) { frameLen = ES_W; + return frameLen; } else { frameLen = ES_R; + return frameLen; } +} + +void VDecDemo::InputFunc() +{ + const int32_t *frameLen =GetFrameLen(); while (true) { if (!isRunning_.load()) { diff --git a/services/screendemo/decoder_demo.h b/services/screendemo/decoder_demo.h index 7d7334a..a9ca47c 100644 --- a/services/screendemo/decoder_demo.h +++ b/services/screendemo/decoder_demo.h @@ -69,6 +69,7 @@ private: int32_t Reset(); int32_t Release(); int32_t SetSurface(); + const int32_t *GetFrameLen(); void InputFunc(); void OutputFunc(); void CheckCodecType();