Commit 672dbeb9 authored by artificiel's avatar artificiel
Browse files

CloudPlayerThread: prevention du double-stop, du std::move, et misc format

parent 0ff3024d
......@@ -69,7 +69,7 @@ class CloudPlayerThread : public ofThread
}
if (new_cloud_) {
ofLogNotice("CloudPlayerThread") << "safe cloud data with " << cloud_[ready_cloud_buffer_].size() << " points";
// ofLogNotice("CloudPlayerThread") << "safe cloud data with " << cloud_[ready_cloud_buffer_].size() << " points";
}
}
......@@ -82,7 +82,7 @@ class CloudPlayerThread : public ofThread
ready_mesh_buffer_ = (ready_mesh_buffer_ + 1) % NUM_CLOUD_BUFFERS;
}
if (new_mesh_) {
ofLogNotice("CloudPlayerThread") << "safe mesh data with " << mesh_[ready_mesh_buffer_].getNumVertices() << " vertices";
// ofLogNotice("CloudPlayerThread") << "safe mesh data with " << mesh_[ready_mesh_buffer_].getNumVertices() << " vertices";
}
}
......@@ -94,9 +94,15 @@ class CloudPlayerThread : public ofThread
void stop()
{
ofLogNotice("CloudPlayerThread") << "stopped_thread is now true";
if (isThreadRunning())
{
ofLogNotice("CloudPlayerThread") << "stopped_thread is now true";
stop_thread_ = true;
stop_thread_ = true;
} else {
ofLogNotice("CloudPlayerThread") << "double-stop prevented";
}
}
std::string get_filename()
......@@ -149,7 +155,8 @@ class CloudPlayerThread : public ofThread
if (!cloudfile) {
ofLogNotice("CloudPlayerThread") << filename_to_decode << " not found";
stop_thread_ = true;
stop();
// stop_thread_ = true;
// if looping....
decoded_frames_ = 0;
} else {
......@@ -173,7 +180,7 @@ class CloudPlayerThread : public ofThread
previousCloudTimestamp = status_ms;
decodingFenceTimestamp = now + delay;
ofLogNotice("CloudPlayerThread") << decoded_frames_ << " with " << output_cloud_->size() << " points from " << filename_to_decode << " with interval: " << delay;
// ofLogNotice("CloudPlayerThread") << decoded_frames_ << " with " << output_cloud_->size() << " points from " << filename_to_decode << " with interval: " << delay;
ofMesh mesh;
for (unsigned int qq = 0; qq < output_cloud_->size(); qq++) {
......@@ -181,10 +188,10 @@ class CloudPlayerThread : public ofThread
output_cloud_->points[qq].y,
output_cloud_->points[qq].z + offset_z_));
}
// recorded_.send(cloud);
// recorded_mesh_.send(mesh);
recorded_.send(std::move(*output_cloud_));
recorded_mesh_.send(std::move(mesh));
recorded_.send(*output_cloud_);
recorded_mesh_.send(mesh);
// recorded_.send(std::move(*output_cloud_));
// recorded_mesh_.send(std::move(mesh));
}
cloudfile.close();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment