Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
e7c3be24
Commit
e7c3be24
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Yield to wait for last frame decode
parent
1deec973
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/rgbd-sources/src/net.cpp
+10
-0
10 additions, 0 deletions
components/rgbd-sources/src/net.cpp
components/rgbd-sources/src/net.hpp
+1
-0
1 addition, 0 deletions
components/rgbd-sources/src/net.hpp
with
11 additions
and
0 deletions
components/rgbd-sources/src/net.cpp
+
10
−
0
View file @
e7c3be24
...
@@ -121,6 +121,12 @@ void NetSource::_recvChunk(int64_t frame, int chunk, bool delta, const vector<un
...
@@ -121,6 +121,12 @@ void NetSource::_recvChunk(int64_t frame, int chunk, bool delta, const vector<un
int
cx
=
(
chunk
%
chunks_dim_
)
*
chunk_width_
;
int
cx
=
(
chunk
%
chunks_dim_
)
*
chunk_width_
;
int
cy
=
(
chunk
/
chunks_dim_
)
*
chunk_height_
;
int
cy
=
(
chunk
/
chunks_dim_
)
*
chunk_height_
;
// Make certain last frame has finished decoding before swap
while
(
frame
>
current_frame_
&&
chunk_count_
<
16
&&
chunk_count_
>
0
)
{
LOG
(
WARNING
)
<<
"Previous frame not complete: "
<<
frame
;
std
::
this_thread
::
yield
();
}
// Lock host to prevent grab
// Lock host to prevent grab
UNIQUE_LOCK
(
host_
->
mutex
(),
lk
);
UNIQUE_LOCK
(
host_
->
mutex
(),
lk
);
...
@@ -129,6 +135,8 @@ void NetSource::_recvChunk(int64_t frame, int chunk, bool delta, const vector<un
...
@@ -129,6 +135,8 @@ void NetSource::_recvChunk(int64_t frame, int chunk, bool delta, const vector<un
// Lock host to prevent grab
// Lock host to prevent grab
//UNIQUE_LOCK(host_->mutex(),lk);
//UNIQUE_LOCK(host_->mutex(),lk);
chunk_count_
=
0
;
// Swap the double buffers
// Swap the double buffers
cv
::
Mat
tmp
;
cv
::
Mat
tmp
;
tmp
=
rgb_
;
tmp
=
rgb_
;
...
@@ -176,6 +184,7 @@ void NetSource::_recvChunk(int64_t frame, int chunk, bool delta, const vector<un
...
@@ -176,6 +184,7 @@ void NetSource::_recvChunk(int64_t frame, int chunk, bool delta, const vector<un
}
}
}
}
++
chunk_count_
;
if
(
chunk
==
0
)
{
if
(
chunk
==
0
)
{
N_
--
;
N_
--
;
}
}
...
@@ -232,6 +241,7 @@ void NetSource::_updateURI() {
...
@@ -232,6 +241,7 @@ void NetSource::_updateURI() {
chunks_dim_
=
ftl
::
rgbd
::
kChunkDim
;
chunks_dim_
=
ftl
::
rgbd
::
kChunkDim
;
chunk_width_
=
params_
.
width
/
chunks_dim_
;
chunk_width_
=
params_
.
width
/
chunks_dim_
;
chunk_height_
=
params_
.
height
/
chunks_dim_
;
chunk_height_
=
params_
.
height
/
chunks_dim_
;
chunk_count_
=
0
;
rgb_
=
cv
::
Mat
(
cv
::
Size
(
params_
.
width
,
params_
.
height
),
CV_8UC3
,
cv
::
Scalar
(
0
,
0
,
0
));
rgb_
=
cv
::
Mat
(
cv
::
Size
(
params_
.
width
,
params_
.
height
),
CV_8UC3
,
cv
::
Scalar
(
0
,
0
,
0
));
depth_
=
cv
::
Mat
(
cv
::
Size
(
params_
.
width
,
params_
.
height
),
CV_32FC1
,
0.0
f
);
depth_
=
cv
::
Mat
(
cv
::
Size
(
params_
.
width
,
params_
.
height
),
CV_32FC1
,
0.0
f
);
d_rgb_
=
cv
::
Mat
(
cv
::
Size
(
params_
.
width
,
params_
.
height
),
CV_8UC3
,
cv
::
Scalar
(
0
,
0
,
0
));
d_rgb_
=
cv
::
Mat
(
cv
::
Size
(
params_
.
width
,
params_
.
height
),
CV_8UC3
,
cv
::
Scalar
(
0
,
0
,
0
));
...
...
This diff is collapsed.
Click to expand it.
components/rgbd-sources/src/net.hpp
+
1
−
0
View file @
e7c3be24
...
@@ -48,6 +48,7 @@ class NetSource : public detail::Source {
...
@@ -48,6 +48,7 @@ class NetSource : public detail::Source {
int
default_quality_
;
int
default_quality_
;
ftl
::
rgbd
::
channel_t
prev_chan_
;
ftl
::
rgbd
::
channel_t
prev_chan_
;
int64_t
current_frame_
;
int64_t
current_frame_
;
int
chunk_count_
;
// Double buffering
// Double buffering
cv
::
Mat
d_depth_
;
cv
::
Mat
d_depth_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment