Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
22611dbf
I
ijkplayer
项目概览
qq_25606643
/
ijkplayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
ijkplayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22611dbf
编写于
6月 16, 2015
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ff_ffplay: use SDL_Profiler
上级
8f4bbe2a
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
35 addition
and
30 deletion
+35
-30
ijkmedia/ijkplayer/ff_ffplay.c
ijkmedia/ijkplayer/ff_ffplay.c
+12
-22
ijkmedia/ijkplayer/ff_ffplay.h
ijkmedia/ijkplayer/ff_ffplay.h
+1
-1
ijkmedia/ijkplayer/ff_ffplay_debug.h
ijkmedia/ijkplayer/ff_ffplay_debug.h
+1
-1
ijkmedia/ijkplayer/ff_ffplay_def.h
ijkmedia/ijkplayer/ff_ffplay_def.h
+2
-0
ijkmedia/ijksdl/ijksdl_timer.c
ijkmedia/ijksdl/ijksdl_timer.c
+12
-6
ijkmedia/ijksdl/ijksdl_timer.h
ijkmedia/ijksdl/ijksdl_timer.h
+5
-0
ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj/project.pbxproj
ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj/project.pbxproj
+2
-0
未找到文件。
ijkmedia/ijkplayer/ff_ffplay.c
浏览文件 @
22611dbf
...
...
@@ -46,11 +46,6 @@
#define FFP_IO_STAT_STEP (50 * 1024)
#ifdef FFP_SHOW_VDPS
static
int
g_vdps_counter
=
0
;
static
int64_t
g_vdps_total_time
=
0
;
#endif
static
int
ffp_format_control_message
(
struct
AVFormatContext
*
s
,
int
type
,
void
*
data
,
size_t
data_size
);
...
...
@@ -333,6 +328,8 @@ static void decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue,
d
->
queue
=
queue
;
d
->
empty_queue_cond
=
empty_queue_cond
;
d
->
start_pts
=
AV_NOPTS_VALUE
;
SDL_ProfilerReset
(
&
d
->
decode_profiler
,
-
1
);
}
static
int
decoder_decode_frame
(
FFPlayer
*
ffp
,
Decoder
*
d
,
AVFrame
*
frame
,
AVSubtitle
*
sub
)
{
...
...
@@ -366,26 +363,18 @@ static int decoder_decode_frame(FFPlayer *ffp, Decoder *d, AVFrame *frame, AVSub
switch
(
d
->
avctx
->
codec_type
)
{
case
AVMEDIA_TYPE_VIDEO
:
{
#ifdef FFP_SHOW_VDPS
int64_t
start
=
SDL_GetTickHR
(
);
SDL_ProfilerBegin
(
&
d
->
decode_profiler
);
#endif
ret
=
avcodec_decode_video2
(
d
->
avctx
,
frame
,
&
got_frame
,
&
d
->
pkt_temp
);
#ifdef FFP_SHOW_VDPS
int64_t
dur
=
SDL_GetTickHR
()
-
start
;
g_vdps_total_time
+=
dur
;
g_vdps_counter
++
;
int64_t
avg_frame_time
=
0
;
if
(
g_vdps_counter
>
0
)
avg_frame_time
=
g_vdps_total_time
/
g_vdps_counter
;
double
fps
=
0
;
if
(
avg_frame_time
>
0
)
fps
=
1
.
0
f
/
avg_frame_time
*
1000
;
if
(
dur
>=
30
)
{
ALOGE
(
"vdps: [%f][%d] %"
PRId64
" ms/frame, vdps=%f, +%"
PRId64
"
\n
"
,
frame
->
pts
,
g_vdps_counter
,
(
int64_t
)
avg_frame_time
,
fps
,
dur
);
}
if
(
g_vdps_total_time
>=
FFP_XPS_PERIOD
)
{
g_vdps_total_time
-=
avg_frame_time
;
g_vdps_counter
--
;
int64_t
delta
=
SDL_ProfilerEnd
(
&
d
->
decode_profiler
);
if
(
delta
>=
30
)
{
av_log
(
ffp
,
AV_LOG_DEBUG
,
"vdps[%d]: %"
PRId64
" ms/frame, vdps=%f, +%"
PRId64
"
\n
"
,
d
->
decode_profiler
.
total_counter
,
d
->
decode_profiler
.
average_elapsed
,
d
->
decode_profiler
.
sample_per_seconds
,
delta
);
}
#endif
if
(
got_frame
)
{
...
...
@@ -2110,6 +2099,7 @@ static int stream_component_open(FFPlayer *ffp, int stream_index)
if
(
is
->
video_st
->
avg_frame_rate
.
den
&&
is
->
video_st
->
avg_frame_rate
.
num
)
{
double
fps
=
av_q2d
(
is
->
video_st
->
avg_frame_rate
);
SDL_ProfilerReset
(
&
is
->
viddec
.
decode_profiler
,
fps
+
0
.
5
);
if
(
fps
>
ffp
->
max_fps
&&
fps
<
130
.
0
)
{
is
->
is_video_high_fps
=
1
;
ALOGI
(
"fps: %lf (too high)
\n
"
,
fps
);
...
...
ijkmedia/ijkplayer/ff_ffplay.h
浏览文件 @
22611dbf
...
...
@@ -31,7 +31,7 @@
void
ffp_global_init
();
void
ffp_global_uninit
();
void
ffp_global_set_log_report
(
int
use_report
);
void
ffp_global_set_log_lev
le
(
int
log_leve
);
void
ffp_global_set_log_lev
el
(
int
log_level
);
void
ffp_io_stat_register
(
void
(
*
cb
)(
const
char
*
url
,
int
type
,
int
bytes
));
void
ffp_io_stat_complete_register
(
void
(
*
cb
)(
const
char
*
url
,
int64_t
read_bytes
,
int64_t
total_size
,
...
...
ijkmedia/ijkplayer/ff_ffplay_debug.h
浏览文件 @
22611dbf
...
...
@@ -25,7 +25,7 @@
#define FFP_XPS_PERIOD (3)
// #define FFP_SHOW_FPS
//
#define FFP_SHOW_VDPS
#define FFP_SHOW_VDPS
// #define FFP_SHOW_AUDIO_DELAY
// #define FFP_SHOW_DEMUX_CACHE
// #define FFP_SHOW_BUF_POS
...
...
ijkmedia/ijkplayer/ff_ffplay_def.h
浏览文件 @
22611dbf
...
...
@@ -190,6 +190,8 @@ typedef struct Decoder {
AVRational
next_pts_tb
;
SDL_Thread
*
decoder_tid
;
SDL_Thread
_decoder_tid
;
SDL_Profiler
decode_profiler
;
}
Decoder
;
typedef
struct
VideoState
{
...
...
ijkmedia/ijksdl/ijksdl_timer.c
浏览文件 @
22611dbf
...
...
@@ -94,19 +94,25 @@ void SDL_ProfilerBegin(SDL_Profiler* profiler)
int64_t
SDL_ProfilerEnd
(
SDL_Profiler
*
profiler
)
{
int64_t
delta
=
SDL_GetTickHR
();
int64_t
delta
=
SDL_GetTickHR
()
-
profiler
->
begin_time
;
if
(
profiler
->
max_sample
>
0
)
{
profiler
->
total_elapsed
+=
delta
;
profiler
->
total_counter
+=
1
;
if
(
profiler
->
total_counter
>
profiler
->
max_sample
)
{
profiler
->
total_elapsed
-=
profiler
->
average_elapsed
;
profiler
->
total_counter
-=
1
;
profiler
->
sample_elapsed
+=
delta
;
profiler
->
sample_counter
+=
1
;
if
(
profiler
->
sample_counter
>
profiler
->
max_sample
)
{
profiler
->
sample_elapsed
-=
profiler
->
average_elapsed
;
profiler
->
sample_counter
-=
1
;
}
if
(
profiler
->
total_counter
>
0
)
{
profiler
->
average_elapsed
=
profiler
->
total_elapsed
/
profiler
->
total_counter
;
if
(
profiler
->
sample_counter
>
0
)
{
profiler
->
average_elapsed
=
profiler
->
sample_elapsed
/
profiler
->
sample_counter
;
}
if
(
profiler
->
sample_elapsed
>
0
)
{
profiler
->
sample_per_seconds
=
profiler
->
sample_counter
*
1000
.
f
/
profiler
->
sample_elapsed
;
}
}
...
...
ijkmedia/ijksdl/ijksdl_timer.h
浏览文件 @
22611dbf
...
...
@@ -34,7 +34,12 @@ Uint64 SDL_GetTickHR(void);
typedef
struct
SDL_Profiler
{
int64_t
total_elapsed
;
int
total_counter
;
int64_t
sample_elapsed
;
int
sample_counter
;
float
sample_per_seconds
;
int64_t
average_elapsed
;
int64_t
begin_time
;
int
max_sample
;
...
...
ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj/project.pbxproj
浏览文件 @
22611dbf
...
...
@@ -195,6 +195,7 @@
E690403717EB079500CFD954
/* ijklog.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ijklog.h
;
sourceTree
=
"<group>"
;
};
E690403917EB079500CFD954
/* ijkutil_ios.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ijkutil_ios.h
;
sourceTree
=
"<group>"
;
};
E690403A17EB079500CFD954
/* loghelp.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
loghelp.h
;
sourceTree
=
"<group>"
;
};
E6C2FD391B300A390081D321
/* ff_ffplay_debug.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ff_ffplay_debug.h
;
sourceTree
=
"<group>"
;
};
E6EE92A1187810C5009EAB56
/* IJKAudioKit.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
IJKAudioKit.h
;
path
=
IJKMediaPlayer/IJKAudioKit.h
;
sourceTree
=
"<group>"
;
};
E6EE92A2187810C5009EAB56
/* IJKAudioKit.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
IJKAudioKit.m
;
path
=
IJKMediaPlayer/IJKAudioKit.m
;
sourceTree
=
"<group>"
;
};
E6EE92A61878230C009EAB56
/* ijksdl_aout_ios_audiounit.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ijksdl_aout_ios_audiounit.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -422,6 +423,7 @@
E67B91AD1A3801DB00717EA9
/* ff_ffpipenode.c */
,
E67B91AE1A3801DB00717EA9
/* ff_ffpipenode.h */
,
E6903FDD17EAFC6100CFD954
/* ff_ffplay_config.h */
,
E6C2FD391B300A390081D321
/* ff_ffplay_debug.h */
,
E6903FDE17EAFC6100CFD954
/* ff_ffplay_def.h */
,
E6903FDB17EAFC6100CFD954
/* ff_ffplay.c */
,
E6903FDC17EAFC6100CFD954
/* ff_ffplay.h */
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录