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
3d2393d0
Commit
3d2393d0
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/203/pframeskip' into 'master'
Implements
#203
skipping p-frames Closes
#203
See merge request nicolas.pope/ftl!130
parents
06089003
7cebc7f0
No related branches found
No related tags found
1 merge request
!130
Implements #203 skipping p-frames
Pipeline
#15341
passed
5 years ago
Stage: all
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/rgbd-sources/src/file_source.cpp
+26
-1
26 additions, 1 deletion
components/rgbd-sources/src/file_source.cpp
components/rgbd-sources/src/file_source.hpp
+3
-0
3 additions, 0 deletions
components/rgbd-sources/src/file_source.hpp
with
29 additions
and
1 deletion
components/rgbd-sources/src/file_source.cpp
+
26
−
1
View file @
3d2393d0
#include
"file_source.hpp"
#include
<ftl/timer.hpp>
using
ftl
::
rgbd
::
detail
::
FileSource
;
using
ftl
::
codecs
::
codec_t
;
...
...
@@ -23,6 +25,8 @@ FileSource::FileSource(ftl::rgbd::Source *s, ftl::codecs::Reader *r, int sid) :
decoders_
[
1
]
=
nullptr
;
cache_read_
=
-
1
;
cache_write_
=
0
;
realtime_
=
host_
->
value
(
"realtime"
,
true
);
timestamp_
=
r
->
getStartTime
();
r
->
onPacket
(
sid
,
[
this
](
const
ftl
::
codecs
::
StreamPacket
&
spkt
,
ftl
::
codecs
::
Packet
&
pkt
)
{
if
(
pkt
.
codec
==
codec_t
::
POSE
)
{
...
...
@@ -34,6 +38,12 @@ FileSource::FileSource(ftl::rgbd::Source *s, ftl::codecs::Reader *r, int sid) :
params_
=
*
camera
;
has_calibration_
=
true
;
}
else
{
if
(
pkt
.
codec
==
codec_t
::
HEVC
)
{
// Obtain NAL unit type
int
nal_type
=
(
pkt
.
data
[
4
]
>>
1
)
&
0x3F
;
// A type of 32 = VPS unit, hence I-Frame in this case so skip past packets
if
(
nal_type
==
32
)
_removeChannel
(
spkt
.
channel
);
}
cache_
[
cache_write_
].
emplace_back
();
auto
&
c
=
cache_
[
cache_write_
].
back
();
...
...
@@ -48,8 +58,23 @@ FileSource::~FileSource() {
}
void
FileSource
::
_removeChannel
(
int
channel
)
{
int
c
=
0
;
for
(
auto
i
=
cache_
[
cache_write_
].
begin
();
i
!=
cache_
[
cache_write_
].
end
();
++
i
)
{
if
((
*
i
).
spkt
.
channel
==
channel
)
{
++
c
;
i
=
cache_
[
cache_write_
].
erase
(
i
);
}
}
DLOG
(
INFO
)
<<
"Skipped "
<<
c
<<
" packets"
;
}
bool
FileSource
::
capture
(
int64_t
ts
)
{
timestamp_
=
ts
;
if
(
realtime_
)
{
timestamp_
=
ts
;
}
else
{
timestamp_
+=
ftl
::
timer
::
getInterval
();
}
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
components/rgbd-sources/src/file_source.hpp
+
3
−
0
View file @
3d2393d0
...
...
@@ -41,6 +41,9 @@ class FileSource : public detail::Source {
ftl
::
codecs
::
Decoder
*
decoders_
[
2
];
bool
realtime_
;
void
_removeChannel
(
int
channel
);
void
_createDecoder
(
int
ix
,
const
ftl
::
codecs
::
Packet
&
pkt
);
};
...
...
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