Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ac13
GSYVideoPlayer
提交
e2dc9c80
G
GSYVideoPlayer
项目概览
ac13
/
GSYVideoPlayer
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
GSYVideoPlayer
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e2dc9c80
编写于
12月 11, 2017
作者:
G
guoshuyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改gl render的模式
上级
054ad9a5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
95 addition
and
21 deletion
+95
-21
app/src/main/java/com/example/gsyvideoplayer/DetailFilterActivity.java
...java/com/example/gsyvideoplayer/DetailFilterActivity.java
+4
-2
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
...rc/main/java/com/example/gsyvideoplayer/DetailPlayer.java
+2
-2
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/glrender/GSYVideoGLViewBaseRender.java
...videoplayer/render/glrender/GSYVideoGLViewBaseRender.java
+57
-0
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/glrender/GSYVideoGLViewSimpleRender.java
...deoplayer/render/glrender/GSYVideoGLViewSimpleRender.java
+0
-15
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/view/GSYVideoGLView.java
.../com/shuyu/gsyvideoplayer/render/view/GSYVideoGLView.java
+28
-1
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java
...ava/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java
+4
-1
未找到文件。
app/src/main/java/com/example/gsyvideoplayer/DetailFilterActivity.java
浏览文件 @
e2dc9c80
package
com.example.gsyvideoplayer
;
package
com.example.gsyvideoplayer
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.opengl.Matrix
;
import
android.opengl.Matrix
;
import
android.os.Bundle
;
import
android.os.Bundle
;
...
@@ -109,6 +110,7 @@ public class DetailFilterActivity extends GSYBaseActivityDetail {
...
@@ -109,6 +110,7 @@ public class DetailFilterActivity extends GSYBaseActivityDetail {
private
float
deep
=
0.8f
;
private
float
deep
=
0.8f
;
private
String
url
=
"https://res.exexm.com/cw_145225549855002"
;
private
String
url
=
"https://res.exexm.com/cw_145225549855002"
;
//private String url = "http://9890.vod.myqcloud.com/9890_4e292f9a3dd011e6b4078980237cc3d3.f20.mp4";
private
Timer
timer
=
new
Timer
();
private
Timer
timer
=
new
Timer
();
...
@@ -159,11 +161,11 @@ public class DetailFilterActivity extends GSYBaseActivityDetail {
...
@@ -159,11 +161,11 @@ public class DetailFilterActivity extends GSYBaseActivityDetail {
//自定义render需要在播放器开始播放之前,播放过程中不允许切换render
//自定义render需要在播放器开始播放之前,播放过程中不允许切换render
//水印图效果
//水印图效果
/*
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
Bitmap
bitmap
=
BitmapFactory
.
decodeResource
(
getResources
(),
R
.
mipmap
.
ic_launcher
);
mGSYVideoGLViewCustomRender
=
new
GSYVideoGLViewCustomRender
();
mGSYVideoGLViewCustomRender
=
new
GSYVideoGLViewCustomRender
();
mCustomBitmapIconEffect
=
new
BitmapIconEffect
(
bitmap
,
dp2px
(
50
),
dp2px
(
50
),
0.6f
);
mCustomBitmapIconEffect
=
new
BitmapIconEffect
(
bitmap
,
dp2px
(
50
),
dp2px
(
50
),
0.6f
);
mGSYVideoGLViewCustomRender
.
setBitmapEffect
(
mCustomBitmapIconEffect
);
mGSYVideoGLViewCustomRender
.
setBitmapEffect
(
mCustomBitmapIconEffect
);
detailPlayer.setCustomGLRenderer(mGSYVideoGLViewCustomRender);
*/
detailPlayer
.
setCustomGLRenderer
(
mGSYVideoGLViewCustomRender
);
//多窗口播放效果
//多窗口播放效果
//detailPlayer.setEffectFilter(new GammaEffect(0.8f));
//detailPlayer.setEffectFilter(new GammaEffect(0.8f));
...
...
app/src/main/java/com/example/gsyvideoplayer/DetailPlayer.java
浏览文件 @
e2dc9c80
...
@@ -57,7 +57,7 @@ public class DetailPlayer extends AppCompatActivity {
...
@@ -57,7 +57,7 @@ public class DetailPlayer extends AppCompatActivity {
//断网自动重新链接,url前接上ijkhttphook:
//断网自动重新链接,url前接上ijkhttphook:
//String url = "ijkhttphook:https://res.exexm.com/cw_145225549855002";
//String url = "ijkhttphook:https://res.exexm.com/cw_145225549855002";
String
url
=
"http
s://res.exexm.com/cw_145225549855002
"
;
String
url
=
"http
://7xjmzj.com1.z0.glb.clouddn.com/20171026175005_JObCxCE2.mp4
"
;
//String url = "http://103.233.191.21/riak/riak-bucket/6469ac502e813a4c1df7c99f364e70c1.mp4";
//String url = "http://103.233.191.21/riak/riak-bucket/6469ac502e813a4c1df7c99f364e70c1.mp4";
//String url = "http://7xjmzj.com1.z0.glb.clouddn.com/20171026175005_JObCxCE2.mp4";
//String url = "http://7xjmzj.com1.z0.glb.clouddn.com/20171026175005_JObCxCE2.mp4";
//String url = "https://media6.smartstudy.com/ae/07/3997/2/dest.m3u8";
//String url = "https://media6.smartstudy.com/ae/07/3997/2/dest.m3u8";
...
@@ -110,7 +110,7 @@ public class DetailPlayer extends AppCompatActivity {
...
@@ -110,7 +110,7 @@ public class DetailPlayer extends AppCompatActivity {
.
setNeedLockFull
(
true
)
.
setNeedLockFull
(
true
)
.
setSeekRatio
(
1
)
.
setSeekRatio
(
1
)
.
setUrl
(
url
)
.
setUrl
(
url
)
.
setCacheWithPlay
(
tru
e
)
.
setCacheWithPlay
(
fals
e
)
.
setVideoTitle
(
"测试视频"
)
.
setVideoTitle
(
"测试视频"
)
.
setStandardVideoAllCallBack
(
new
SampleListener
()
{
.
setStandardVideoAllCallBack
(
new
SampleListener
()
{
@Override
@Override
...
...
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/glrender/GSYVideoGLViewBaseRender.java
浏览文件 @
e2dc9c80
...
@@ -6,6 +6,7 @@ import android.graphics.SurfaceTexture;
...
@@ -6,6 +6,7 @@ import android.graphics.SurfaceTexture;
import
android.opengl.GLES20
;
import
android.opengl.GLES20
;
import
android.opengl.GLException
;
import
android.opengl.GLException
;
import
android.opengl.GLSurfaceView
;
import
android.opengl.GLSurfaceView
;
import
android.opengl.Matrix
;
import
android.view.Surface
;
import
android.view.Surface
;
import
com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView
;
import
com.shuyu.gsyvideoplayer.render.view.GSYVideoGLView
;
...
@@ -30,6 +31,18 @@ public abstract class GSYVideoGLViewBaseRender implements GLSurfaceView.Renderer
...
@@ -30,6 +31,18 @@ public abstract class GSYVideoGLViewBaseRender implements GLSurfaceView.Renderer
protected
GLSurfaceView
mSurfaceView
;
protected
GLSurfaceView
mSurfaceView
;
protected
float
[]
mMVPMatrix
=
new
float
[
16
];
protected
float
[]
mSTMatrix
=
new
float
[
16
];
protected
int
mCurrentViewWidth
=
0
;
protected
int
mCurrentViewHeight
=
0
;
protected
int
mCurrentVideoWidth
=
0
;
protected
int
mCurrentVideoHeight
=
0
;
public
abstract
void
releaseAll
();
public
abstract
void
releaseAll
();
...
@@ -139,10 +152,15 @@ public abstract class GSYVideoGLViewBaseRender implements GLSurfaceView.Renderer
...
@@ -139,10 +152,15 @@ public abstract class GSYVideoGLViewBaseRender implements GLSurfaceView.Renderer
this
.
mGSYSurfaceListener
=
onSurfaceListener
;
this
.
mGSYSurfaceListener
=
onSurfaceListener
;
}
}
public
float
[]
getMVPMatrix
()
{
return
mMVPMatrix
;
}
/**
/**
* 形变动画
* 形变动画
*/
*/
public
void
setMVPMatrix
(
float
[]
MVPMatrix
)
{
public
void
setMVPMatrix
(
float
[]
MVPMatrix
)
{
this
.
mMVPMatrix
=
MVPMatrix
;
}
}
/**
/**
...
@@ -159,11 +177,50 @@ public abstract class GSYVideoGLViewBaseRender implements GLSurfaceView.Renderer
...
@@ -159,11 +177,50 @@ public abstract class GSYVideoGLViewBaseRender implements GLSurfaceView.Renderer
/**
/**
* 设置滤镜效果
* 设置滤镜效果
*
* @param shaderEffect
* @param shaderEffect
*/
*/
public
void
setEffect
(
GSYVideoGLView
.
ShaderInterface
shaderEffect
)
{
public
void
setEffect
(
GSYVideoGLView
.
ShaderInterface
shaderEffect
)
{
}
}
public
int
getCurrentViewWidth
()
{
return
mCurrentViewWidth
;
}
public
void
setCurrentViewWidth
(
int
currentViewWidth
)
{
this
.
mCurrentViewWidth
=
currentViewWidth
;
}
public
int
getCurrentViewHeight
()
{
return
mCurrentViewHeight
;
}
public
void
setCurrentViewHeight
(
int
currentViewHeight
)
{
this
.
mCurrentViewHeight
=
currentViewHeight
;
}
public
int
getCurrentVideoWidth
()
{
return
mCurrentVideoWidth
;
}
public
void
setCurrentVideoWidth
(
int
currentVideoWidth
)
{
this
.
mCurrentVideoWidth
=
currentVideoWidth
;
}
public
int
getCurrentVideoHeight
()
{
return
mCurrentVideoHeight
;
}
public
void
setCurrentVideoHeight
(
int
currentVideoHeight
)
{
this
.
mCurrentVideoHeight
=
currentVideoHeight
;
}
public
void
initRenderSize
()
{
if
(
mCurrentViewWidth
!=
0
&&
mCurrentViewHeight
!=
0
)
{
Matrix
.
scaleM
(
mMVPMatrix
,
0
,
(
float
)
mCurrentViewWidth
/
mSurfaceView
.
getWidth
(),
(
float
)
mCurrentViewHeight
/
mSurfaceView
.
getHeight
(),
1
);
}
}
}
}
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/glrender/GSYVideoGLViewSimpleRender.java
浏览文件 @
e2dc9c80
...
@@ -57,10 +57,6 @@ public class GSYVideoGLViewSimpleRender extends GSYVideoGLViewBaseRender {
...
@@ -57,10 +57,6 @@ public class GSYVideoGLViewSimpleRender extends GSYVideoGLViewBaseRender {
+
" vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n"
+
" vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n"
+
"}\n"
;
+
"}\n"
;
private
float
[]
mMVPMatrix
=
new
float
[
16
];
private
float
[]
mSTMatrix
=
new
float
[
16
];
private
int
mProgram
;
private
int
mProgram
;
private
int
mTextureID
[]
=
new
int
[
2
];
private
int
mTextureID
[]
=
new
int
[
2
];
...
@@ -266,10 +262,6 @@ public class GSYVideoGLViewSimpleRender extends GSYVideoGLViewBaseRender {
...
@@ -266,10 +262,6 @@ public class GSYVideoGLViewSimpleRender extends GSYVideoGLViewBaseRender {
return
maTextureHandle
;
return
maTextureHandle
;
}
}
public
float
[]
getMVPMatrix
()
{
return
mMVPMatrix
;
}
public
float
[]
getSTMatrix
()
{
public
float
[]
getSTMatrix
()
{
return
mSTMatrix
;
return
mSTMatrix
;
}
}
...
@@ -286,13 +278,6 @@ public class GSYVideoGLViewSimpleRender extends GSYVideoGLViewBaseRender {
...
@@ -286,13 +278,6 @@ public class GSYVideoGLViewSimpleRender extends GSYVideoGLViewBaseRender {
return
mEffect
.
getShader
(
mSurfaceView
);
return
mEffect
.
getShader
(
mSurfaceView
);
}
}
/**
* 形变动画
*/
public
void
setMVPMatrix
(
float
[]
MVPMatrix
)
{
this
.
mMVPMatrix
=
MVPMatrix
;
}
/**
/**
* 打开截图
* 打开截图
*/
*/
...
...
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/view/GSYVideoGLView.java
浏览文件 @
e2dc9c80
...
@@ -75,6 +75,7 @@ public class GSYVideoGLView extends GLSurfaceView {
...
@@ -75,6 +75,7 @@ public class GSYVideoGLView extends GLSurfaceView {
public
void
setCustomRenderer
(
GSYVideoGLViewBaseRender
CustomRender
)
{
public
void
setCustomRenderer
(
GSYVideoGLViewBaseRender
CustomRender
)
{
this
.
mRenderer
=
CustomRender
;
this
.
mRenderer
=
CustomRender
;
mRenderer
.
setSurfaceView
(
GSYVideoGLView
.
this
);
mRenderer
.
setSurfaceView
(
GSYVideoGLView
.
this
);
initRenderMeasure
();
}
}
public
void
setGSYSurfaceListener
(
onGSYSurfaceListener
mGSYSurfaceListener
)
{
public
void
setGSYSurfaceListener
(
onGSYSurfaceListener
mGSYSurfaceListener
)
{
...
@@ -105,10 +106,36 @@ public class GSYVideoGLView extends GLSurfaceView {
...
@@ -105,10 +106,36 @@ public class GSYVideoGLView extends GLSurfaceView {
this
.
mRenderer
.
setGSYVideoShotListener
(
listener
,
high
);
this
.
mRenderer
.
setGSYVideoShotListener
(
listener
,
high
);
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
if
(
mRenderer
!=
null
)
{
mRenderer
.
initRenderSize
();
}
}
@Override
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
measureHelper
.
prepareMeasure
(
widthMeasureSpec
,
heightMeasureSpec
,
(
int
)
getRotation
());
measureHelper
.
prepareMeasure
(
widthMeasureSpec
,
heightMeasureSpec
,
(
int
)
getRotation
());
setMeasuredDimension
(
measureHelper
.
getMeasuredWidth
(),
measureHelper
.
getMeasuredHeight
());
initRenderMeasure
();
}
protected
void
initRenderMeasure
()
{
if
(
GSYVideoManager
.
instance
().
getMediaPlayer
()
!=
null
)
{
try
{
int
videoWidth
=
GSYVideoManager
.
instance
().
getCurrentVideoWidth
();
int
videoHeight
=
GSYVideoManager
.
instance
().
getCurrentVideoHeight
();
if
(
this
.
mRenderer
!=
null
)
{
this
.
mRenderer
.
setCurrentViewWidth
(
measureHelper
.
getMeasuredWidth
());
this
.
mRenderer
.
setCurrentViewHeight
(
measureHelper
.
getMeasuredHeight
());
this
.
mRenderer
.
setCurrentVideoWidth
(
videoWidth
);
this
.
mRenderer
.
setCurrentVideoHeight
(
videoHeight
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
public
int
getSizeH
()
{
public
int
getSizeH
()
{
...
...
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java
浏览文件 @
e2dc9c80
...
@@ -466,7 +466,10 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe
...
@@ -466,7 +466,10 @@ public abstract class GSYVideoView extends GSYTextureRenderView implements GSYMe
*/
*/
protected
void
deleteCacheFileWhenError
()
{
protected
void
deleteCacheFileWhenError
()
{
clearCurrentCache
();
clearCurrentCache
();
Debuger
.
printfError
(
"Link Or mCache Error, Please Try Again"
+
mUrl
);
Debuger
.
printfError
(
"Link Or mCache Error, Please Try Again "
+
mOriginUrl
);
if
(
mCache
)
{
Debuger
.
printfError
(
"mCache Link "
+
mUrl
);
}
mUrl
=
mOriginUrl
;
mUrl
=
mOriginUrl
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录