Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
NotesChapter
ijkplayer
提交
2adb180f
I
ijkplayer
项目概览
NotesChapter
/
ijkplayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
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,发现更多精彩内容 >>
提交
2adb180f
编写于
7月 15, 2013
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ijkplayer: use seek target as current position before seek completed
上级
ab3e3756
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
42 addition
and
16 deletion
+42
-16
ijkmediaplayer/jni/ijkplayer/android/ijkplayer_android.c
ijkmediaplayer/jni/ijkplayer/android/ijkplayer_android.c
+21
-4
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
+12
-11
ijkmediaplayer/jni/ijkplayer/ff_ffplay_def.h
ijkmediaplayer/jni/ijkplayer/ff_ffplay_def.h
+9
-1
未找到文件。
ijkmediaplayer/jni/ijkplayer/android/ijkplayer_android.c
浏览文件 @
2adb180f
...
...
@@ -54,6 +54,8 @@ typedef struct IjkMediaPlayer {
void
*
weak_thiz
;
int
restart_from_beginning
;
int
seek_req
;
long
seek_msec
;
}
IjkMediaPlayer
;
inline
static
void
ijkmp_destroy
(
IjkMediaPlayer
*
mp
)
...
...
@@ -292,7 +294,7 @@ static int ijkmp_start_l(IjkMediaPlayer *mp)
ffp_remove_msg
(
mp
->
ffplayer
,
FFP_REQ_START
);
ffp_remove_msg
(
mp
->
ffplayer
,
FFP_REQ_PAUSE
);
ffp_notify_msg
(
mp
->
ffplayer
,
FFP_REQ_START
,
0
,
0
);
ffp_notify_msg
1
(
mp
->
ffplayer
,
FFP_REQ_START
);
return
0
;
}
...
...
@@ -332,7 +334,7 @@ static int ijkmp_pause_l(IjkMediaPlayer *mp)
ffp_remove_msg
(
mp
->
ffplayer
,
FFP_REQ_START
);
ffp_remove_msg
(
mp
->
ffplayer
,
FFP_REQ_PAUSE
);
ffp_notify_msg
(
mp
->
ffplayer
,
FFP_REQ_PAUSE
,
0
,
0
);
ffp_notify_msg
1
(
mp
->
ffplayer
,
FFP_REQ_PAUSE
);
return
0
;
}
...
...
@@ -418,8 +420,10 @@ int ijkmp_seek_to_l(IjkMediaPlayer *mp, long msec)
MP_RET_IF_FAILED
(
ikjmp_chkst_seek_l
(
mp
->
mp_state
));
mp
->
seek_req
=
1
;
mp
->
seek_msec
=
msec
;
ffp_remove_msg
(
mp
->
ffplayer
,
FFP_REQ_SEEK
);
ffp_notify_msg
(
mp
->
ffplayer
,
FFP_REQ_SEEK
,
msec
,
0
);
ffp_notify_msg
2
(
mp
->
ffplayer
,
FFP_REQ_SEEK
,
msec
);
// TODO: 9 64-bit long?
return
0
;
...
...
@@ -446,7 +450,11 @@ long ijkmp_get_current_position(IjkMediaPlayer *mp)
{
assert
(
mp
);
pthread_mutex_lock
(
&
mp
->
mutex
);
long
retval
=
ijkmp_get_current_position_l
(
mp
);
long
retval
;
if
(
mp
->
seek_req
)
retval
=
mp
->
seek_msec
;
else
retval
=
ijkmp_get_current_position_l
(
mp
);
pthread_mutex_unlock
(
&
mp
->
mutex
);
return
retval
;
}
...
...
@@ -524,6 +532,15 @@ int ijkmp_get_msg(IjkMediaPlayer *mp, AVMessage *msg, int block)
pthread_mutex_unlock
(
&
mp
->
mutex
);
break
;
case
FFP_MSG_SEEK_COMPLETE
:
MPTRACE
(
"ijkmp_get_msg: FFP_MSG_SEEK_COMPLETE"
);
pthread_mutex_lock
(
&
mp
->
mutex
);
mp
->
seek_req
=
0
;
mp
->
seek_msec
=
0
;
pthread_mutex_unlock
(
&
mp
->
mutex
);
break
;
case
FFP_REQ_START
:
MPTRACE
(
"ijkmp_get_msg: FFP_REQ_START"
);
continue_wait_next_msg
=
1
;
...
...
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
浏览文件 @
2adb180f
...
...
@@ -794,7 +794,7 @@ static int queue_picture(FFPlayer *ffp, AVFrame *src_frame, double pts, int64_t
vp
->
height
!=
src_frame
->
height
)
{
if
(
vp
->
width
!=
src_frame
->
width
||
vp
->
height
!=
src_frame
->
height
)
ffp_notify_msg
(
ffp
,
FFP_MSG_VIDEO_SIZE_CHANGED
,
src_frame
->
width
,
src_frame
->
height
);
ffp_notify_msg
3
(
ffp
,
FFP_MSG_VIDEO_SIZE_CHANGED
,
src_frame
->
width
,
src_frame
->
height
);
vp
->
allocated
=
0
;
vp
->
reallocate
=
0
;
...
...
@@ -1950,14 +1950,14 @@ static int read_thread(void *arg)
ffp
->
infinite_buffer
=
1
;
ffp
->
prepared
=
true
;
ffp_notify_msg
(
ffp
,
FFP_MSG_PREPARED
,
0
,
0
);
ffp_notify_msg
1
(
ffp
,
FFP_MSG_PREPARED
);
if
(
is
->
video_st
&&
is
->
video_st
->
codec
)
{
AVCodecContext
*
avctx
=
is
->
video_st
->
codec
;
ffp_notify_msg
(
ffp
,
FFP_MSG_VIDEO_SIZE_CHANGED
,
avctx
->
width
,
avctx
->
height
);
ffp_notify_msg
(
ffp
,
FFP_MSG_SAR_CHANGED
,
avctx
->
sample_aspect_ratio
.
num
,
avctx
->
sample_aspect_ratio
.
den
);
ffp_notify_msg
3
(
ffp
,
FFP_MSG_VIDEO_SIZE_CHANGED
,
avctx
->
width
,
avctx
->
height
);
ffp_notify_msg
3
(
ffp
,
FFP_MSG_SAR_CHANGED
,
avctx
->
sample_aspect_ratio
.
num
,
avctx
->
sample_aspect_ratio
.
den
);
}
if
(
ffp
->
auto_start
)
{
ffp_notify_msg
(
ffp
,
FFP_REQ_START
,
0
,
0
);
ffp_notify_msg
1
(
ffp
,
FFP_REQ_START
);
ffp
->
auto_start
=
0
;
}
...
...
@@ -2031,6 +2031,7 @@ static int read_thread(void *arg)
if
(
is
->
pause_req
)
step_to_next_frame
(
ffp
);
SDL_UnlockMutex
(
ffp
->
is
->
play_mutex
);
ffp_notify_msg1
(
ffp
,
FFP_MSG_SEEK_COMPLETE
);
}
if
(
is
->
queue_attachments_req
)
{
if
(
is
->
video_st
&&
(
is
->
video_st
->
disposition
&
AV_DISPOSITION_ATTACHED_PIC
))
{
...
...
@@ -2106,7 +2107,7 @@ static int read_thread(void *arg)
// ALOGE("ffp_toggle_buffering: eof");
ffp_toggle_buffering
(
ffp
,
0
);
toggle_pause
(
ffp
,
1
);
ffp_notify_msg
(
ffp
,
FFP_MSG_COMPLETED
,
0
,
0
);
ffp_notify_msg
1
(
ffp
,
FFP_MSG_COMPLETED
);
}
}
}
...
...
@@ -2181,7 +2182,7 @@ static int read_thread(void *arg)
if
(
last_buffered_time_percentage
!=
buf_time_percent
)
{
// ALOGE("time cache=%%%d (%d/%d)", buf_time_percent, cached_duration_in_ms, hwm_in_ms);
last_buffered_time_percentage
=
buf_time_percent
;
ffp_notify_msg
(
ffp
,
FFP_MSG_BUFFERING_TIME_UPDATE
,
cached_duration_in_ms
,
hwm_in_ms
);
ffp_notify_msg
3
(
ffp
,
FFP_MSG_BUFFERING_TIME_UPDATE
,
cached_duration_in_ms
,
hwm_in_ms
);
}
}
}
...
...
@@ -2192,7 +2193,7 @@ static int read_thread(void *arg)
if
(
last_buffered_size_percentage
!=
buf_size_percent
)
{
// ALOGE("size cache=%%%d (%d/%d)",buf_size_percent, cached_size, hwm_in_bytes);
last_buffered_size_percentage
=
buf_size_percent
;
ffp_notify_msg
(
ffp
,
FFP_MSG_BUFFERING_TIME_UPDATE
,
cached_size
,
hwm_in_bytes
);
ffp_notify_msg
3
(
ffp
,
FFP_MSG_BUFFERING_TIME_UPDATE
,
cached_size
,
hwm_in_bytes
);
}
}
...
...
@@ -2225,7 +2226,7 @@ static int read_thread(void *arg)
if
(
!
ffp
->
prepared
||
!
is
->
abort_request
)
{
ffp
->
last_error
=
last_error
;
ffp_notify_msg
(
ffp
,
FFP_MSG_ERROR
,
last_error
,
0
);
ffp_notify_msg
2
(
ffp
,
FFP_MSG_ERROR
,
last_error
);
}
SDL_DestroyMutex
(
wait_mutex
);
...
...
@@ -2606,12 +2607,12 @@ void ffp_toggle_buffering_l(FFPlayer *ffp, int buffering_on)
ALOGD
(
"ffp_toggle_buffering_l: start"
);
is
->
buffering_on
=
1
;
stream_update_pause_l
(
ffp
);
ffp_notify_msg
(
ffp
,
FFP_MSG_BUFFERING_START
,
0
,
0
);
ffp_notify_msg
1
(
ffp
,
FFP_MSG_BUFFERING_START
);
}
else
if
(
!
buffering_on
&&
is
->
buffering_on
){
ALOGD
(
"ffp_toggle_buffering_l: end"
);
is
->
buffering_on
=
0
;
stream_update_pause_l
(
ffp
);
ffp_notify_msg
(
ffp
,
FFP_MSG_BUFFERING_END
,
0
,
0
);
ffp_notify_msg
1
(
ffp
,
FFP_MSG_BUFFERING_END
);
}
}
...
...
ijkmediaplayer/jni/ijkplayer/ff_ffplay_def.h
浏览文件 @
2adb180f
...
...
@@ -503,7 +503,15 @@ inline static void ffp_reset_internal(FFPlayer *ffp)
msg_queue_flush
(
&
ffp
->
msg_queue
);
}
inline
static
void
ffp_notify_msg
(
FFPlayer
*
ffp
,
int
what
,
int
arg1
,
int
arg2
)
{
inline
static
void
ffp_notify_msg1
(
FFPlayer
*
ffp
,
int
what
)
{
msg_queue_put_simple3
(
&
ffp
->
msg_queue
,
what
,
0
,
0
);
}
inline
static
void
ffp_notify_msg2
(
FFPlayer
*
ffp
,
int
what
,
int
arg1
)
{
msg_queue_put_simple3
(
&
ffp
->
msg_queue
,
what
,
arg1
,
0
);
}
inline
static
void
ffp_notify_msg3
(
FFPlayer
*
ffp
,
int
what
,
int
arg1
,
int
arg2
)
{
msg_queue_put_simple3
(
&
ffp
->
msg_queue
,
what
,
arg1
,
arg2
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录