Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
5bd61a80
Commit
5bd61a80
authored
Jan 21, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Audio - Refs:#473
parent
e328a29d
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
93 additions
and
8 deletions
+93
-8
include/aout_internal.h
include/aout_internal.h
+3
-0
include/vlc_messages.h
include/vlc_messages.h
+4
-0
modules/gui/wxwidgets/dialogs/infopanels.cpp
modules/gui/wxwidgets/dialogs/infopanels.cpp
+29
-0
modules/gui/wxwidgets/dialogs/infopanels.hpp
modules/gui/wxwidgets/dialogs/infopanels.hpp
+6
-2
src/audio_output/dec.c
src/audio_output/dec.c
+11
-0
src/audio_output/input.c
src/audio_output/input.c
+12
-0
src/audio_output/mixer.c
src/audio_output/mixer.c
+10
-0
src/input/input.c
src/input/input.c
+5
-0
src/misc/stats.c
src/misc/stats.c
+13
-6
No files found.
include/aout_internal.h
View file @
5bd61a80
...
...
@@ -150,6 +150,9 @@ struct aout_input_t
* third-party. */
vlc_mutex_t
lock
;
/* The input thread that spawned this input */
input_thread_t
*
p_input_thread
;
audio_sample_format_t
input
;
aout_alloc_t
input_alloc
;
...
...
include/vlc_messages.h
View file @
5bd61a80
...
...
@@ -314,6 +314,10 @@ struct input_stats_t
/* Vout */
int
i_displayed_pictures
;
int
i_lost_pictures
;
/* Aout */
int
i_played_abuffers
;
int
i_lost_abuffers
;
};
VLC_EXPORT
(
void
,
stats_ComputeInputStats
,
(
input_thread_t
*
,
input_stats_t
*
)
);
...
...
modules/gui/wxwidgets/dialogs/infopanels.cpp
View file @
5bd61a80
...
...
@@ -197,6 +197,31 @@ InputStatsInfoPanel::InputStatsInfoPanel( intf_thread_t *_p_intf,
video_bsizer
->
Layout
();
sizer
->
Add
(
video_bsizer
,
0
,
wxALL
|
wxGROW
,
5
);
/* Aout */
wxStaticBox
*
audio_box
=
new
wxStaticBox
(
this
,
-
1
,
wxU
(
_
(
"Audio"
)
)
);
audio_box
->
SetAutoLayout
(
TRUE
);
audio_bsizer
=
new
wxStaticBoxSizer
(
audio_box
,
wxVERTICAL
);
audio_sizer
=
new
wxFlexGridSizer
(
2
,
3
,
20
);
#define AUDIO_ADD(txt,widget,dflt) \
{ audio_sizer->Add ( new wxStaticText( this, -1, wxU(_( txt ) ) ), \
0, wxEXPAND|wxLEFT , 5 ); \
widget = new wxStaticText( this, -1, wxU( dflt ) ); \
audio_sizer->Add( widget, 0, wxEXPAND|wxRIGHT, 5 ); \
}
AUDIO_ADD
(
"Decoded blocks"
,
audio_decoded_text
,
"0"
);
/* Hack to get enough size */
AUDIO_ADD
(
"Played buffers"
,
played_abuffers_text
,
"0 "
);
AUDIO_ADD
(
"Lost buffers"
,
lost_abuffers_text
,
"0"
);
audio_sizer
->
Layout
();
audio_bsizer
->
Add
(
audio_sizer
,
0
,
wxALL
|
wxGROW
,
5
);
audio_bsizer
->
Layout
();
sizer
->
Add
(
audio_bsizer
,
0
,
wxALL
|
wxGROW
,
5
);
sizer
->
Layout
();
panel_sizer
->
Add
(
sizer
,
0
,
wxEXPAND
,
5
);
panel_sizer
->
Layout
();
...
...
@@ -228,6 +253,10 @@ void InputStatsInfoPanel::Update( input_item_t *p_item )
UPDATE
(
displayed_text
,
"%5i"
,
p_item
->
p_stats
->
i_displayed_pictures
);
UPDATE
(
lost_frames_text
,
"%5i"
,
p_item
->
p_stats
->
i_lost_pictures
);
UPDATE
(
audio_decoded_text
,
"%5i"
,
p_item
->
p_stats
->
i_decoded_audio
);
UPDATE
(
played_abuffers_text
,
"%5i"
,
p_item
->
p_stats
->
i_played_abuffers
);
UPDATE
(
lost_abuffers_text
,
"%5i"
,
p_item
->
p_stats
->
i_lost_abuffers
);
vlc_mutex_unlock
(
&
p_item
->
p_stats
->
lock
);
input_sizer
->
Layout
();
...
...
modules/gui/wxwidgets/dialogs/infopanels.hpp
View file @
5bd61a80
...
...
@@ -86,7 +86,6 @@ private:
wxFlexGridSizer
*
input_sizer
;
wxStaticBoxSizer
*
input_bsizer
;
wxStaticText
*
read_bytes_text
;
wxStaticText
*
input_bitrate_text
;
wxStaticText
*
demux_bytes_text
;
...
...
@@ -94,10 +93,15 @@ private:
wxFlexGridSizer
*
video_sizer
;
wxStaticBoxSizer
*
video_bsizer
;
wxStaticText
*
video_decoded_text
;
wxStaticText
*
displayed_text
;
wxStaticText
*
lost_frames_text
;
wxFlexGridSizer
*
audio_sizer
;
wxStaticBoxSizer
*
audio_bsizer
;
wxStaticText
*
audio_decoded_text
;
wxStaticText
*
played_abuffers_text
;
wxStaticText
*
lost_abuffers_text
;
};
};
#endif
src/audio_output/dec.c
View file @
5bd61a80
...
...
@@ -134,12 +134,14 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
{
p_input
->
i_pts_delay
=
p_input_thread
->
i_pts_delay
;
p_input
->
i_pts_delay
+=
p_input
->
i_desync
;
p_input
->
p_input_thread
=
p_input_thread
;
vlc_object_release
(
p_input_thread
);
}
else
{
p_input
->
i_pts_delay
=
DEFAULT_PTS_DELAY
;
p_input
->
i_pts_delay
+=
p_input
->
i_desync
;
p_input
->
p_input_thread
=
NULL
;
}
return
p_input
;
...
...
@@ -308,6 +310,10 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
{
msg_Warn
(
p_aout
,
"received buffer in the future ("
I64Fd
")"
,
p_buffer
->
start_date
-
mdate
());
if
(
p_input
->
p_input_thread
)
{
stats_UpdateInteger
(
p_input
->
p_input_thread
,
"lost_abuffers"
,
1
);
}
aout_BufferFree
(
p_buffer
);
return
-
1
;
}
...
...
@@ -358,6 +364,11 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
/* Run the mixer if it is able to run. */
vlc_mutex_lock
(
&
p_aout
->
mixer_lock
);
aout_MixerRun
(
p_aout
);
if
(
p_input
->
p_input_thread
)
{
stats_UpdateInteger
(
p_input
->
p_input_thread
,
"played_abuffers"
,
1
);
}
vlc_mutex_unlock
(
&
p_aout
->
mixer_lock
);
return
0
;
...
...
src/audio_output/input.c
View file @
5bd61a80
...
...
@@ -445,6 +445,10 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
p_input
->
pp_resamplers
[
0
]
->
b_continuity
=
VLC_FALSE
;
}
start_date
=
0
;
if
(
p_input
->
p_input_thread
)
{
stats_UpdateInteger
(
p_input
->
p_input_thread
,
"lost_abuffers"
,
1
);
}
}
if
(
p_buffer
->
start_date
<
mdate
()
+
AOUT_MIN_PREPARE_TIME
)
...
...
@@ -453,6 +457,10 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
* can't present it anyway, so drop the buffer. */
msg_Warn
(
p_aout
,
"PTS is out of range ("
I64Fd
"), dropping buffer"
,
mdate
()
-
p_buffer
->
start_date
);
if
(
p_input
->
p_input_thread
)
{
stats_UpdateInteger
(
p_input
->
p_input_thread
,
"lost_abuffers"
,
1
);
}
aout_BufferFree
(
p_buffer
);
p_input
->
i_resampling_type
=
AOUT_RESAMPLING_NONE
;
if
(
p_input
->
i_nb_resamplers
!=
0
)
...
...
@@ -490,6 +498,10 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
msg_Warn
(
p_aout
,
"audio drift is too big ("
I64Fd
"), dropping buffer"
,
start_date
-
p_buffer
->
start_date
);
aout_BufferFree
(
p_buffer
);
if
(
p_input
->
p_input_thread
)
{
stats_UpdateInteger
(
p_input
->
p_input_thread
,
"lost_abuffers"
,
1
);
}
return
0
;
}
...
...
src/audio_output/mixer.c
View file @
5bd61a80
...
...
@@ -140,6 +140,11 @@ static int MixBuffer( aout_instance_t * p_aout )
"trashing"
,
mdate
()
-
p_buffer
->
start_date
);
p_buffer
=
aout_FifoPop
(
p_aout
,
p_fifo
);
aout_BufferFree
(
p_buffer
);
if
(
p_input
->
p_input_thread
)
{
// stats_UpdateInteger( p_input->p_input_thread,
// "lost_abuffers", 1 );
}
p_buffer
=
p_fifo
->
p_first
;
p_input
->
p_first_byte_to_mix
=
NULL
;
}
...
...
@@ -197,6 +202,11 @@ static int MixBuffer( aout_instance_t * p_aout )
msg_Warn
(
p_aout
,
"the mixer got a packet in the past ("
I64Fd
")"
,
start_date
-
p_buffer
->
end_date
);
aout_BufferFree
(
p_buffer
);
if
(
p_input
->
p_input_thread
)
{
// stats_UpdateInteger( p_input->p_input_thread,
// "lost_abuffers", 1 );
}
p_fifo
->
p_first
=
p_buffer
=
p_next
;
p_input
->
p_first_byte_to_mix
=
NULL
;
}
...
...
src/input/input.c
View file @
5bd61a80
...
...
@@ -683,6 +683,7 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
*/
if
(
!
b_quick
)
{
/* Prepare statistics */
counter_t
*
p_counter
;
stats_Create
(
p_input
,
"read_bytes"
,
VLC_VAR_INTEGER
,
STATS_COUNTER
);
stats_Create
(
p_input
,
"read_packets"
,
VLC_VAR_INTEGER
,
STATS_COUNTER
);
...
...
@@ -698,6 +699,10 @@ static int Init( input_thread_t * p_input, vlc_bool_t b_quick )
"demux_bitrate"
);
if
(
p_counter
)
p_counter
->
update_interval
=
1000000
;
stats_Create
(
p_input
,
"played_abuffers"
,
VLC_VAR_INTEGER
,
STATS_COUNTER
);
stats_Create
(
p_input
,
"lost_abuffers"
,
VLC_VAR_INTEGER
,
STATS_COUNTER
);
/* handle sout */
psz
=
var_GetString
(
p_input
,
"sout"
);
if
(
*
psz
&&
strncasecmp
(
p_input
->
input
.
p_item
->
psz_uri
,
"vlc:"
,
4
)
)
{
...
...
src/misc/stats.c
View file @
5bd61a80
...
...
@@ -138,7 +138,6 @@ int __stats_Update( vlc_object_t *p_this, char *psz_name, vlc_value_t val )
if
(
!
p_handler
)
return
VLC_ENOMEM
;
vlc_mutex_lock
(
&
p_handler
->
object_lock
);
/* Look for existing element */
p_counter
=
GetCounter
(
p_handler
,
p_this
->
i_object_id
,
psz_name
);
...
...
@@ -177,7 +176,6 @@ int __stats_Get( vlc_object_t *p_this, int i_object_id, char *psz_name, vlc_valu
if
(
!
p_handler
)
return
VLC_ENOMEM
;
vlc_mutex_lock
(
&
p_handler
->
object_lock
);
/* Look for existing element */
p_counter
=
GetCounter
(
p_handler
,
i_object_id
,
psz_name
);
...
...
@@ -292,6 +290,12 @@ void stats_ComputeInputStats( input_thread_t *p_input,
stats_GetInteger
(
p_input
,
p_input
->
i_object_id
,
"decoded_audio"
,
&
p_stats
->
i_decoded_audio
);
/* Aout - We store in p_input because aout is shared */
stats_GetInteger
(
p_input
,
p_input
->
i_object_id
,
"played_abuffers"
,
&
p_stats
->
i_played_abuffers
);
stats_GetInteger
(
p_input
,
p_input
->
i_object_id
,
"lost_abuffers"
,
&
p_stats
->
i_lost_abuffers
);
/* Vouts */
p_list
=
vlc_list_find
(
p_input
,
VLC_OBJECT_VOUT
,
FIND_CHILD
);
if
(
p_list
)
...
...
@@ -311,6 +315,7 @@ void stats_ComputeInputStats( input_thread_t *p_input,
}
vlc_list_release
(
p_list
);
}
vlc_mutex_unlock
(
&
p_stats
->
lock
);
}
...
...
@@ -321,6 +326,7 @@ void stats_ReinitInputStats( input_stats_t *p_stats )
p_stats
->
i_demux_read_packets
=
p_stats
->
i_demux_read_bytes
=
p_stats
->
f_demux_bitrate
=
p_stats
->
f_average_demux_bitrate
=
p_stats
->
i_displayed_pictures
=
p_stats
->
i_lost_pictures
=
p_stats
->
i_played_abuffers
=
p_stats
->
i_lost_abuffers
=
p_stats
->
i_decoded_video
=
p_stats
->
i_decoded_audio
=
0
;
}
...
...
@@ -329,13 +335,14 @@ void stats_DumpInputStats( input_stats_t *p_stats )
vlc_mutex_lock
(
&
p_stats
->
lock
);
/* f_bitrate is in bytes / microsecond
* *1000 => bytes / millisecond => kbytes / seconds */
fprintf
(
stderr
,
"Input : %i (%i bytes) - %f kB/s - "
"
Demux : %i (%i bytes) - %f kB/s - V
out : %i/%i
\n
"
,
fprintf
(
stderr
,
"Input : %i (%i bytes) - %f kB/s -
Demux : %i (%i bytes) - %f kB/s
\n
"
"
- Vout : %i/%i - A
out : %i/%i
\n
"
,
p_stats
->
i_read_packets
,
p_stats
->
i_read_bytes
,
p_stats
->
f_input_bitrate
*
1000
,
p_stats
->
i_demux_read_packets
,
p_stats
->
i_demux_read_bytes
,
p_stats
->
f_demux_bitrate
*
1000
,
p_stats
->
i_displayed_pictures
,
p_stats
->
i_lost_pictures
);
p_stats
->
i_displayed_pictures
,
p_stats
->
i_lost_pictures
,
p_stats
->
i_played_abuffers
,
p_stats
->
i_lost_abuffers
);
vlc_mutex_unlock
(
&
p_stats
->
lock
);
}
...
...
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