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
5c301da9
Commit
5c301da9
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Add channel_count to stream
parent
87939ee4
No related branches found
No related tags found
1 merge request
!127
Implements #196 stream capturing
Pipeline
#15286
passed
5 years ago
Stage: all
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/reconstruct/src/main.cpp
+5
-0
5 additions, 0 deletions
applications/reconstruct/src/main.cpp
components/codecs/include/ftl/codecs/packet.hpp
+8
-5
8 additions, 5 deletions
components/codecs/include/ftl/codecs/packet.hpp
with
13 additions
and
5 deletions
applications/reconstruct/src/main.cpp
+
5
−
0
View file @
5c301da9
...
@@ -166,6 +166,8 @@ static void run(ftl::Configurable *root) {
...
@@ -166,6 +166,8 @@ static void run(ftl::Configurable *root) {
ftl
::
codecs
::
Writer
writer
(
fileout
);
ftl
::
codecs
::
Writer
writer
(
fileout
);
auto
recorder
=
[
&
writer
](
ftl
::
rgbd
::
Source
*
src
,
const
ftl
::
codecs
::
StreamPacket
&
spkt
,
const
ftl
::
codecs
::
Packet
&
pkt
)
{
auto
recorder
=
[
&
writer
](
ftl
::
rgbd
::
Source
*
src
,
const
ftl
::
codecs
::
StreamPacket
&
spkt
,
const
ftl
::
codecs
::
Packet
&
pkt
)
{
LOG
(
INFO
)
<<
"About to write"
;
LOG
(
INFO
)
<<
"About to write"
;
// TODO: Patch spkt with correct streamID
// TODO: Also adapt timestamp inside writer to be file relative
writer
.
write
(
spkt
,
pkt
);
writer
.
write
(
spkt
,
pkt
);
};
};
...
@@ -180,6 +182,9 @@ static void run(ftl::Configurable *root) {
...
@@ -180,6 +182,9 @@ static void run(ftl::Configurable *root) {
fileout
.
open
(
std
::
string
(
timestamp
)
+
".ftl"
);
fileout
.
open
(
std
::
string
(
timestamp
)
+
".ftl"
);
writer
.
begin
();
writer
.
begin
();
// TODO: Write pose+calibration packets
group
.
addRawCallback
(
std
::
function
(
recorder
));
group
.
addRawCallback
(
std
::
function
(
recorder
));
}
else
{
}
else
{
group
.
removeRawCallback
(
recorder
);
group
.
removeRawCallback
(
recorder
);
...
...
This diff is collapsed.
Click to expand it.
components/codecs/include/ftl/codecs/packet.hpp
+
8
−
5
View file @
5c301da9
...
@@ -10,7 +10,9 @@
...
@@ -10,7 +10,9 @@
namespace
ftl
{
namespace
ftl
{
namespace
codecs
{
namespace
codecs
{
/**
* First bytes of our file format.
*/
struct
Header
{
struct
Header
{
const
char
magic
[
4
]
=
{
'F'
,
'T'
,
'L'
,
'F'
};
const
char
magic
[
4
]
=
{
'F'
,
'T'
,
'L'
,
'F'
};
uint8_t
version
;
uint8_t
version
;
...
@@ -27,7 +29,7 @@ struct Packet {
...
@@ -27,7 +29,7 @@ struct Packet {
ftl
::
codecs
::
definition_t
definition
;
ftl
::
codecs
::
definition_t
definition
;
uint8_t
block_total
;
// Packets expected per frame
uint8_t
block_total
;
// Packets expected per frame
uint8_t
block_number
;
// This packets number within a frame
uint8_t
block_number
;
// This packets number within a frame
uint8_t
flags
;
// Codec dependent flags
uint8_t
flags
;
// Codec dependent flags
(eg. I-Frame or P-Frame)
std
::
vector
<
uint8_t
>
data
;
std
::
vector
<
uint8_t
>
data
;
MSGPACK_DEFINE
(
codec
,
definition
,
block_total
,
block_number
,
flags
,
data
);
MSGPACK_DEFINE
(
codec
,
definition
,
block_total
,
block_number
,
flags
,
data
);
...
@@ -41,9 +43,10 @@ struct Packet {
...
@@ -41,9 +43,10 @@ struct Packet {
struct
StreamPacket
{
struct
StreamPacket
{
int64_t
timestamp
;
int64_t
timestamp
;
uint8_t
streamID
;
// Source number...
uint8_t
streamID
;
// Source number...
uint8_t
channel
;
// first bit = channel, second bit indicates second channel being sent
uint8_t
channel_count
;
// Number of channels to expect (usually 1 or 2)
uint8_t
channel
;
// Actual channel of this current set of packets
MSGPACK_DEFINE
(
timestamp
,
streamID
,
channel
);
MSGPACK_DEFINE
(
timestamp
,
streamID
,
channel_count
,
channel
);
};
};
}
}
...
...
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