Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
NotesChapter
ijkplayer
提交
0c7b54c3
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,发现更多精彩内容 >>
提交
0c7b54c3
编写于
6月 09, 2013
作者:
Z
Zhang Rui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
jni: ijkplayer: introduce SDL_Overlay, SDL_Surface
上级
aec1153f
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
1379 addition
and
212 deletion
+1379
-212
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
+1155
-13
ijkmediaplayer/jni/ijkplayer/ff_ffplay_def.h
ijkmediaplayer/jni/ijkplayer/ff_ffplay_def.h
+13
-9
ijkmediaplayer/jni/ijkplayer_old/ffplay_output_video_thread.c
...ediaplayer/jni/ijkplayer_old/ffplay_output_video_thread.c
+0
-77
ijkmediaplayer/jni/ijksdl/Android.mk
ijkmediaplayer/jni/ijksdl/Android.mk
+1
-1
ijkmediaplayer/jni/ijksdl/ijksdl.h
ijkmediaplayer/jni/ijksdl/ijksdl.h
+1
-2
ijkmediaplayer/jni/ijksdl/ijksdl_rect.h
ijkmediaplayer/jni/ijksdl/ijksdl_rect.h
+0
-33
ijkmediaplayer/jni/ijksdl/ijksdl_video.c
ijkmediaplayer/jni/ijksdl/ijksdl_video.c
+21
-25
ijkmediaplayer/jni/ijksdl/ijksdl_video.h
ijkmediaplayer/jni/ijksdl/ijksdl_video.h
+188
-0
ijkmediaplayer/jni/ijksdl/ijksdl_vout.h
ijkmediaplayer/jni/ijksdl/ijksdl_vout.h
+0
-52
未找到文件。
ijkmediaplayer/jni/ijkplayer/ff_ffplay.c
浏览文件 @
0c7b54c3
此差异已折叠。
点击以展开。
ijkmediaplayer/jni/ijkplayer/ff_ffplay_def.h
浏览文件 @
0c7b54c3
...
...
@@ -88,11 +88,7 @@ typedef struct PacketQueue {
typedef
struct
VideoPicture
{
double
pts
;
// presentation timestamp for this picture
int64_t
pos
;
// byte position in file
#ifdef IJK_FFPLAY_MERGE
SDL_Overlay
*
bmp
;
#else
SDL_Picture
*
bmp
;
#endif
int
width
,
height
;
/* source height & width */
AVRational
sample_aspect_ratio
;
int
allocated
;
...
...
@@ -333,8 +329,10 @@ typedef struct FFPlayer {
const
char
*
window_title
;
int
fs_screen_width
;
int
fs_screen_height
;
int
default_width
=
640
;
int
default_height
=
480
;
#endif
int
default_width
;
int
default_height
;
#ifdef IJK_FFPLAY_MERGE
int
screen_width
=
0
;
int
screen_height
=
0
;
#endif
...
...
@@ -386,9 +384,11 @@ typedef struct FFPlayer {
int
is_full_screen
;
#endif
int64_t
audio_callback_time
;
SDL_Surface
*
screen
;
/* extra fields */
SDL_Vout
*
vout
;
int
sar_num
;
int
sar_den
;
}
FFPlayer
;
#define IJKFF_SAFE_FREE(p) do {free(p); p = NULL;} while(0)
...
...
@@ -404,6 +404,8 @@ inline static void ijkff_reset(FFPlayer *ffp)
/* ffplay options specified by the user */
IJKFF_SAFE_FREE
(
ffp
->
input_filename
);
ffp
->
default_width
=
640
;
ffp
->
default_height
=
480
;
ffp
->
audio_disable
=
0
;
ffp
->
video_disable
=
0
;
ffp
->
subtitle_disable
=
0
;
...
...
@@ -443,10 +445,12 @@ inline static void ijkff_reset(FFPlayer *ffp)
/* current context */
ffp
->
audio_callback_time
=
0
;
SDL_FreeSurface
(
ffp
->
screen
);
ffp
->
screen
=
NULL
;
/* extra fields */
SDL_VoutFree
(
ffp
->
vout
)
;
ffp
->
vout
=
NULL
;
ffp
->
sar_num
=
0
;
ffp
->
sar_den
=
0
;
}
#endif
ijkmediaplayer/jni/ijkplayer_old/ffplay_output_video_thread.c
已删除
100644 → 0
浏览文件 @
aec1153f
/*****************************************************************************
* ffplay_output_video_thread.c
*****************************************************************************
*
* copyright (c) 2001 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
*/
#if 0
static int video_open(FFPlayer *ffp, int force_set_video_mode, VideoPicture *vp)
{
VideoState *is = &ffp->is;
SDL_Vout *vout = ffp->vout;
int w = 0;
int h = 0;
SDL_Rect rect;
if (!vp)
return 0;
if (vp && vp->width && vp->height) {
w = rect.w;
h = rect.h;
}
if (vout &&
is->width == vout->width && vout->width == w &&
is->height == vout->height && vout->height == h &&
!force_set_video_mode)
return 0;
if (SDL_VoutSetBuffersGeometry(vout, w, h, 0))
{
ALOGE("SDL_SetBuffersGeometry(%d, %d, 0) failed");
return -1;
}
is->width = vout->width;
is->height = vout->height;
return 0;
}
/* display the current picture, if any */
static void video_display(FFPlayer *ffp)
{
VideoState *is = &ffp->is;
VideoPicture *vp = NULL;
if (!is->video_st)
return;
vp = &is->pictq[is->pictq_rindex];
if (vp && video_open(ffp, 0, vp))
return;
if (ffp->vout && vp)
SDL_VoutRender(ffp->vout, vp->bmp);
}
#endif
ijkmediaplayer/jni/ijksdl/Android.mk
浏览文件 @
0c7b54c3
...
...
@@ -28,7 +28,7 @@ LOCAL_SRC_FILES += ijksdl_mutex.c
LOCAL_SRC_FILES
+=
ijksdl_stdinc.c
LOCAL_SRC_FILES
+=
ijksdl_thread.c
LOCAL_SRC_FILES
+=
ijksdl_timer.c
LOCAL_SRC_FILES
+=
ijksdl_v
out
.c
LOCAL_SRC_FILES
+=
ijksdl_v
ideo
.c
LOCAL_MODULE
:=
ijksdl
include
$(BUILD_STATIC_LIBRARY)
ijkmediaplayer/jni/ijksdl/ijksdl.h
浏览文件 @
0c7b54c3
...
...
@@ -28,9 +28,8 @@
#include "ijksdl_events.h"
#include "ijksdl_error.h"
#include "ijksdl_mutex.h"
#include "ijksdl_rect.h"
#include "ijksdl_thread.h"
#include "ijksdl_timer.h"
#include "ijksdl_v
out
.h"
#include "ijksdl_v
ideo
.h"
#endif
ijkmediaplayer/jni/ijksdl/ijksdl_rect.h
已删除
100644 → 0
浏览文件 @
aec1153f
/*****************************************************************************
* ijksdl_rect.h
*****************************************************************************
*
* 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 IJKSDL__IJKSDL_RECT_H
#define IJKSDL__IJKSDL_RECT_H
typedef
struct
SDL_Rect
{
int
x
,
y
;
int
w
,
h
;
}
SDL_Rect
;
#endif
ijkmediaplayer/jni/ijksdl/ijksdl_v
out
.c
→
ijkmediaplayer/jni/ijksdl/ijksdl_v
ideo
.c
浏览文件 @
0c7b54c3
/*****************************************************************************
* ijksdl_v
out.h
* ijksdl_v
ideo.c
*****************************************************************************
*
* copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
...
...
@@ -21,48 +21,44 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "ijksdl_vout.h"
#include <stdlib.h>
#include "ijksdl_video.h"
SDL_Vout
*
SDL_VoutCreate
(
)
void
SDL_FreeSurface
(
SDL_Surface
*
surface
)
{
SDL_Vout
*
vout
=
malloc
(
sizeof
(
SDL_Vout
));
memset
(
vout
,
0
,
sizeof
(
SDL_Vout
));
/* FIXME: implement */
return
vout
;
// FIXME: implement
}
void
SDL_VoutFree
(
SDL_Vout
*
vout
)
SDL_Overlay
*
SDL_CreateYUVOverlay
(
int
width
,
int
height
,
Uint32
format
,
SDL_Surface
*
display
)
{
if
(
!
vout
)
return
;
/* FIXME: implement */
// FIXME: implement
return
NULL
;
}
free
(
vout
);
SDL_Surface
*
SDL_SetVideoMode
(
int
width
,
int
height
,
int
bpp
,
Uint32
flags
)
{
// FIXME: implement
return
NULL
;
}
int
SDL_
VoutSetBuffersGeometry
(
SDL_Vout
*
vout
,
int32_t
width
,
int32_t
height
,
int32_t
format
)
int
SDL_
LockYUVOverlay
(
SDL_Overlay
*
overlay
)
{
/
* FIXME: implement */
/
/ FIXME: implement
return
0
;
}
int
SDL_VoutRender
(
SDL_Vout
*
vout
,
SDL_Picture
*
pic
)
void
SDL_UnlockYUVOverlay
(
SDL_Overlay
*
overlay
)
{
/* FIXME: implement */
return
0
;
// FIXME: implement
}
int
SDL_
VoutLockYUVPicture
(
SDL_Picture
*
pic
)
int
SDL_
DisplayYUVOverlay
(
SDL_Overlay
*
overlay
,
SDL_Rect
*
dstrect
)
{
/
* FIXME: implement */
/
/ FIXME: implement
return
0
;
}
int
SDL_VoutUnlockYUVPicture
(
SDL_Picture
*
pic
)
void
SDL_FreeYUVOverlay
(
SDL_Overlay
*
overlay
)
{
/* FIXME: implement */
return
0
;
// FIXME: implement
}
ijkmediaplayer/jni/ijksdl/ijksdl_video.h
0 → 100644
浏览文件 @
0c7b54c3
/*****************************************************************************
* ijksdl_video.h
*****************************************************************************
*
* 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 IJKSDL__IJKSDL_VIDEO_H
#define IJKSDL__IJKSDL_VIDEO_H
#include "ijksdl_stdinc.h"
/** @name Useful data types */
/*@{*/
typedef
struct
SDL_Rect
{
Sint16
x
,
y
;
Uint16
w
,
h
;
}
SDL_Rect
;
typedef
struct
SDL_Color
{
Uint8
r
;
Uint8
g
;
Uint8
b
;
Uint8
unused
;
}
SDL_Color
;
#define SDL_Colour SDL_Color
typedef
struct
SDL_Palette
{
int
ncolors
;
SDL_Color
*
colors
;
}
SDL_Palette
;
/*@}*/
/** Everything in the pixel format structure is read-only */
typedef
struct
SDL_PixelFormat
{
SDL_Palette
*
palette
;
Uint8
BitsPerPixel
;
Uint8
BytesPerPixel
;
Uint8
Rloss
;
Uint8
Gloss
;
Uint8
Bloss
;
Uint8
Aloss
;
Uint8
Rshift
;
Uint8
Gshift
;
Uint8
Bshift
;
Uint8
Ashift
;
Uint32
Rmask
;
Uint32
Gmask
;
Uint32
Bmask
;
Uint32
Amask
;
/** RGB color key information */
Uint32
colorkey
;
/** Alpha value information (per-surface alpha) */
Uint8
alpha
;
}
SDL_PixelFormat
;
/** This structure should be treated as read-only, except for 'pixels',
* which, if not NULL, contains the raw pixel data for the surface.
*/
typedef
struct
SDL_Surface
{
Uint32
flags
;
/**< Read-only */
SDL_PixelFormat
*
format
;
/**< Read-only */
int
w
,
h
;
/**< Read-only */
Uint16
pitch
;
/**< Read-only */
void
*
pixels
;
/**< Read-write */
int
offset
;
/**< Private */
/** Hardware-specific surface info */
struct
private_hwdata
*
hwdata
;
/** clipping information */
SDL_Rect
clip_rect
;
/**< Read-only */
Uint32
unused1
;
/**< for binary compatibility */
/** Allow recursive locks */
Uint32
locked
;
/**< Private */
/** info for fast blit mapping to other surfaces */
struct
SDL_BlitMap
*
map
;
/**< Private */
/** format version, bumped at every change to invalidate blit maps */
unsigned
int
format_version
;
/**< Private */
/** Reference count -- used when freeing surface */
int
refcount
;
/**< Read-mostly */
}
SDL_Surface
;
/** @name SDL_Surface Flags
* These are the currently supported flags for the SDL_surface
*/
/*@{*/
/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */
/*@{*/
#define SDL_SWSURFACE 0x00000000
/**< Surface is in system memory */
#define SDL_HWSURFACE 0x00000001
/**< Surface is in video memory */
#define SDL_ASYNCBLIT 0x00000004
/**< Use asynchronous blits if possible */
/*@}*/
/** Available for SDL_SetVideoMode() */
/*@{*/
#define SDL_ANYFORMAT 0x10000000
/**< Allow any video depth/pixel-format */
#define SDL_HWPALETTE 0x20000000
/**< Surface has exclusive palette */
#define SDL_DOUBLEBUF 0x40000000
/**< Set up double-buffered video mode */
#define SDL_FULLSCREEN 0x80000000
/**< Surface is a full screen display */
#define SDL_OPENGL 0x00000002
/**< Create an OpenGL rendering context */
#define SDL_OPENGLBLIT 0x0000000A
/**< Create an OpenGL rendering context and use it for blitting */
#define SDL_RESIZABLE 0x00000010
/**< This video mode may be resized */
#define SDL_NOFRAME 0x00000020
/**< No window caption or edge frame */
/*@}*/
/** Used internally (read-only) */
/*@{*/
#define SDL_HWACCEL 0x00000100
/**< Blit uses hardware acceleration */
#define SDL_SRCCOLORKEY 0x00001000
/**< Blit uses a source color key */
#define SDL_RLEACCELOK 0x00002000
/**< Private flag */
#define SDL_RLEACCEL 0x00004000
/**< Surface is RLE encoded */
#define SDL_SRCALPHA 0x00010000
/**< Blit uses source alpha blending */
#define SDL_PREALLOC 0x01000000
/**< Surface uses preallocated memory */
/*@}*/
/*@}*/
/** @name Overlay Formats
* The most common video overlay formats.
* For an explanation of these pixel formats, see:
* http://www.webartz.com/fourcc/indexyuv.htm
*
* For information on the relationship between color spaces, see:
* http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html
*/
/*@{*/
#define SDL_YV12_OVERLAY 0x32315659
/**< Planar mode: Y + V + U (3 planes) */
#define SDL_IYUV_OVERLAY 0x56555949
/**< Planar mode: Y + U + V (3 planes) */
#define SDL_YUY2_OVERLAY 0x32595559
/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
#define SDL_UYVY_OVERLAY 0x59565955
/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
#define SDL_YVYU_OVERLAY 0x55595659
/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
/*@}*/
/** The YUV hardware video overlay */
typedef
struct
SDL_Overlay
{
Uint32
format
;
/**< Read-only */
int
w
,
h
;
/**< Read-only */
int
planes
;
/**< Read-only */
Uint16
*
pitches
;
/**< Read-only */
Uint8
**
pixels
;
/**< Read-write */
/** @name Hardware-specific surface info */
/*@{*/
struct
private_yuvhwfuncs
*
hwfuncs
;
struct
private_yuvhwdata
*
hwdata
;
/*@{*/
/** @name Special flags */
/*@{*/
Uint32
hw_overlay
:
1
;
/**< Flag: This overlay hardware accelerated? */
Uint32
UnusedBits
:
31
;
/*@}*/
}
SDL_Overlay
;
void
SDL_FreeSurface
(
SDL_Surface
*
surface
);
SDL_Overlay
*
SDL_CreateYUVOverlay
(
int
width
,
int
height
,
Uint32
format
,
SDL_Surface
*
display
);
SDL_Surface
*
SDL_SetVideoMode
(
int
width
,
int
height
,
int
bpp
,
Uint32
flags
);
int
SDL_LockYUVOverlay
(
SDL_Overlay
*
overlay
);
void
SDL_UnlockYUVOverlay
(
SDL_Overlay
*
overlay
);
int
SDL_DisplayYUVOverlay
(
SDL_Overlay
*
overlay
,
SDL_Rect
*
dstrect
);
void
SDL_FreeYUVOverlay
(
SDL_Overlay
*
overlay
);
#endif
ijkmediaplayer/jni/ijksdl/ijksdl_vout.h
已删除
100644 → 0
浏览文件 @
aec1153f
/*****************************************************************************
* ijksdl_vout.h
*****************************************************************************
*
* 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 IJKSDL__IJKSDL_VOUT_H
#define IJKSDL__IJKSDL_VOUT_H
#include "ijksdl_stdinc.h"
typedef
struct
SDL_Picture
{
Uint32
format
;
int
w
,
h
;
int
planes
;
Uint16
*
pitches
;
Uint8
**
pixels
;
}
SDL_Picture
;
typedef
struct
SDL_Vout
{
int32_t
width
;
int32_t
height
;
int32_t
format
;
}
SDL_Vout
;
SDL_Vout
*
SDL_VoutCreate
();
void
SDL_VoutFree
(
SDL_Vout
*
vout
);
int
SDL_VoutSetBuffersGeometry
(
SDL_Vout
*
vout
,
int32_t
width
,
int32_t
height
,
int32_t
format
);
int
SDL_VoutRender
(
SDL_Vout
*
vout
,
SDL_Picture
*
pic
);
int
SDL_VoutLockYUVPicture
(
SDL_Picture
*
pic
);
int
SDL_VoutUnlockYUVPicture
(
SDL_Picture
*
pic
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录