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
1736b58d
Commit
1736b58d
authored
Jan 15, 2008
by
Jean-Paul Saman
Committed by
Jean-Paul Saman
Mar 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show statistical information on the rc interface.
parent
e5c5890e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
3 deletions
+100
-3
modules/control/rc.c
modules/control/rc.c
+100
-3
No files found.
modules/control/rc.c
View file @
1736b58d
...
...
@@ -2,7 +2,7 @@
* rc.c : remote control stdin/stdout module for vlc
*****************************************************************************
* Copyright (C) 2004 - 2005 the VideoLAN team
* $Id$
* $Id
: 3ad9247457fa82999bb94df8e702a4811f340ab5
$
*
* Author: Peter Surda <shurdeek@panorama.sth.ac.at>
* Jean-Paul Saman <jpsaman #_at_# m2x _replaceWith#dot_ nl>
...
...
@@ -101,6 +101,10 @@ static int AudioConfig ( vlc_object_t *, char const *,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
Menu
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
Statistics
(
vlc_object_t
*
,
char
const
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
updateStatistics
(
intf_thread_t
*
,
input_item_t
*
);
static
void
checkUpdates
(
intf_thread_t
*
p_intf
,
char
*
psz_arg
);
/* Status Callbacks */
...
...
@@ -122,7 +126,7 @@ struct intf_sys_t
/* status changes */
vlc_mutex_t
status_lock
;
playlist_status_t
i_last_state
;
vlc_bool_t
b_statistics
;
#ifdef WIN32
HANDLE
hConsoleIn
;
vlc_bool_t
b_quiet
;
...
...
@@ -315,6 +319,7 @@ static int Activate( vlc_object_t *p_this )
p_intf
->
p_sys
->
psz_unix_path
=
psz_unix_path
;
vlc_mutex_init
(
p_intf
,
&
p_intf
->
p_sys
->
status_lock
);
p_intf
->
p_sys
->
i_last_state
=
PLAYLIST_STOPPED
;
p_intf
->
p_sys
->
b_statistics
=
VLC_FALSE
;
/* Non-buffered stdout */
setvbuf
(
stdout
,
(
char
*
)
NULL
,
_IOLBF
,
0
);
...
...
@@ -528,6 +533,11 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
var_AddCallback
(
p_intf
,
"adev"
,
AudioConfig
,
NULL
);
var_Create
(
p_intf
,
"achan"
,
VLC_VAR_STRING
|
VLC_VAR_ISCOMMAND
);
var_AddCallback
(
p_intf
,
"achan"
,
AudioConfig
,
NULL
);
/* misc menu commands */
var_Create
(
p_intf
,
"stats"
,
VLC_VAR_BOOL
|
VLC_VAR_ISCOMMAND
);
var_AddCallback
(
p_intf
,
"stats"
,
Statistics
,
NULL
);
}
/*****************************************************************************
...
...
@@ -671,10 +681,16 @@ static void Run( intf_thread_t *p_intf )
}
}
if
(
p_input
&&
p_intf
->
p_sys
->
b_statistics
)
{
vlc_mutex_lock
(
&
p_input
->
input
.
p_item
->
lock
);
updateStatistics
(
p_intf
,
p_input
->
input
.
p_item
);
vlc_mutex_unlock
(
&
p_input
->
input
.
p_item
->
lock
);
}
/* Is there something to do? */
if
(
!
b_complete
)
continue
;
/* Skip heading spaces */
psz_cmd
=
p_buffer
;
while
(
*
psz_cmd
==
' '
)
...
...
@@ -990,6 +1006,7 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
"| [undef] [info] [source] [binary] [plugin]"
));
msg_rc
(
"| "
);
}
msg_rc
(
_
(
"| stats . . . . . . .show statistical information"
));
msg_rc
(
_
(
"| help . . . . . . . . . . . . . this help message"
));
msg_rc
(
_
(
"| longhelp . . . . . . . . . a longer help message"
));
msg_rc
(
_
(
"| logout . . . . . exit (if in socket connection)"
));
...
...
@@ -2217,6 +2234,86 @@ static int Menu( vlc_object_t *p_this, char const *psz_cmd,
return
i_error
;
}
static
int
Statistics
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
p_data
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
input_thread_t
*
p_input
=
NULL
;
int
i_error
;
p_input
=
vlc_object_find
(
p_this
,
VLC_OBJECT_INPUT
,
FIND_ANYWHERE
);
if
(
!
p_input
)
return
VLC_ENOOBJ
;
if
(
!
strcmp
(
psz_cmd
,
"stats"
)
)
{
p_intf
->
p_sys
->
b_statistics
=
!
p_intf
->
p_sys
->
b_statistics
;
if
(
p_intf
->
p_sys
->
b_statistics
)
msg_rc
(
_
(
"statistics update on"
));
else
msg_rc
(
_
(
"statistics update off"
));
}
/*
* sanity check
*/
else
{
msg_rc
(
_
(
"Unknown command!"
)
);
}
vlc_object_release
(
p_input
);
i_error
=
VLC_SUCCESS
;
return
i_error
;
}
static
int
updateStatistics
(
intf_thread_t
*
p_intf
,
input_item_t
*
p_item
)
{
if
(
!
p_item
)
return
VLC_EGENERIC
;
vlc_mutex_lock
(
&
p_item
->
p_stats
->
lock
);
msg_rc
(
"+----[ begin of statistical info ]"
);
/* Input */
msg_rc
(
_
(
"+-[Incoming]"
));
msg_rc
(
_
(
"| input bytes read : %8.0f kB"
),
(
float
)(
p_item
->
p_stats
->
i_read_bytes
)
/
1000
);
msg_rc
(
_
(
"| input bitrate : %6.0f kb/s"
),
(
float
)(
p_item
->
p_stats
->
f_input_bitrate
)
*
8000
);
msg_rc
(
_
(
"| demux bytes read : %8.0f kB"
),
(
float
)(
p_item
->
p_stats
->
i_demux_read_bytes
)
/
1000
);
msg_rc
(
_
(
"| demux bitrate : %6.0f kb/s"
),
(
float
)(
p_item
->
p_stats
->
f_demux_bitrate
)
*
8000
);
msg_rc
(
"|"
);
/* Video */
msg_rc
(
_
(
"+-[Video Decoding]"
));
msg_rc
(
_
(
"| video decoded : %5i"
),
p_item
->
p_stats
->
i_decoded_video
);
msg_rc
(
_
(
"| frames displayed : %5i"
),
p_item
->
p_stats
->
i_displayed_pictures
);
msg_rc
(
_
(
"| frames lost : %5i"
),
p_item
->
p_stats
->
i_lost_pictures
);
msg_rc
(
"|"
);
/* Audio*/
msg_rc
(
_
(
"+-[Audio Decoding]"
));
msg_rc
(
_
(
"| audio decoded : %5i"
),
p_item
->
p_stats
->
i_decoded_audio
);
msg_rc
(
_
(
"| buffers played : %5i"
),
p_item
->
p_stats
->
i_played_abuffers
);
msg_rc
(
_
(
"| buffers lost : %5i"
),
p_item
->
p_stats
->
i_lost_abuffers
);
msg_rc
(
"|"
);
/* Sout */
msg_rc
(
_
(
"+-[Streaming]"
));
msg_rc
(
_
(
"| packets sent : %5i"
),
p_item
->
p_stats
->
i_sent_packets
);
msg_rc
(
_
(
"| bytes sent : %8.0f kB"
),
(
float
)(
p_item
->
p_stats
->
i_sent_bytes
)
/
1000
);
msg_rc
(
_
(
"| sending bitrate : %6.0f kb/s"
),
(
float
)(
p_item
->
p_stats
->
f_send_bitrate
*
8
)
*
1000
);
msg_rc
(
"|"
);
msg_rc
(
"+----[ end of statistical info ]"
);
vlc_mutex_unlock
(
&
p_item
->
p_stats
->
lock
);
}
#ifdef WIN32
vlc_bool_t
ReadWin32
(
intf_thread_t
*
p_intf
,
char
*
p_buffer
,
int
*
pi_size
)
{
...
...
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