Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2bffade0
Commit
2bffade0
authored
Aug 01, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved out video statistics to its own file and use a dedicated lock.
parent
a7a12139
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
15 deletions
+76
-15
src/Makefile.am
src/Makefile.am
+1
-0
src/video_output/statistic.h
src/video_output/statistic.h
+65
-0
src/video_output/video_output.c
src/video_output/video_output.c
+8
-13
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+2
-2
No files found.
src/Makefile.am
View file @
2bffade0
...
...
@@ -346,6 +346,7 @@ SOURCES_libvlc_common = \
input/var.c
\
video_output/snapshot.c
\
video_output/snapshot.h
\
video_output/statistic.h
\
video_output/video_output.c
\
video_output/vout_pictures.c
\
video_output/vout_pictures.h
\
...
...
src/video_output/statistic.h
0 → 100644
View file @
2bffade0
/*****************************************************************************
* statistic.c : vout statistic
*****************************************************************************
* Copyright (C) 2009 Laurent Aimar
* $Id$
*
* Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
# error This header file can only be included from LibVLC.
#endif
#ifndef _VOUT_STATISTIC_H
#define _VOUT_STATISTIC_H
typedef
struct
{
vlc_spinlock_t
spin
;
int
displayed
;
int
lost
;
}
vout_statistic_t
;
static
inline
void
vout_statistic_Init
(
vout_statistic_t
*
stat
)
{
vlc_spin_init
(
&
stat
->
spin
);
}
static
inline
void
vout_statistic_Clean
(
vout_statistic_t
*
stat
)
{
vlc_spin_destroy
(
&
stat
->
spin
);
}
static
inline
void
vout_statistic_GetReset
(
vout_statistic_t
*
stat
,
int
*
displayed
,
int
*
lost
)
{
vlc_spin_lock
(
&
stat
->
spin
);
*
displayed
=
stat
->
displayed
;
*
lost
=
stat
->
lost
;
stat
->
displayed
=
0
;
stat
->
lost
=
0
;
vlc_spin_unlock
(
&
stat
->
spin
);
}
static
inline
void
vout_statistic_Update
(
vout_statistic_t
*
stat
,
int
displayed
,
int
lost
)
{
vlc_spin_lock
(
&
stat
->
spin
);
stat
->
displayed
+=
displayed
;
stat
->
lost
+=
lost
;
vlc_spin_unlock
(
&
stat
->
spin
);
}
#endif
src/video_output/video_output.c
View file @
2bffade0
...
...
@@ -384,8 +384,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
p_vout
->
i_alignment
=
0
;
p_vout
->
p
->
render_time
=
10
;
p_vout
->
p
->
c_fps_samples
=
0
;
p_vout
->
p
->
i_picture_lost
=
0
;
p_vout
->
p
->
i_picture_displayed
=
0
;
vout_statistic_Init
(
&
p_vout
->
p
->
statistic
);
p_vout
->
p
->
b_filter_change
=
0
;
p_vout
->
p
->
b_paused
=
false
;
p_vout
->
p
->
i_pause_date
=
0
;
...
...
@@ -585,6 +584,9 @@ static void vout_Destructor( vlc_object_t * p_this )
vlc_mutex_destroy
(
&
p_vout
->
change_lock
);
vlc_mutex_destroy
(
&
p_vout
->
p
->
vfilter_lock
);
/* */
vout_statistic_Clean
(
&
p_vout
->
p
->
statistic
);
/* */
vout_snapshot_Clean
(
&
p_vout
->
p
->
snapshot
);
...
...
@@ -652,15 +654,8 @@ void vout_ChangePause( vout_thread_t *p_vout, bool b_paused, mtime_t i_date )
void
vout_GetResetStatistic
(
vout_thread_t
*
p_vout
,
int
*
pi_displayed
,
int
*
pi_lost
)
{
vlc_mutex_lock
(
&
p_vout
->
change_lock
);
*
pi_displayed
=
p_vout
->
p
->
i_picture_displayed
;
*
pi_lost
=
p_vout
->
p
->
i_picture_lost
;
p_vout
->
p
->
i_picture_displayed
=
0
;
p_vout
->
p
->
i_picture_lost
=
0
;
vlc_mutex_unlock
(
&
p_vout
->
change_lock
);
vout_statistic_GetReset
(
&
p_vout
->
p
->
statistic
,
pi_displayed
,
pi_lost
);
}
void
vout_Flush
(
vout_thread_t
*
p_vout
,
mtime_t
i_date
)
...
...
@@ -1052,7 +1047,7 @@ static void* RunThread( void *p_this )
/* Picture is late: it will be destroyed and the thread
* will directly choose the next picture */
vout_UsePictureLocked
(
p_vout
,
p_pic
);
p_vout
->
p
->
i_picture_lost
++
;
vout_statistic_Update
(
&
p_vout
->
p
->
statistic
,
0
,
1
)
;
msg_Warn
(
p_vout
,
"late picture skipped (%"
PRId64
" > %d)"
,
current_date
-
p_pic
->
date
,
-
p_vout
->
p
->
render_time
);
...
...
@@ -1167,7 +1162,7 @@ static void* RunThread( void *p_this )
/*
* Perform rendering
*/
p_vout
->
p
->
i_picture_displayed
++
;
vout_statistic_Update
(
&
p_vout
->
p
->
statistic
,
1
,
0
)
;
p_directbuffer
=
vout_RenderPicture
(
p_vout
,
p_filtered_picture
,
p_subpic
,
spu_render_time
);
...
...
src/video_output/vout_internal.h
View file @
2bffade0
...
...
@@ -32,6 +32,7 @@
#include "vout_control.h"
#include "snapshot.h"
#include "statistic.h"
/* Number of pictures required to computes the FPS rate */
#define VOUT_FPS_SAMPLES 20
...
...
@@ -72,8 +73,7 @@ struct vout_thread_sys_t
mtime_t
p_fps_sample
[
VOUT_FPS_SAMPLES
];
/**< FPS samples dates */
/* Statistics */
int
i_picture_lost
;
int
i_picture_displayed
;
vout_statistic_t
statistic
;
/* Pause */
bool
b_paused
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment