提交 5fbe30a5 编写于 作者: G guoshuyu

update

上级 0728e08e
......@@ -17,6 +17,7 @@ import com.shuyu.gsyvideoplayer.render.glrender.GSYVideoGLViewBaseRender;
import com.shuyu.gsyvideoplayer.render.view.listener.IGSYSurfaceListener;
import com.shuyu.gsyvideoplayer.utils.Debuger;
import com.shuyu.gsyvideoplayer.utils.FileUtils;
import com.shuyu.gsyvideoplayer.utils.GSYVideoType;
import com.shuyu.gsyvideoplayer.utils.MeasureHelper;
import java.io.File;
......@@ -59,14 +60,21 @@ public class GSYTextureView extends TextureView implements TextureView.SurfaceTe
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
if (mSaveTexture == null) {
mSaveTexture = surface;
mSurface = new Surface(surface);
if (GSYVideoType.isMediaCodecTexture()) {
if (mSaveTexture == null) {
mSaveTexture = surface;
mSurface = new Surface(surface);
} else {
setSurfaceTexture(mSaveTexture);
}
if (mIGSYSurfaceListener != null) {
mIGSYSurfaceListener.onSurfaceAvailable(mSurface);
}
} else {
setSurfaceTexture(mSaveTexture);
}
if (mIGSYSurfaceListener != null) {
mIGSYSurfaceListener.onSurfaceAvailable(mSurface);
mSurface = new Surface(surface);
if (mIGSYSurfaceListener != null) {
mIGSYSurfaceListener.onSurfaceAvailable(mSurface);
}
}
}
......@@ -79,11 +87,16 @@ public class GSYTextureView extends TextureView implements TextureView.SurfaceTe
@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
//清空释放
if (mIGSYSurfaceListener != null) {
mIGSYSurfaceListener.onSurfaceDestroyed(mSurface);
}
return (mSaveTexture == null);
if (GSYVideoType.isMediaCodecTexture()) {
return (mSaveTexture == null);
} else {
return true;
}
}
@Override
......
......@@ -35,7 +35,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//api project(':gsyVideoPlayer-java')
api project(':gsyVideoPlayer-java')
//api project(':gsyVideoPlayer-exo_player2')
//api project(':gsyVideoPlayer-armv5')
//api project(':gsyVideoPlayer-armv7a')
......@@ -48,7 +48,7 @@ dependencies {
//api "com.shuyu:GSYVideoPlayer:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion"
//api "com.shuyu:gsyVideoPlayer-java:$gsyVideoVersion"
api "com.shuyu:GSYVideoPlayer-exo2:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv5:$gsyVideoVersion"
api "com.shuyu:gsyVideoPlayer-armv7a:$gsyVideoVersion"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册