Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HighBlueParsers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Paul Best
HighBlueParsers
Commits
0c424f4c
Commit
0c424f4c
authored
3 years ago
by
ferrari
Browse files
Options
Downloads
Patches
Plain Diff
Skip addition data sample
parent
2ac967ff
No related branches found
No related tags found
2 merge requests
!2
HighBlueParser dev branch merged to empty main branch
,
!1
High blue rec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/recorder.cpp
+4
-3
4 additions, 3 deletions
src/recorder.cpp
src/recorder.h
+1
-0
1 addition, 0 deletions
src/recorder.h
with
5 additions
and
3 deletions
src/recorder.cpp
+
4
−
3
View file @
0c424f4c
...
@@ -175,19 +175,20 @@ void JasonRecorder::get_samples(std::vector<std::uint8_t> &samples, bool planar,
...
@@ -175,19 +175,20 @@ void JasonRecorder::get_samples(std::vector<std::uint8_t> &samples, bool planar,
if
(
buffer
[
0
]
!=
FRAME_START
);
// invalid message
if
(
buffer
[
0
]
!=
FRAME_START
);
// invalid message
else
if
((((
std
::
uint16_t
)
buffer
[
1
]
<<
8
)
|
(
buffer
[
2
]))
==
DATA_ID
)
{
else
if
((((
std
::
uint16_t
)
buffer
[
1
]
<<
8
)
|
(
buffer
[
2
]))
==
DATA_ID
)
{
// find the beginning and length of the samples in the buffer
// find the beginning and length of the samples in the buffer
size_t
num_samples
=
(
received
-
6
)
/
this
->
depth
;
size_t
start
=
this
->
addtional_data_size
+
6
;
size_t
num_samples
=
(
received
-
start
)
/
this
->
depth
;
num_samples
=
(
num_samples
/
num_channels
)
*
num_channels
*
this
->
depth
;
num_samples
=
(
num_samples
/
num_channels
)
*
num_channels
*
this
->
depth
;
// copy data to provided vector
// copy data to provided vector
if
(
planar
||
(
num_channels
==
1
))
{
if
(
planar
||
(
num_channels
==
1
))
{
// copy out directly
// copy out directly
samples
.
resize
(
0
);
samples
.
resize
(
0
);
samples
.
reserve
(
num_samples
);
samples
.
reserve
(
num_samples
);
samples
.
insert
(
samples
.
end
(),
&
buffer
[
6
],
&
buffer
[
6
]
+
num_samples
);
samples
.
insert
(
samples
.
end
(),
&
buffer
[
start
],
&
buffer
[
start
]
+
num_samples
);
}
}
else
{
else
{
// convert from blocked channels to interleaved channels
// convert from blocked channels to interleaved channels
samples
.
resize
(
num_samples
);
samples
.
resize
(
num_samples
);
JasonRecorder
::
interleave_channels
(
&
buffer
[
6
],
JasonRecorder
::
interleave_channels
(
&
buffer
[
start
],
samples
.
data
(),
num_samples
,
samples
.
data
(),
num_samples
,
this
->
num_channels
,
this
->
depth
);
this
->
num_channels
,
this
->
depth
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/recorder.h
+
1
−
0
View file @
0c424f4c
...
@@ -65,6 +65,7 @@ private:
...
@@ -65,6 +65,7 @@ private:
size_t
receive_message
(
uint8_t
*
buffer
,
size_t
max_wait
=
0
);
size_t
receive_message
(
uint8_t
*
buffer
,
size_t
max_wait
=
0
);
// device state, as far as known
// device state, as far as known
size_t
addtional_data_size
=
1024
;
std
::
uint8_t
num_channels
=
0
;
std
::
uint8_t
num_channels
=
0
;
std
::
uint8_t
depth
=
0
;
std
::
uint8_t
depth
=
0
;
std
::
uint8_t
num_filter
=
0
;
std
::
uint8_t
num_filter
=
0
;
...
...
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