desc:离开首页,停止视频前台渲染

main
xiaowusky 1 year ago
parent 70b676316e
commit 69f1f84f24

@ -370,7 +370,11 @@ public class Client implements Closeable {
paused = 1;
Log.i(TAG, "pause:=" + 1);
h.postDelayed(closeTask, 10000);
// h.postDelayed(closeTask, 10000);
}
public boolean isPaused() {
return paused > 0;
}
public void resume() {

@ -972,17 +972,19 @@ public class EasyPlayerClient implements Client.SourceCallBack {
System.arraycopy(in, 0, nv12Data, 0, in.length);
// nv12
i420callback.onI420Data(nv12Data);
// yuvuv_to_yuv
JNIUtil.yuvConvert(in, realWidth, realHeight, 4);
if (!mClient.isPaused()) {
// yuvuv_to_yuv
JNIUtil.yuvConvert(in, realWidth, realHeight, 4);
// // 旋转90或180或270度
// yuvRotate(in, 0, realWidth, realHeight, 90);
if (displayTmp == null) {
displayTmp = ByteBuffer.allocateDirect(realWidth * realHeight * 3 / 2);
if (displayTmp == null) {
displayTmp = ByteBuffer.allocateDirect(realWidth * realHeight * 3 / 2);
}
displayTmp.clear();
displayTmp.put(in);
// 旋转90或270度则宽高需要互换
displayer.decoder_decodeBuffer(displayTmp, realWidth, realHeight);
}
displayTmp.clear();
displayTmp.put(in);
// 旋转90或270度则宽高需要互换
displayer.decoder_decodeBuffer(displayTmp, realWidth, realHeight);
} else {
mIndex = 0;
}

Loading…
Cancel
Save