Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_25606643
ijkplayer
提交
90a5e81d
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,发现更多精彩内容 >>
提交
90a5e81d
编写于
9月 27, 2013
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ijkplayer: optimize frame drop
上级
e50952b1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
67 addition
and
22 deletion
+67
-22
ijkmedia/ijkplayer/ff_ffplay.c
ijkmedia/ijkplayer/ff_ffplay.c
+25
-5
ijkmedia/ijkplayer/ff_ffplay.h
ijkmedia/ijkplayer/ff_ffplay.h
+2
-0
ijkmedia/ijkplayer/ff_ffplay_def.h
ijkmedia/ijkplayer/ff_ffplay_def.h
+4
-4
ijkmedia/ijkplayer/ijkplayer.c
ijkmedia/ijkplayer/ijkplayer.c
+33
-11
ijkmedia/ijkplayer/ijkplayer.h
ijkmedia/ijkplayer/ijkplayer.h
+3
-2
未找到文件。
ijkmedia/ijkplayer/ff_ffplay.c
浏览文件 @
90a5e81d
...
...
@@ -896,12 +896,14 @@ static int get_video_frame(FFPlayer *ffp, AVFrame *frame, AVPacket *pkt, int *se
}
if
(
is
->
recover_skip_frame
&&
(
pkt
->
flags
&
AV_PKT_FLAG_KEY
))
{
ALOGW
(
"skip frame: end
\n
"
);
is
->
recover_skip_frame
=
0
;
is
->
video_st
->
codec
->
skip_frame
=
AVDISCARD_
NONREF
;
is
->
video_st
->
codec
->
skip_frame
=
AVDISCARD_
DEFAULT
;
avcodec_flush_buffers
(
is
->
video_st
->
codec
);
}
if
(
is
->
frame_drops_early
>
0
)
{
if
(
is
->
frame_drops_early
>
12
)
{
ALOGW
(
"skip frame: start
\n
"
);
is
->
frame_drops_early
=
0
;
is
->
video_st
->
codec
->
skip_frame
=
AVDISCARD_NONKEY
;
avcodec_flush_buffers
(
is
->
video_st
->
codec
);
...
...
@@ -960,8 +962,10 @@ static int get_video_frame(FFPlayer *ffp, AVFrame *frame, AVPacket *pkt, int *se
SDL_UnlockMutex
(
is
->
pictq_mutex
);
}
if
(
ret
)
if
(
ret
&&
!
is
->
recover_skip_frame
)
{
ALOGW
(
"skip frame: recover"
);
is
->
recover_skip_frame
=
1
;
}
return
ret
;
}
...
...
@@ -1680,8 +1684,6 @@ static int stream_component_open(FFPlayer *ffp, int stream_index)
}
avctx
->
skip_loop_filter
=
AVDISCARD_ALL
;
avctx
->
skip_frame
=
AVDISCARD_NONREF
;
avctx
->
flags
|=
CODEC_FLAG_LOW_DELAY
;
avctx
->
codec_id
=
codec
->
id
;
avctx
->
workaround_bugs
=
ffp
->
workaround_bugs
;
...
...
@@ -2546,6 +2548,22 @@ void ffp_set_format_option(FFPlayer *ffp, const char *name, const char *value)
av_dict_set
(
&
ffp
->
format_opts
,
name
,
value
,
0
);
}
void
ffp_set_codec_option
(
FFPlayer
*
ffp
,
const
char
*
name
,
const
char
*
value
)
{
if
(
!
ffp
)
return
;
av_dict_set
(
&
ffp
->
codec_opts
,
name
,
value
,
0
);
}
void
ffp_set_sws_option
(
FFPlayer
*
ffp
,
const
char
*
name
,
const
char
*
value
)
{
if
(
!
ffp
)
return
;
av_dict_set
(
&
ffp
->
sws_opts
,
name
,
value
,
0
);
}
void
ffp_set_overlay_format
(
FFPlayer
*
ffp
,
int
chroma_fourcc
)
{
switch
(
chroma_fourcc
)
{
...
...
@@ -2716,11 +2734,13 @@ void ffp_toggle_buffering_l(FFPlayer *ffp, int buffering_on)
if
(
buffering_on
&&
!
is
->
buffering_on
)
{
ALOGD
(
"ffp_toggle_buffering_l: start
\n
"
);
is
->
buffering_on
=
1
;
is
->
frame_drops_early
=
0
;
stream_update_pause_l
(
ffp
);
ffp_notify_msg1
(
ffp
,
FFP_MSG_BUFFERING_START
);
}
else
if
(
!
buffering_on
&&
is
->
buffering_on
){
ALOGD
(
"ffp_toggle_buffering_l: end
\n
"
);
is
->
buffering_on
=
0
;
is
->
frame_drops_early
=
0
;
stream_update_pause_l
(
ffp
);
ffp_notify_msg1
(
ffp
,
FFP_MSG_BUFFERING_END
);
}
...
...
ijkmedia/ijkplayer/ff_ffplay.h
浏览文件 @
90a5e81d
...
...
@@ -38,6 +38,8 @@ void ffp_reset(FFPlayer *ffp);
/* set options before ffp_prepare_async_l() */
void
ffp_set_format_option
(
FFPlayer
*
ffp
,
const
char
*
name
,
const
char
*
value
);
void
ffp_set_codec_option
(
FFPlayer
*
ffp
,
const
char
*
name
,
const
char
*
value
);
void
ffp_set_sws_option
(
FFPlayer
*
ffp
,
const
char
*
name
,
const
char
*
value
);
void
ffp_set_overlay_format
(
FFPlayer
*
ffp
,
int
chroma_fourcc
);
/* playback controll */
...
...
ijkmedia/ijkplayer/ff_ffplay_def.h
浏览文件 @
90a5e81d
...
...
@@ -28,7 +28,7 @@
#include "ff_ffplay_config.h"
#include "ff_ffmsg_queue.h"
#define DEFAULT_HIGH_WATER_MARK_IN_MS (
5
* 1000)
#define DEFAULT_HIGH_WATER_MARK_IN_MS (
10
* 1000)
#define DEFAULT_HIGH_WATER_MARK_IN_BYTES (128 * 1024)
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
#define MIN_FRAMES 50000
...
...
@@ -295,7 +295,7 @@ static int av_sync_type = AV_SYNC_AUDIO_MASTER;
static
int64_t
start_time
=
AV_NOPTS_VALUE
;
static
int64_t
duration
=
AV_NOPTS_VALUE
;
static
int
workaround_bugs
=
1
;
static
int
fast
=
1
;
static
int
fast
=
0
;
static
int
genpts
=
0
;
static
int
lowres
=
0
;
static
int
idct
=
FF_IDCT_AUTO
;
...
...
@@ -455,12 +455,12 @@ inline static void ffp_reset_internal(FFPlayer *ffp)
ffp
->
wanted_stream
[
AVMEDIA_TYPE_SUBTITLE
]
=
-
1
;
ffp
->
seek_by_bytes
=
-
1
;
ffp
->
display_disable
=
0
;
ffp
->
show_status
=
0
;
ffp
->
show_status
=
1
;
ffp
->
av_sync_type
=
AV_SYNC_AUDIO_MASTER
;
ffp
->
start_time
=
AV_NOPTS_VALUE
;
ffp
->
duration
=
AV_NOPTS_VALUE
;
ffp
->
workaround_bugs
=
1
;
ffp
->
fast
=
0
;
ffp
->
fast
=
1
;
ffp
->
genpts
=
0
;
ffp
->
lowres
=
0
;
ffp
->
idct
=
FF_IDCT_AUTO
;
...
...
ijkmedia/ijkplayer/ijkplayer.c
浏览文件 @
90a5e81d
...
...
@@ -105,6 +105,39 @@ void ijkmp_set_overlay_format(IjkMediaPlayer *mp, int chroma_fourcc)
MPTRACE
(
"ijkmp_set_overlay_format()=void
\n
"
);
}
void
ijkmp_set_format_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
)
{
assert
(
mp
);
MPTRACE
(
"ijkmp_set_format_option()
\n
"
);
pthread_mutex_lock
(
&
mp
->
mutex
);
ffp_set_format_option
(
mp
->
ffplayer
,
name
,
value
);
pthread_mutex_unlock
(
&
mp
->
mutex
);
MPTRACE
(
"ijkmp_set_format_option()=void
\n
"
);
}
void
ijkmp_set_codec_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
)
{
assert
(
mp
);
MPTRACE
(
"ijkmp_set_codec_option()
\n
"
);
pthread_mutex_lock
(
&
mp
->
mutex
);
ffp_set_codec_option
(
mp
->
ffplayer
,
name
,
value
);
pthread_mutex_unlock
(
&
mp
->
mutex
);
MPTRACE
(
"ijkmp_set_codec_option()=void
\n
"
);
}
void
ijkmp_set_sws_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
)
{
assert
(
mp
);
MPTRACE
(
"ijkmp_set_sws_option()
\n
"
);
pthread_mutex_lock
(
&
mp
->
mutex
);
ffp_set_sws_option
(
mp
->
ffplayer
,
name
,
value
);
pthread_mutex_unlock
(
&
mp
->
mutex
);
MPTRACE
(
"ijkmp_set_sws_option()=void
\n
"
);
}
void
ijkmp_shutdown_l
(
IjkMediaPlayer
*
mp
)
{
assert
(
mp
);
...
...
@@ -144,17 +177,6 @@ void ijkmp_reset(IjkMediaPlayer *mp)
MPTRACE
(
"ijkmp_reset()=void
\n
"
);
}
void
ijkmp_set_format_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
)
{
assert
(
mp
);
MPTRACE
(
"ijkmp_reset()
\n
"
);
pthread_mutex_lock
(
&
mp
->
mutex
);
ffp_set_format_option
(
mp
->
ffplayer
,
name
,
value
);
pthread_mutex_unlock
(
&
mp
->
mutex
);
MPTRACE
(
"ijkmp_reset()=void
\n
"
);
}
void
ijkmp_inc_ref
(
IjkMediaPlayer
*
mp
)
{
assert
(
mp
);
...
...
ijkmedia/ijkplayer/ijkplayer.h
浏览文件 @
90a5e81d
...
...
@@ -146,6 +146,9 @@ typedef struct IjkMediaPlayer IjkMediaPlayer;
// ref_count is 1 after open
IjkMediaPlayer
*
ijkmp_create
(
int
(
*
msg_loop
)(
void
*
));
void
ijkmp_set_overlay_format
(
IjkMediaPlayer
*
mp
,
int
chroma_fourcc
);
void
ijkmp_set_format_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
);
void
ijkmp_set_codec_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
);
void
ijkmp_set_sws_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
);
// preferred to be called explicity, can be called multiple times
// NOTE: ijkmp_shutdown may block thread
...
...
@@ -169,8 +172,6 @@ long ijkmp_get_current_position(IjkMediaPlayer *mp);
long
ijkmp_get_duration
(
IjkMediaPlayer
*
mp
);
void
ijkmp_reset
(
IjkMediaPlayer
*
mp
);
void
ijkmp_set_format_option
(
IjkMediaPlayer
*
mp
,
const
char
*
name
,
const
char
*
value
);
void
*
ijkmp_set_weak_thiz
(
IjkMediaPlayer
*
mp
,
void
*
weak_thiz
);
/* return < 0 if aborted, 0 if no packet and > 0 if packet. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录