提交 cc1ec30c authored 作者: kongdywang's avatar kongdywang

Fix the issue of the first frame not being displayed in pre-playback state & Upgrade to 12.6.2

上级 62dd0f10
#### Version: 12.6.2 2025.07.31
##### Features:
- set Android TXLiteAVSDK to 12.6.0.18891
- set iOS TXLiteAVSDK to 12.6.18894
- Fix the issue where the first frame is not displayed during pre-playback
- Fix the issue where clearing the last frame is ineffective
- fix known issue
#### Version: 12.6.1 2025.06.20
##### Features:
- fix known issue
-
#### Version: 12.6.0 2025.06.20
......
......@@ -5,7 +5,7 @@ buildLog() {
}
inputVersion=$1
export VERSION_NAME="12.6.1"
export VERSION_NAME="12.6.2"
if [ -n "$inputVersion" ]; then
VERSION_NAME=$inputVersion
fi
......
......@@ -4,7 +4,7 @@ rootProject.ext {
supportSdkVersion = "26.0.1"
minSdkVersion = 19
targetSdkVersion = 28
playerVersion = "12.6.1"
playerVersion = "12.6.2"
compat = "androidx.appcompat:appcompat:1.6.1"
/**
......@@ -14,5 +14,5 @@ rootProject.ext {
Professional SDK: liteavSdk="com.tencent.liteav:LiteAVSDK_Professional:latest.release"
If you want to specify the SDK version(eg 11.7.0.13946), use: liteavSdk="com.tencent.liteav:LiteAVSDK_Player:11.7.0.13946"
*/
liteavSdk="com.tencent.liteav:LiteAVSDK_Player:12.6.0.17772"
liteavSdk="com.tencent.liteav:LiteAVSDK_Player:12.6.0.18891"
}
\ No newline at end of file
......@@ -307,6 +307,9 @@ public class FTXVodPlayer extends FTXVodPlayerRenderHost implements ITXVodPlayLi
int startPlayerVodPlay(String url) {
if (mVodPlayer != null) {
if (null != mCurRenderView) {
mCurRenderView.setPlayer(this);
}
return mVodPlayer.startVodPlay(url);
}
return Uninitialized;
......@@ -331,7 +334,6 @@ public class FTXVodPlayer extends FTXVodPlayerRenderHost implements ITXVodPlayLi
if (isNeedClearLastImg && null != mCurRenderView) {
LiteavLog.i(TAG, "stopPlay target clear last img, player:" + hashCode());
mCurRenderView.clearTexture();
mCurRenderView.setPlayer(this);
}
return result;
}
......
......@@ -24,7 +24,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private static final long FRAME_WAIT_TIME = 5000;
private static final int FPS_DEFAULT = 30;
// min refresh count for obtain new img
private static final int RE_DRAW_COUNT = 50;
private static final int RE_DRAW_COUNT = 30;
private SurfaceTexture mSurfaceTexture;
private FTXTextureRender mTextureRender;
......@@ -45,7 +45,6 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private int mHeight;
private boolean mStart = false;
private final Lock mLock = new ReentrantLock();
private final Condition mCondition = mLock.newCondition();
private long mPreTime = 0;
private long mCurrentTime;
private long mRenderMode = FTXPlayerConstants.FTXRenderMode.FULL_FILL_CONTAINER;
......@@ -56,6 +55,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private HandlerThread mDrawHandlerThread = new HandlerThread(TAG);
private Handler mDrawHandler = null;
private boolean isReleased = false;
private boolean mIsFirstFrame = false;
public FTXEGLRender(int width, int height) {
this(width, height, FPS_DEFAULT);
......@@ -81,9 +81,14 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
mDrawHandler.post(new Runnable() {
@Override
public void run() {
if (!mIsFirstFrame) {
mLock.lock();
startDrawSurface();
mLock.unlock();
} else {
mIsFirstFrame = false;
refreshRender();
}
}
});
}
......@@ -102,10 +107,10 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
}
mCurrentTime = System.currentTimeMillis();
mSurfaceTexture.updateTexImage();
drawImage();
swapBuffers();
mPreTime = mCurrentTime;
mSurfaceTexture.updateTexImage();
} catch (Exception e) {
LiteavLog.e(TAG, "startDrawSurface error: " + e);
} finally {
......@@ -120,6 +125,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
public boolean initOpengl(Surface surface, boolean needClearOld) {
LiteavLog.i(TAG, "initOpengl " + (null == surface ? "null" : ""));
isReleased = false;
mIsFirstFrame = true;
boolean bRet = true;
do {
saveCurrentEglEnvironment();
......@@ -212,7 +218,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
EGL14.EGL_ALPHA_SIZE, 8,
EGL14.EGL_DEPTH_SIZE, 8,
EGL14.EGL_STENCIL_SIZE, 8,
EGL14.EGL_RENDERABLE_TYPE, 4,
EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT,
EGL14.EGL_NONE
};
......@@ -285,30 +291,90 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
}
private void saveCurrentEglEnvironment() {
mEGLSavedContext = EGL14.eglGetCurrentContext();
try {
// 获取当前环境
mEGLSavedDisplay = EGL14.eglGetCurrentDisplay();
mEGLSavedContext = EGL14.eglGetCurrentContext();
mEGLSaveDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
mEGLSaveReadSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_READ);
// 检查有效性
if (mEGLSavedDisplay == EGL14.EGL_NO_DISPLAY || mEGLSavedContext == EGL14.EGL_NO_CONTEXT) {
LiteavLog.w(TAG, "Saving invalid EGL state");
}
} catch (Exception e) {
LiteavLog.e(TAG, "Save EGL error: " + e);
resetSavedEnvironment();
}
}
private void restoreEglEnvironment() {
if (mEGLSavedDisplay != EGL14.EGL_NO_DISPLAY && mEGLSavedContext != EGL14.EGL_NO_CONTEXT
&& !mEGLSavedContext.equals(mEGLContextEncoder)) {
if (!EGL14.eglMakeCurrent(mEGLSavedDisplay, mEGLSaveDrawSurface, mEGLSaveReadSurface, mEGLSavedContext)) {
LiteavLog.e(TAG, "restoreEglEnvironment eglMakeCurrent: error");
private void resetSavedEnvironment() {
mEGLSavedDisplay = EGL14.EGL_NO_DISPLAY;
mEGLSaveDrawSurface = EGL14.EGL_NO_SURFACE;
mEGLSaveReadSurface = EGL14.EGL_NO_SURFACE;
mEGLSavedContext = EGL14.EGL_NO_CONTEXT;
}
} else if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) {
if (!EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT)) {
LiteavLog.e(TAG, "eglMakeCurrent unbind: error");
private void restoreEglEnvironment() {
try {
// 检查是否有效保存了EGL环境
if (mEGLSavedDisplay != EGL14.EGL_NO_DISPLAY
&& mEGLSavedContext != EGL14.EGL_NO_CONTEXT
&& mEGLSaveDrawSurface != EGL14.EGL_NO_SURFACE) {
// 检查当前环境是否已被更改
EGLDisplay currentDisplay = EGL14.eglGetCurrentDisplay();
EGLContext currentContext = EGL14.eglGetCurrentContext();
EGLSurface currentDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
// 仅在必要时才恢复环境
if (!mEGLSavedDisplay.equals(currentDisplay)
|| !mEGLSavedContext.equals(currentContext)
|| !mEGLSaveDrawSurface.equals(currentDrawSurface)) {
// 安全恢复操作
if (!EGL14.eglMakeCurrent(
mEGLSavedDisplay,
mEGLSaveDrawSurface,
mEGLSaveReadSurface,
mEGLSavedContext)) {
int error = EGL14.eglGetError();
LiteavLog.e(TAG, "Restore failed: EGL error 0x" + Integer.toHexString(error));
// 恢复失败时的安全回退
EGL14.eglMakeCurrent(
mEGLSavedDisplay,
EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_CONTEXT
);
}
}
} else {
// 没有保存环境时的默认处理
LiteavLog.w(TAG, "No valid EGL state to restore");
// 确保解绑当前上下文
if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) {
EGL14.eglMakeCurrent(
mEGLDisplay,
EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_CONTEXT
);
}
}
} catch (Exception e) {
LiteavLog.e(TAG, "Critical restore error: " + e);
} finally {
// 重置保存的环境状态
mEGLSavedDisplay = EGL14.EGL_NO_DISPLAY;
mEGLSaveDrawSurface = EGL14.EGL_NO_SURFACE;
mEGLSaveReadSurface = EGL14.EGL_NO_SURFACE;
mEGLSavedContext = EGL14.EGL_NO_CONTEXT;
}
}
private void releaseEgl() {
if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) {
......
......@@ -28,6 +28,8 @@ public class FTXTextureContainer extends FrameLayout {
mTextureHolder.removeAllSurfaceListener();
} else {
LiteavLog.i(TAG, "start add new carrier:" + carrier + ",view:" + hashCode());
// remove old
removeView((View) mTextureHolder);
addView((View) carrier);
}
mTextureHolder = carrier;
......
......@@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'super_player'
s.version = '12.6.1'
s.version = '12.6.2'
s.summary = 'The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).'
s.description = <<-DESC
player plugin.
......@@ -26,7 +26,7 @@ player plugin.
# Player_Premium SDK: s.dependency 'TXLiteAVSDK_Player_Premium'
# Professional SDK: s.dependency 'TXLiteAVSDK_Professional'
# If you want to specify the SDK version(eg 11.6.15041), use: s.dependency 'TXLiteAVSDK_Player','11.6.15041'
s.dependency 'TXLiteAVSDK_Player','12.6.18866'
s.dependency 'TXLiteAVSDK_Player','12.6.18894'
# s.dependency 'FTXPiPKit'
s.vendored_frameworks = [
'localdep/FTXPiPKit.xcframework'
......
......@@ -2,5 +2,5 @@
part of SuperPlayer;
abstract class FPlayerPckInfo {
static const String PLAYER_VERSION = "12.6.1";
static const String PLAYER_VERSION = "12.6.2";
}
\ No newline at end of file
name: super_player
description: The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).
version: 12.6.1
version: 12.6.2
homepage: https://github.com/LiteAVSDK/Player_Flutter
environment:
......
......@@ -3,5 +3,5 @@ part of demo_super_player_lib;
class PlayerConstants {
static const PKG_NAME = "superplayer_widget";
static const String PLAYER_WIDGET_VERSION = "12.6.1";
static const String PLAYER_WIDGET_VERSION = "12.6.2";
}
......@@ -145,7 +145,6 @@ class SuperPlayerController {
}
videoDuration = await _vodPlayerController.getDuration();
currentDuration = await _vodPlayerController.getCurrentPlaybackTime();
List<TXTrackInfo> aaa = await _vodPlayerController.getAudioTrackInfo();
_onSelectTrackInfoWhenPrepare();
break;
case TXVodPlayEvent.PLAY_EVT_PLAY_LOADING: // PLAY_EVT_PLAY_LOADING
......
name: superplayer_widget
description: superplayer,base on vodplayer
version: 12.6.1
version: 12.6.2
environment:
sdk: '>=2.17.0 <4.0.0'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论