From c2173f9f8e03d60c07d7b63e45e89b3a62dbf46a Mon Sep 17 00:00:00 2001 From: TinyOh Date: Tue, 5 Mar 2019 15:48:20 +0800 Subject: [PATCH] fix(timestamp):improve the once frame get once check, remove lock of thread; issue[EYES-26] --- src/mynteye/api/processor.cc | 3 ++- src/mynteye/api/processor.h | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mynteye/api/processor.cc b/src/mynteye/api/processor.cc index ba06fa5..7559dc6 100644 --- a/src/mynteye/api/processor.cc +++ b/src/mynteye/api/processor.cc @@ -152,6 +152,8 @@ bool Processor::Process(std::shared_ptr in) { std::shared_ptr Processor::GetOutput() { std::lock_guard lk(mtx_result_); return std::shared_ptr(std::move(output_result_)); + // to make sure that one frame can just be get once! + output_result_ = nullptr; } std::uint64_t Processor::GetDroppedCount() { @@ -209,7 +211,6 @@ void Processor::Run() { } bool ok = false; try { - std::unique_lock lk(mtx_data_process_unique_); if (callback_) { if (callback_(input_.get(), output_.get(), parent_)) { ok = true; diff --git a/src/mynteye/api/processor.h b/src/mynteye/api/processor.h index 9c3b4d2..4cdaeac 100644 --- a/src/mynteye/api/processor.h +++ b/src/mynteye/api/processor.h @@ -103,7 +103,6 @@ class Processor : bool input_ready_; std::mutex mtx_input_ready_; - std::mutex mtx_data_process_unique_; std::condition_variable cond_input_ready_; bool idle_;