Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
NotesChapter
ijkplayer
提交
018a8d20
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,体验更适合开发者的 AI 搜索 >>
提交
018a8d20
编写于
6月 20, 2013
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ijkplayer: remove unused msg_queue
上级
a2fbbce9
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
51 addition
and
218 deletion
+51
-218
ijkmediaplayer/jni/ffplay/ff_fferror.h
ijkmediaplayer/jni/ffplay/ff_fferror.h
+3
-3
ijkmediaplayer/jni/ffplay/ff_ffmsg.h
ijkmediaplayer/jni/ffplay/ff_ffmsg.h
+38
-0
ijkmediaplayer/jni/ffplay/ff_ffmsg_queue.h
ijkmediaplayer/jni/ffplay/ff_ffmsg_queue.h
+0
-193
ijkmediaplayer/jni/ffplay/ff_ffplay.c
ijkmediaplayer/jni/ffplay/ff_ffplay.c
+1
-4
ijkmediaplayer/jni/ffplay/ff_ffplay.h
ijkmediaplayer/jni/ffplay/ff_ffplay.h
+2
-1
ijkmediaplayer/jni/ffplay/ff_ffplay_def.h
ijkmediaplayer/jni/ffplay/ff_ffplay_def.h
+0
-11
ijkmediaplayer/jni/ijkplayer_android/ijkplayer_android.c
ijkmediaplayer/jni/ijkplayer_android/ijkplayer_android.c
+7
-6
未找到文件。
ijkmediaplayer/jni/ffplay/ff_error.h
→
ijkmediaplayer/jni/ffplay/ff_
ff
error.h
浏览文件 @
018a8d20
/*
* ff_error.h
* ff_
ff
error.h
*
* Copyright (c) 2003 Fabrice Bellard
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
...
...
@@ -21,8 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef IJKPLAYER__FF_ERROR_H
#define IJKPLAYER__FF_ERROR_H
#ifndef IJKPLAYER__FF_
FF
ERROR_H
#define IJKPLAYER__FF_
FF
ERROR_H
#define EIJK_FAILED -1
#define EIJK_OUT_OF_MEMORY -2
...
...
ijkmediaplayer/jni/ffplay/ff_ffmsg.h
0 → 100644
浏览文件 @
018a8d20
/*
* ff_ffmsg.h
* based on PacketQueue in ffplay.c
*
* Copyright (c) 2013 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 IJKPLAYER__FF_FFMSG_H
#define IJKPLAYER__FF_FFMSG_H
#define IJKFF_MSG_FLUSH 0
#define IJKFF_MSG_ERROR 100
/* arg1 = error */
#define IJKFF_MSG_PREPARED 200
#define IJKFF_MSG_COMPLETED 300
#define IJKFF_MSG_VIDEO_SIZE_CHANGED 400
/* arg1 = width, arg2 = height */
#define IJKFF_MSG_SAR_CHANGED 401
/* arg1 = sar.num, arg2 = sar.den */
#define IJKFF_MSG_BUFFERING_START 500
#define IJKFF_MSG_BUFFERING_END 501
#define IJKFF_MSG_BUFFERING_FORWARD 502
/* arg1 = cached duration */
#define IJKFF_MSG_SEEK_COMPLETED 600
#endif
ijkmediaplayer/jni/ffplay/ff_ffmsg_queue.h
已删除
100644 → 0
浏览文件 @
a2fbbce9
/*
* ff_ffmsg_queue.h
* based on PacketQueue in ffplay.c
*
* Copyright (c) 2000-2003 Fabrice Bellard
* Copyright (c) 2013 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 IJKPLAYER__FF_FFMSG_QUEUE_H
#define IJKPLAYER__FF_FFMSG_QUEUE_H
#include "ff_ffinc.h"
typedef
struct
IjkMessage
{
int
what
;
int
arg1
;
int
arg2
;
// optional
void
*
data
;
void
(
*
free_data
)(
void
*
data
);
int
serial
;
struct
IjkMessage
*
next
;
}
IjkMessage
;
typedef
struct
IjkMessageQueue
{
IjkMessage
*
first_msg
,
*
last_msg
;
int
abort_request
;
int
serial
;
SDL_mutex
*
mutex
;
SDL_cond
*
cond
;
}
IjkMessageQueue
;
extern
IjkMessage
flush_msg
;
static
void
ijkmsg_init_msg
(
IjkMessage
*
msg
)
{
memset
(
msg
,
0
,
sizeof
(
IjkMessage
));
}
static
void
ijkmsg_free_msg
(
IjkMessage
**
pmsg
)
{
if
(
!
pmsg
||
*
pmsg
)
return
;
IjkMessage
*
msg
=
*
pmsg
;
if
(
msg
->
free_data
&&
msg
->
data
)
{
msg
->
free_data
(
msg
->
data
);
}
free
(
msg
);
*
pmsg
=
NULL
;
}
static
int
ijkmsg_queue_put_private
(
IjkMessageQueue
*
q
,
IjkMessage
*
msg
)
{
IjkMessage
*
msg1
;
if
(
q
->
abort_request
)
return
-
1
;
msg1
=
malloc
(
sizeof
(
IjkMessage
));
if
(
!
msg1
)
return
-
1
;
*
msg1
=
*
msg
;
msg1
->
next
=
NULL
;
if
(
msg
==
&
flush_msg
)
q
->
serial
++
;
msg1
->
serial
=
q
->
serial
;
if
(
!
q
->
last_msg
)
q
->
first_msg
=
msg1
;
else
q
->
last_msg
->
next
=
msg1
;
q
->
last_msg
=
msg1
;
SDL_CondSignal
(
q
->
cond
);
return
0
;
}
static
int
ijkmsg_queue_put
(
IjkMessageQueue
*
q
,
IjkMessage
*
msg
)
{
int
ret
;
SDL_LockMutex
(
q
->
mutex
);
ret
=
ijkmsg_queue_put_private
(
q
,
msg
);
SDL_UnlockMutex
(
q
->
mutex
);
if
(
msg
!=
&
flush_msg
&&
ret
<
0
)
ijkmsg_free_msg
(
&
msg
);
return
ret
;
}
static
void
ijkmsg_queue_init
(
IjkMessageQueue
*
q
)
{
memset
(
q
,
0
,
sizeof
(
IjkMessageQueue
));
q
->
mutex
=
SDL_CreateMutex
();
q
->
cond
=
SDL_CreateCond
();
q
->
abort_request
=
1
;
}
static
void
ijkmsg_queue_flush
(
IjkMessageQueue
*
q
)
{
IjkMessage
*
msg
,
*
msg1
;
SDL_LockMutex
(
q
->
mutex
);
for
(
msg
=
q
->
first_msg
;
msg
!=
NULL
;
msg
=
msg1
)
{
msg1
=
msg
->
next
;
ijkmsg_free_msg
(
&
msg
);
}
q
->
last_msg
=
NULL
;
q
->
first_msg
=
NULL
;
SDL_UnlockMutex
(
q
->
mutex
);
}
static
void
ijkmsg_queue_destroy
(
IjkMessageQueue
*
q
)
{
ijkmsg_queue_flush
(
q
);
SDL_DestroyMutex
(
q
->
mutex
);
SDL_DestroyCond
(
q
->
cond
);
}
static
void
ijkmsg_queue_abort
(
IjkMessageQueue
*
q
)
{
SDL_LockMutex
(
q
->
mutex
);
q
->
abort_request
=
1
;
SDL_CondSignal
(
q
->
cond
);
SDL_UnlockMutex
(
q
->
mutex
);
}
static
void
ijkmsg_queue_start
(
IjkMessageQueue
*
q
)
{
SDL_LockMutex
(
q
->
mutex
);
q
->
abort_request
=
0
;
ijkmsg_queue_put_private
(
q
,
&
flush_msg
);
SDL_UnlockMutex
(
q
->
mutex
);
}
/* return < 0 if aborted, 0 if no msg and > 0 if msg. */
static
int
ijkmsg_queue_get
(
IjkMessageQueue
*
q
,
IjkMessage
*
msg
,
int
block
,
int
*
serial
)
{
IjkMessage
*
msg1
;
int
ret
;
SDL_LockMutex
(
q
->
mutex
);
for
(;;)
{
if
(
q
->
abort_request
)
{
ret
=
-
1
;
break
;
}
msg1
=
q
->
first_msg
;
if
(
msg1
)
{
q
->
first_msg
=
msg1
->
next
;
if
(
!
q
->
first_msg
)
q
->
last_msg
=
NULL
;
*
msg
=
*
msg1
;
if
(
serial
)
*
serial
=
msg1
->
serial
;
ijkmsg_free_msg
(
&
msg1
);
ret
=
1
;
break
;
}
else
if
(
!
block
)
{
ret
=
0
;
break
;
}
else
{
SDL_CondWait
(
q
->
cond
,
q
->
mutex
);
}
}
SDL_UnlockMutex
(
q
->
mutex
);
return
ret
;
}
#endif
ijkmediaplayer/jni/ffplay/ff_ffplay.c
浏览文件 @
018a8d20
...
...
@@ -23,7 +23,7 @@
#include "ff_ffplay.h"
#include "ff_cmdutils.h"
#include "
ijk
error.h"
#include "
ff_ff
error.h"
static
int
packet_queue_put
(
PacketQueue
*
q
,
AVPacket
*
pkt
);
...
...
@@ -1995,7 +1995,6 @@ static int lockmgr(void **mtx, enum AVLockOp op)
****************************************************************************/
AVPacket
flush_pkt
;
IjkMessage
flush_msg
;
static
bool
g_ffmpeg_global_inited
=
false
;
static
void
ijkff_log_callback_help
(
void
*
ptr
,
int
level
,
const
char
*
fmt
,
va_list
vl
)
...
...
@@ -2038,8 +2037,6 @@ void ijkff_global_init()
av_init_packet
(
&
flush_pkt
);
flush_pkt
.
data
=
(
uint8_t
*
)
&
flush_pkt
;
ijkmsg_init_msg
(
&
flush_msg
);
g_ffmpeg_global_inited
=
true
;
/* test link begin */
...
...
ijkmediaplayer/jni/ffplay/ff_ffplay.h
浏览文件 @
018a8d20
...
...
@@ -25,7 +25,8 @@
#define IJKPLAYER__FF_FFPLAY_H
#include "ff_ffplay_def.h"
#include "ff_error.h"
#include "ff_fferror.h"
#include "ff_ffmsg.h"
void
ijkff_global_init
();
void
ijkff_global_uninit
();
...
...
ijkmediaplayer/jni/ffplay/ff_ffplay_def.h
浏览文件 @
018a8d20
...
...
@@ -26,7 +26,6 @@
#include "ff_ffinc.h"
#include "ff_ffplay_config.h"
#include "ff_ffmsg_queue.h"
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
#define MIN_FRAMES 5
...
...
@@ -473,16 +472,6 @@ inline static void ijkff_reset_internal(FFPlayer *ffp)
ffp
->
msg_handler
=
NULL
;
}
#define IJKFF_MSG_ERROR 100
/* arg1 = error */
#define IJKFF_MSG_PREPARED 200
#define IJKFF_MSG_COMPLETED 300
#define IJKFF_MSG_VIDEO_SIZE_CHANGED 400
/* arg1 = width, arg2 = height */
#define IJKFF_MSG_SAR_CHANGED 401
/* arg1 = sar.num, arg2 = sar.den */
#define IJKFF_MSG_BUFFERING_START 500
#define IJKFF_MSG_BUFFERING_END 501
#define IJKFF_MSG_BUFFERING_FORWARD 502
/* arg1 = cached duration */
#define IJKFF_MSG_SEEK_COMPLETED 600
inline
static
void
ijkff_notify_msg
(
FFPlayer
*
ffp
,
int
what
,
int
arg1
,
int
arg2
,
void
*
data
)
{
if
(
ffp
->
msg_handler
)
ffp
->
msg_handler
(
ffp
->
msg_opaque
,
what
,
arg1
,
arg2
,
data
);
...
...
ijkmediaplayer/jni/ijkplayer_android/ijkplayer_android.c
浏览文件 @
018a8d20
...
...
@@ -23,7 +23,7 @@
#include "ijkplayer_android.h"
#include <assert.h>
#include "ffplay/
ijk
error.h"
#include "ffplay/
ff_ff
error.h"
#include "ffplay/ff_ffplay.h"
#define MPST_CHECK_NOT_RET_INT(real, expected, errcode) \
...
...
@@ -39,7 +39,7 @@ typedef struct IjkMediaPlayer {
pthread_mutex_t
mutex
;
FFPlayer
*
ffplayer
;
IjkMessageQueue
msg_queue
;
// FIXME:
IjkMessageQueue msg_queue;
int
mp_state
;
char
*
data_source
;
...
...
@@ -61,7 +61,7 @@ inline static void destroy_mp(IjkMediaPlayer **pmp)
ijkff_destroy_ffplayer
(
&
mp
->
ffplayer
);
}
ijkmsg_queue_destroy
(
&
mp
->
msg_queue
);
// FIXME:
ijkmsg_queue_destroy(&mp->msg_queue);
pthread_mutex_destroy
(
&
mp
->
mutex
);
free
(
mp
->
data_source
);
...
...
@@ -94,7 +94,8 @@ void ijkmp_setup_internal(IjkMediaPlayer *mp) {
ffp
->
msg_opaque
=
mp
;
ffp
->
msg_handler
=
ijkmp_msg_handler
;
ijkmsg_queue_start
(
&
mp
->
msg_queue
);
// FIXME: ijkmsg_queue_flush(&mp->msg_queue);
// FIXME: ijkmsg_queue_start(&mp->msg_queue);
}
IjkMediaPlayer
*
ijkmp_create
()
...
...
@@ -112,7 +113,7 @@ IjkMediaPlayer *ijkmp_create()
}
pthread_mutex_init
(
&
mp
->
mutex
,
NULL
);
ijkmsg_queue_init
(
&
mp
->
msg_queue
);
// FIXME:
ijkmsg_queue_init(&mp->msg_queue);
ijkmp_inc_ref
(
mp
);
...
...
@@ -126,7 +127,7 @@ void ijkmp_shutdown_l(IjkMediaPlayer *mp)
{
assert
(
mp
);
ijkmsg_queue_abort
(
&
mp
->
msg_queue
);
// FIXME:
ijkmsg_queue_abort(&mp->msg_queue);
if
(
mp
->
ffplayer
)
{
ijkff_stop_l
(
mp
->
ffplayer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录