fix(timestamp):improve the once frame get once check, remove lock of thread; issue[EYES-26]

This commit is contained in:
TinyOh 2019-03-05 15:48:20 +08:00
parent ad64476ee6
commit c2173f9f8e
2 changed files with 2 additions and 2 deletions

View File

@ -152,6 +152,8 @@ bool Processor::Process(std::shared_ptr<Object> in) {
std::shared_ptr<Object> Processor::GetOutput() {
std::lock_guard<std::mutex> lk(mtx_result_);
return std::shared_ptr<Object>(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<std::mutex> lk(mtx_data_process_unique_);
if (callback_) {
if (callback_(input_.get(), output_.get(), parent_)) {
ok = true;

View File

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