Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
savoirfairelinux
jami-daemon
Commits
fc6f6434
Commit
fc6f6434
authored
2 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
SinkClient: use steady_clock for FPS calculation
Change-Id: Ic14fe56d0223433782d06a97904024b56c9ab732
parent
b1ec634e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/media/video/sinkclient.cpp
+5
-5
5 additions, 5 deletions
src/media/video/sinkclient.cpp
src/media/video/sinkclient.h
+1
-1
1 addition, 1 deletion
src/media/video/sinkclient.h
with
6 additions
and
6 deletions
src/media/video/sinkclient.cpp
+
5
−
5
View file @
fc6f6434
...
...
@@ -330,7 +330,7 @@ SinkClient::SinkClient(const std::string& id, bool mixer)
,
scaler_
(
new
VideoScaler
())
#ifdef DEBUG_FPS
,
frameCount_
(
0u
)
,
lastFrameDebug_
(
std
::
chrono
::
s
ystem
_clock
::
now
())
,
lastFrameDebug_
(
std
::
chrono
::
s
teady
_clock
::
now
())
#endif
{
JAMI_DBG
(
"[Sink:%p] Sink [%s] created"
,
this
,
getId
().
c_str
());
...
...
@@ -416,11 +416,11 @@ SinkClient::update(Observable<std::shared_ptr<MediaFrame>>* /*obs*/,
const
std
::
shared_ptr
<
MediaFrame
>&
frame_p
)
{
#ifdef DEBUG_FPS
auto
currentTime
=
std
::
chrono
::
s
ystem
_clock
::
now
();
std
::
chrono
::
duration
<
double
>
seconds
=
currentTime
-
lastFrameDebug_
;
auto
currentTime
=
std
::
chrono
::
s
teady
_clock
::
now
();
auto
seconds
=
currentTime
-
lastFrameDebug_
;
++
frameCount_
;
if
(
seconds
.
count
()
>
1
)
{
auto
fps
=
frameCount_
/
seconds
.
count
();
if
(
seconds
>
std
::
chrono
::
seconds
(
1
)
)
{
auto
fps
=
frameCount_
/
std
::
chrono
::
duration
<
double
>
(
seconds
)
.
count
();
// Send the framerate in smartInfo
Smartools
::
getInstance
().
setFrameRate
(
id_
,
std
::
to_string
(
fps
));
frameCount_
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/media/video/sinkclient.h
+
1
−
1
View file @
fc6f6434
...
...
@@ -119,7 +119,7 @@ private:
#ifdef DEBUG_FPS
unsigned
frameCount_
;
std
::
chrono
::
time_point
<
std
::
chrono
::
system_clock
>
lastFrameDebug_
;
std
::
chrono
::
steady_clock
::
time_point
lastFrameDebug_
;
#endif
#if HAVE_SHM
...
...
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