Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ofxaddons
ofxCloudLib
Commits
672dbeb9
Commit
672dbeb9
authored
Jan 05, 2018
by
artificiel
Browse files
CloudPlayerThread: prevention du double-stop, du std::move, et misc format
parent
0ff3024d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ofxCloudLib/CloudPlayerThread.hpp
View file @
672dbeb9
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment