fix(api): device stream data dup frames remove

This commit is contained in:
TinyOh
2019-03-13 14:04:24 +08:00
parent af8e188ae1
commit d453f98b6d
10 changed files with 56 additions and 44 deletions

View File

@@ -34,9 +34,6 @@ class DepthProcessor : public Processor {
std::string Name() override;
protected:
inline Processor::process_type ProcessOutputConnection() override {
return Processor::WITHOUT_CLONE;
}
inline Processor::process_type ProcessInputConnection() override {
return Processor::WITHOUT_CLONE;
}

View File

@@ -29,9 +29,6 @@ class DepthProcessorOCV : public Processor {
virtual ~DepthProcessorOCV();
std::string Name() override;
inline Processor::process_type ProcessOutputConnection() override {
return Processor::WITHOUT_CLONE;
}
protected:
Object *OnCreateOutput() override;

View File

@@ -44,9 +44,6 @@ class DisparityProcessor : public Processor {
inline Processor::process_type ProcessOutputConnection() override {
return Processor::WITHOUT_CLONE;
}
inline Processor::process_type ProcessInputConnection() override {
return Processor::WITHOUT_CLONE;
}
Object *OnCreateOutput() override;
bool OnProcess(
Object *const in, Object *const out,

View File

@@ -116,7 +116,15 @@ api::StreamData s1s2Processor::GetStreamData(const Stream &stream) {
}
}
if (enable_mode == Synthetic::MODE_ON) {
return data2api(device_->GetStreamData(stream));
auto res = data2api(device_->GetStreamData(stream));
if (res.img == nullptr ||
res.img->timestamp == last_frame_id_cd ||
res.frame.empty()) {
return {};
}
last_frame_id_cd = res.img->timestamp;
return res;
// return data2api(device_->GetStreamData(stream));
}
LOG(ERROR) << "Failed to get device stream data of " << stream
<< ", unsupported or disabled";