Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
8f4bbe2a
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 搜索 >>
提交
8f4bbe2a
编写于
6月 16, 2015
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ijksdl: introduce SDL_Profiler
上级
577a50ef
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
88 addition
and
11 deletion
+88
-11
ijkmedia/ijkplayer/ff_ffplay.c
ijkmedia/ijkplayer/ff_ffplay.c
+1
-11
ijkmedia/ijkplayer/ff_ffplay_debug.h
ijkmedia/ijkplayer/ff_ffplay_debug.h
+37
-0
ijkmedia/ijksdl/ijksdl_timer.c
ijkmedia/ijksdl/ijksdl_timer.c
+36
-0
ijkmedia/ijksdl/ijksdl_timer.h
ijkmedia/ijksdl/ijksdl_timer.h
+14
-0
未找到文件。
ijkmedia/ijkplayer/ff_ffplay.c
浏览文件 @
8f4bbe2a
...
...
@@ -28,6 +28,7 @@
#include "ff_fferror.h"
#include "ff_ffpipeline.h"
#include "ff_ffpipenode.h"
#include "ff_ffplay_debug.h"
#include "ijkmeta.h"
// FIXME: 9 work around NDKr8e or gcc4.7 bug
...
...
@@ -43,17 +44,6 @@
#define printf(...) ALOGD(__VA_ARGS__)
#endif
#define FFP_XPS_PERIOD (3)
// #define FFP_SHOW_FPS
// #define FFP_SHOW_VDPS
// #define FFP_SHOW_AUDIO_DELAY
// #define FFP_SHOW_DEMUX_CACHE
// #define FFP_SHOW_BUF_POS
// #define FFP_SHOW_PKT_RECYCLE
// #define FFP_NOTIFY_BUF_TIME
// #define FFP_NOTIFY_BUF_BYTES
#define FFP_IO_STAT_STEP (50 * 1024)
#ifdef FFP_SHOW_VDPS
...
...
ijkmedia/ijkplayer/ff_ffplay_debug.h
0 → 100644
浏览文件 @
8f4bbe2a
/*
* ff_ffplaye_debug.h
*
* Copyright (c) 2015 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef FFPLAY__FF_FFPLAY_DEBUG_H
#define FFPLAY__FF_FFPLAY_DEBUG_H
#define FFP_XPS_PERIOD (3)
// #define FFP_SHOW_FPS
// #define FFP_SHOW_VDPS
// #define FFP_SHOW_AUDIO_DELAY
// #define FFP_SHOW_DEMUX_CACHE
// #define FFP_SHOW_BUF_POS
// #define FFP_SHOW_PKT_RECYCLE
// #define FFP_NOTIFY_BUF_TIME
// #define FFP_NOTIFY_BUF_BYTES
#endif
ijkmedia/ijksdl/ijksdl_timer.c
浏览文件 @
8f4bbe2a
...
...
@@ -23,6 +23,7 @@
#include "ijksdl_timer.h"
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
...
...
@@ -76,3 +77,38 @@ Uint64 SDL_GetTickHR(void)
#endif
return
(
clock
);
}
void
SDL_ProfilerReset
(
SDL_Profiler
*
profiler
,
int
max_sample
)
{
memset
(
profiler
,
0
,
sizeof
(
SDL_Profiler
));
if
(
max_sample
<
0
)
profiler
->
max_sample
=
3
;
else
profiler
->
max_sample
=
max_sample
;
}
void
SDL_ProfilerBegin
(
SDL_Profiler
*
profiler
)
{
profiler
->
begin_time
=
SDL_GetTickHR
();
}
int64_t
SDL_ProfilerEnd
(
SDL_Profiler
*
profiler
)
{
int64_t
delta
=
SDL_GetTickHR
();
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
;
}
if
(
profiler
->
total_counter
>
0
)
{
profiler
->
average_elapsed
=
profiler
->
total_elapsed
/
profiler
->
total_counter
;
}
}
return
delta
;
}
ijkmedia/ijksdl/ijksdl_timer.h
浏览文件 @
8f4bbe2a
...
...
@@ -30,4 +30,18 @@ void SDL_Delay(Uint32 ms);
Uint64
SDL_GetTickHR
(
void
);
typedef
struct
SDL_Profiler
{
int64_t
total_elapsed
;
int
total_counter
;
int64_t
average_elapsed
;
int64_t
begin_time
;
int
max_sample
;
}
SDL_Profiler
;
void
SDL_ProfilerReset
(
SDL_Profiler
*
profiler
,
int
max_sample
);
void
SDL_ProfilerBegin
(
SDL_Profiler
*
profiler
);
int64_t
SDL_ProfilerEnd
(
SDL_Profiler
*
profiler
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录