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
7c359c66
Commit
7c359c66
authored
May 23, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transcode: Measure the time taken to encode one audio or video frame.
parent
8fe54e49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
0 deletions
+54
-0
include/vlc_messages.h
include/vlc_messages.h
+2
-0
modules/stream_out/transcode.c
modules/stream_out/transcode.c
+52
-0
No files found.
include/vlc_messages.h
View file @
7c359c66
...
@@ -177,6 +177,8 @@ enum
...
@@ -177,6 +177,8 @@ enum
STATS_TIMER_PREPARSE
,
STATS_TIMER_PREPARSE
,
STATS_TIMER_INPUT_LAUNCHING
,
STATS_TIMER_INPUT_LAUNCHING
,
STATS_TIMER_MODULE_NEED
,
STATS_TIMER_MODULE_NEED
,
STATS_TIMER_VIDEO_FRAME_ENCODING
,
STATS_TIMER_AUDIO_FRAME_ENCODING
,
STATS_TIMER_SKINS_PLAYTREE_IMAGE
,
STATS_TIMER_SKINS_PLAYTREE_IMAGE
,
};
};
...
...
modules/stream_out/transcode.c
View file @
7c359c66
...
@@ -1221,9 +1221,47 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
...
@@ -1221,9 +1221,47 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
/****************************************************************************
* decoder helper
****************************************************************************/
static
inline
void
video_timer_start
(
encoder_t
*
p_encoder
)
{
stats_TimerStart
(
p_encoder
,
"encoding video frame"
,
STATS_TIMER_VIDEO_FRAME_ENCODING
);
}
static
inline
void
video_timer_stop
(
encoder_t
*
p_encoder
)
{
stats_TimerStop
(
p_encoder
,
STATS_TIMER_VIDEO_FRAME_ENCODING
);
}
static
inline
void
video_timer_close
(
encoder_t
*
p_encoder
)
{
stats_TimerDump
(
p_encoder
,
STATS_TIMER_VIDEO_FRAME_ENCODING
);
stats_TimerClean
(
p_encoder
,
STATS_TIMER_VIDEO_FRAME_ENCODING
);
}
static
inline
void
audio_timer_start
(
encoder_t
*
p_encoder
)
{
stats_TimerStart
(
p_encoder
,
"encoding audio frame"
,
STATS_TIMER_AUDIO_FRAME_ENCODING
);
}
static
inline
void
audio_timer_stop
(
encoder_t
*
p_encoder
)
{
stats_TimerStop
(
p_encoder
,
STATS_TIMER_AUDIO_FRAME_ENCODING
);
}
static
inline
void
audio_timer_close
(
encoder_t
*
p_encoder
)
{
stats_TimerDump
(
p_encoder
,
STATS_TIMER_AUDIO_FRAME_ENCODING
);
stats_TimerClean
(
p_encoder
,
STATS_TIMER_AUDIO_FRAME_ENCODING
);
}
/****************************************************************************
/****************************************************************************
* decoder reencoder part
* decoder reencoder part
****************************************************************************/
****************************************************************************/
static
int
audio_BitsPerSample
(
vlc_fourcc_t
i_format
)
static
int
audio_BitsPerSample
(
vlc_fourcc_t
i_format
)
{
{
switch
(
i_format
)
switch
(
i_format
)
...
@@ -1500,6 +1538,8 @@ static void transcode_audio_close( sout_stream_id_t *id )
...
@@ -1500,6 +1538,8 @@ static void transcode_audio_close( sout_stream_id_t *id )
{
{
int
i
;
int
i
;
audio_timer_close
(
id
->
p_encoder
);
/* Close decoder */
/* Close decoder */
if
(
id
->
p_decoder
->
p_module
)
if
(
id
->
p_decoder
->
p_module
)
module_Unneed
(
id
->
p_decoder
,
id
->
p_decoder
->
p_module
);
module_Unneed
(
id
->
p_decoder
,
id
->
p_decoder
->
p_module
);
...
@@ -1592,7 +1632,10 @@ static int transcode_audio_process( sout_stream_t *p_stream,
...
@@ -1592,7 +1632,10 @@ static int transcode_audio_process( sout_stream_t *p_stream,
p_audio_buf
->
start_date
=
p_audio_block
->
i_dts
;
p_audio_buf
->
start_date
=
p_audio_block
->
i_dts
;
p_audio_buf
->
end_date
=
p_audio_block
->
i_dts
+
p_audio_block
->
i_length
;
p_audio_buf
->
end_date
=
p_audio_block
->
i_dts
+
p_audio_block
->
i_length
;
audio_timer_start
(
id
->
p_encoder
);
p_block
=
id
->
p_encoder
->
pf_encode_audio
(
id
->
p_encoder
,
p_audio_buf
);
p_block
=
id
->
p_encoder
->
pf_encode_audio
(
id
->
p_encoder
,
p_audio_buf
);
audio_timer_stop
(
id
->
p_encoder
);
block_ChainAppend
(
out
,
p_block
);
block_ChainAppend
(
out
,
p_block
);
block_Release
(
p_audio_block
);
block_Release
(
p_audio_block
);
free
(
p_audio_buf
);
free
(
p_audio_buf
);
...
@@ -2146,6 +2189,8 @@ static void transcode_video_close( sout_stream_t *p_stream,
...
@@ -2146,6 +2189,8 @@ static void transcode_video_close( sout_stream_t *p_stream,
vlc_cond_destroy
(
&
p_stream
->
p_sys
->
cond
);
vlc_cond_destroy
(
&
p_stream
->
p_sys
->
cond
);
}
}
video_timer_close
(
id
->
p_encoder
);
/* Close decoder */
/* Close decoder */
if
(
id
->
p_decoder
->
p_module
)
if
(
id
->
p_decoder
->
p_module
)
module_Unneed
(
id
->
p_decoder
,
id
->
p_decoder
->
p_module
);
module_Unneed
(
id
->
p_decoder
,
id
->
p_decoder
->
p_module
);
...
@@ -2455,7 +2500,11 @@ static int transcode_video_process( sout_stream_t *p_stream,
...
@@ -2455,7 +2500,11 @@ static int transcode_video_process( sout_stream_t *p_stream,
if
(
p_sys
->
i_threads
==
0
)
if
(
p_sys
->
i_threads
==
0
)
{
{
block_t
*
p_block
;
block_t
*
p_block
;
video_timer_start
(
id
->
p_encoder
);
p_block
=
id
->
p_encoder
->
pf_encode_video
(
id
->
p_encoder
,
p_pic
);
p_block
=
id
->
p_encoder
->
pf_encode_video
(
id
->
p_encoder
,
p_pic
);
video_timer_stop
(
id
->
p_encoder
);
block_ChainAppend
(
out
,
p_block
);
block_ChainAppend
(
out
,
p_block
);
}
}
...
@@ -2552,7 +2601,10 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
...
@@ -2552,7 +2601,10 @@ static int EncoderThread( sout_stream_sys_t *p_sys )
p_sys
->
i_first_pic
%=
PICTURE_RING_SIZE
;
p_sys
->
i_first_pic
%=
PICTURE_RING_SIZE
;
vlc_mutex_unlock
(
&
p_sys
->
lock_out
);
vlc_mutex_unlock
(
&
p_sys
->
lock_out
);
video_timer_start
(
id
->
p_encoder
);
p_block
=
id
->
p_encoder
->
pf_encode_video
(
id
->
p_encoder
,
p_pic
);
p_block
=
id
->
p_encoder
->
pf_encode_video
(
id
->
p_encoder
,
p_pic
);
video_timer_stop
(
id
->
p_encoder
);
vlc_mutex_lock
(
&
p_sys
->
lock_out
);
vlc_mutex_lock
(
&
p_sys
->
lock_out
);
block_ChainAppend
(
&
p_sys
->
p_buffers
,
p_block
);
block_ChainAppend
(
&
p_sys
->
p_buffers
,
p_block
);
...
...
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