Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
21c39c54
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,体验更适合开发者的 AI 搜索 >>
提交
21c39c54
编写于
6月 02, 2016
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ios: add some statistic
上级
423bc240
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
0 deletion
+40
-0
ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMonitor.h
ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMonitor.h
+10
-0
ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMoviePlayerController.m
...JKMediaPlayer/IJKMediaPlayer/IJKFFMoviePlayerController.m
+30
-0
未找到文件。
ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMonitor.h
浏览文件 @
21c39c54
...
...
@@ -45,5 +45,15 @@
@property
(
nonatomic
)
int
httpCode
;
@property
(
nonatomic
)
int64_t
httpOpenTick
;
@property
(
nonatomic
)
int64_t
httpSeekTick
;
@property
(
nonatomic
)
int
httpOpenCount
;
@property
(
nonatomic
)
int
httpSeekCount
;
@property
(
nonatomic
)
int64_t
lastHttpOpenDuration
;
@property
(
nonatomic
)
int64_t
lastHttpSeekDuration
;
@property
(
nonatomic
)
int64_t
prepareStartTick
;
@property
(
nonatomic
)
int64_t
prepareDuration
;
@property
(
nonatomic
)
int64_t
firstVideoFrameLatency
;
@property
(
nonatomic
)
int64_t
lastPrerollStartTick
;
@property
(
nonatomic
)
int64_t
lastPrerollDuration
;
@end
ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMoviePlayerController.m
浏览文件 @
21c39c54
...
...
@@ -200,6 +200,11 @@ void IJKFFIOStatCompleteRegister(void (*cb)(const char *url,
[
_glView
setHudValue
:
nil
forKey
:
@"ip"
];
[
_glView
setHudValue
:
nil
forKey
:
@"http"
];
[
_glView
setHudValue
:
nil
forKey
:
@"tcp-spd"
];
[
_glView
setHudValue
:
nil
forKey
:
@"t-prepared"
];
[
_glView
setHudValue
:
nil
forKey
:
@"t-render"
];
[
_glView
setHudValue
:
nil
forKey
:
@"t-preroll"
];
[
_glView
setHudValue
:
nil
forKey
:
@"t-http-open"
];
[
_glView
setHudValue
:
nil
forKey
:
@"t-http-seek"
];
self
.
shouldShowHudView
=
options
.
showHudView
;
...
...
@@ -261,6 +266,8 @@ void IJKFFIOStatCompleteRegister(void (*cb)(const char *url,
ijkmp_set_data_source
(
_mediaPlayer
,
[
_urlString
UTF8String
]);
ijkmp_set_option
(
_mediaPlayer
,
IJKMP_OPT_CATEGORY_FORMAT
,
"safe"
,
"0"
);
// for concat demuxer
_monitor
.
prepareStartTick
=
(
int64_t
)
SDL_GetTickHR
();
ijkmp_prepare_async
(
_mediaPlayer
);
}
...
...
@@ -737,6 +744,18 @@ inline static NSString *formatedSpeed(int64_t bytes, int64_t elapsed_milli) {
int64_t
tcpSpeed
=
ijkmp_get_property_int64
(
_mediaPlayer
,
FFP_PROP_INT64_TCP_SPEED
,
0
);
[
_glView
setHudValue
:[
NSString
stringWithFormat
:
@"%@"
,
formatedSpeed
(
tcpSpeed
,
1000
)]
forKey:
@"tcp-spd"
];
[
_glView
setHudValue
:
formatedDurationMilli
(
_monitor
.
prepareDuration
)
forKey
:
@"t-prepared"
];
[
_glView
setHudValue
:
formatedDurationMilli
(
_monitor
.
firstVideoFrameLatency
)
forKey
:
@"t-render"
];
[
_glView
setHudValue
:
formatedDurationMilli
(
_monitor
.
lastPrerollDuration
)
forKey
:
@"t-preroll"
];
[
_glView
setHudValue
:[
NSString
stringWithFormat
:
@"%@ / %d"
,
formatedDurationMilli
(
_monitor
.
lastHttpOpenDuration
),
_monitor
.
httpOpenCount
]
forKey:
@"t-http-open"
];
[
_glView
setHudValue
:[
NSString
stringWithFormat
:
@"%@ / %d"
,
formatedDurationMilli
(
_monitor
.
lastHttpSeekDuration
),
_monitor
.
httpSeekCount
]
forKey:
@"t-http-seek"
];
}
-
(
void
)
startHudTimer
...
...
@@ -855,6 +874,8 @@ inline static void fillMetaInternal(NSMutableDictionary *meta, IjkMediaMeta *raw
case
FFP_MSG_PREPARED
:
{
NSLog
(
@"FFP_MSG_PREPARED:
\n
"
);
_monitor
.
prepareDuration
=
(
int64_t
)
SDL_GetTickHR
()
-
_monitor
.
prepareStartTick
;
IjkMediaMeta
*
rawMeta
=
ijkmp_get_meta_l
(
_mediaPlayer
);
if
(
rawMeta
)
{
ijkmeta_lock
(
rawMeta
);
...
...
@@ -975,6 +996,8 @@ inline static void fillMetaInternal(NSMutableDictionary *meta, IjkMediaMeta *raw
case
FFP_MSG_BUFFERING_START
:
{
NSLog
(
@"FFP_MSG_BUFFERING_START:
\n
"
);
_monitor
.
lastPrerollStartTick
=
(
int64_t
)
SDL_GetTickHR
();
_loadState
=
IJKMPMovieLoadStateStalled
;
[[
NSNotificationCenter
defaultCenter
]
...
...
@@ -985,6 +1008,8 @@ inline static void fillMetaInternal(NSMutableDictionary *meta, IjkMediaMeta *raw
case
FFP_MSG_BUFFERING_END
:
{
NSLog
(
@"FFP_MSG_BUFFERING_END:
\n
"
);
_monitor
.
lastPrerollDuration
=
(
int64_t
)
SDL_GetTickHR
()
-
_monitor
.
lastPrerollStartTick
;
_loadState
=
IJKMPMovieLoadStatePlayable
|
IJKMPMovieLoadStatePlaythroughOK
;
[[
NSNotificationCenter
defaultCenter
]
...
...
@@ -1032,6 +1057,7 @@ inline static void fillMetaInternal(NSMutableDictionary *meta, IjkMediaMeta *raw
}
case
FFP_MSG_VIDEO_RENDERING_START
:
{
NSLog
(
@"FFP_MSG_VIDEO_RENDERING_START:
\n
"
);
_monitor
.
firstVideoFrameLatency
=
(
int64_t
)
SDL_GetTickHR
()
-
_monitor
.
prepareStartTick
;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName:
IJKMPMoviePlayerFirstVideoFrameRenderedNotification
object:
self
];
...
...
@@ -1194,11 +1220,13 @@ static int onInjectOnHttpEvent(IJKFFMoviePlayerController *mpc, int type, void *
case
IJKAVINJECT_DID_HTTP_OPEN
:
monitor
.
httpError
=
realData
->
error
;
monitor
.
httpCode
=
realData
->
http_code
;
monitor
.
httpOpenCount
++
;
[
mpc
->
_glView
setHudValue
:
@
(
realData
->
http_code
).
stringValue
forKey
:
@"http"
];
if
(
delegate
!=
nil
)
{
int64_t
elapsed
=
calculateElapsed
(
monitor
.
httpOpenTick
,
SDL_GetTickHR
());
monitor
.
httpOpenTick
=
0
;
monitor
.
lastHttpOpenDuration
=
elapsed
;
dict
[
IJKMediaEventAttrKey_time_of_event
]
=
@
(
elapsed
).
stringValue
;
dict
[
IJKMediaEventAttrKey_url
]
=
[
NSString
ijk_stringBeEmptyIfNil
:
monitor
.
httpUrl
];
...
...
@@ -1220,11 +1248,13 @@ static int onInjectOnHttpEvent(IJKFFMoviePlayerController *mpc, int type, void *
case
IJKAVINJECT_DID_HTTP_SEEK
:
monitor
.
httpError
=
realData
->
error
;
monitor
.
httpCode
=
realData
->
http_code
;
monitor
.
httpSeekCount
++
;
[
mpc
->
_glView
setHudValue
:
@
(
realData
->
http_code
).
stringValue
forKey
:
@"http"
];
if
(
delegate
!=
nil
)
{
int64_t
elapsed
=
calculateElapsed
(
monitor
.
httpSeekTick
,
SDL_GetTickHR
());
monitor
.
httpSeekTick
=
0
;
monitor
.
lastHttpSeekDuration
=
elapsed
;
dict
[
IJKMediaEventAttrKey_time_of_event
]
=
@
(
elapsed
).
stringValue
;
dict
[
IJKMediaEventAttrKey_url
]
=
[
NSString
ijk_stringBeEmptyIfNil
:
monitor
.
httpUrl
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录