提交 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 #### Version: 12.6.1 2025.06.20
##### Features: ##### Features:
- fix known issue - fix known issue
-
#### Version: 12.6.0 2025.06.20 #### Version: 12.6.0 2025.06.20
......
...@@ -5,7 +5,7 @@ buildLog() { ...@@ -5,7 +5,7 @@ buildLog() {
} }
inputVersion=$1 inputVersion=$1
export VERSION_NAME="12.6.1" export VERSION_NAME="12.6.2"
if [ -n "$inputVersion" ]; then if [ -n "$inputVersion" ]; then
VERSION_NAME=$inputVersion VERSION_NAME=$inputVersion
fi fi
......
...@@ -4,7 +4,7 @@ rootProject.ext { ...@@ -4,7 +4,7 @@ rootProject.ext {
supportSdkVersion = "26.0.1" supportSdkVersion = "26.0.1"
minSdkVersion = 19 minSdkVersion = 19
targetSdkVersion = 28 targetSdkVersion = 28
playerVersion = "12.6.1" playerVersion = "12.6.2"
compat = "androidx.appcompat:appcompat:1.6.1" compat = "androidx.appcompat:appcompat:1.6.1"
/** /**
...@@ -14,5 +14,5 @@ rootProject.ext { ...@@ -14,5 +14,5 @@ rootProject.ext {
Professional SDK: liteavSdk="com.tencent.liteav:LiteAVSDK_Professional:latest.release" 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" 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 ...@@ -307,6 +307,9 @@ public class FTXVodPlayer extends FTXVodPlayerRenderHost implements ITXVodPlayLi
int startPlayerVodPlay(String url) { int startPlayerVodPlay(String url) {
if (mVodPlayer != null) { if (mVodPlayer != null) {
if (null != mCurRenderView) {
mCurRenderView.setPlayer(this);
}
return mVodPlayer.startVodPlay(url); return mVodPlayer.startVodPlay(url);
} }
return Uninitialized; return Uninitialized;
...@@ -331,7 +334,6 @@ public class FTXVodPlayer extends FTXVodPlayerRenderHost implements ITXVodPlayLi ...@@ -331,7 +334,6 @@ public class FTXVodPlayer extends FTXVodPlayerRenderHost implements ITXVodPlayLi
if (isNeedClearLastImg && null != mCurRenderView) { if (isNeedClearLastImg && null != mCurRenderView) {
LiteavLog.i(TAG, "stopPlay target clear last img, player:" + hashCode()); LiteavLog.i(TAG, "stopPlay target clear last img, player:" + hashCode());
mCurRenderView.clearTexture(); mCurRenderView.clearTexture();
mCurRenderView.setPlayer(this);
} }
return result; return result;
} }
......
...@@ -24,7 +24,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -24,7 +24,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private static final long FRAME_WAIT_TIME = 5000; private static final long FRAME_WAIT_TIME = 5000;
private static final int FPS_DEFAULT = 30; private static final int FPS_DEFAULT = 30;
// min refresh count for obtain new img // 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 SurfaceTexture mSurfaceTexture;
private FTXTextureRender mTextureRender; private FTXTextureRender mTextureRender;
...@@ -45,7 +45,6 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -45,7 +45,6 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private int mHeight; private int mHeight;
private boolean mStart = false; private boolean mStart = false;
private final Lock mLock = new ReentrantLock(); private final Lock mLock = new ReentrantLock();
private final Condition mCondition = mLock.newCondition();
private long mPreTime = 0; private long mPreTime = 0;
private long mCurrentTime; private long mCurrentTime;
private long mRenderMode = FTXPlayerConstants.FTXRenderMode.FULL_FILL_CONTAINER; private long mRenderMode = FTXPlayerConstants.FTXRenderMode.FULL_FILL_CONTAINER;
...@@ -56,6 +55,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -56,6 +55,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private HandlerThread mDrawHandlerThread = new HandlerThread(TAG); private HandlerThread mDrawHandlerThread = new HandlerThread(TAG);
private Handler mDrawHandler = null; private Handler mDrawHandler = null;
private boolean isReleased = false; private boolean isReleased = false;
private boolean mIsFirstFrame = false;
public FTXEGLRender(int width, int height) { public FTXEGLRender(int width, int height) {
this(width, height, FPS_DEFAULT); this(width, height, FPS_DEFAULT);
...@@ -81,9 +81,14 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -81,9 +81,14 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
mDrawHandler.post(new Runnable() { mDrawHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
mLock.lock(); if (!mIsFirstFrame) {
startDrawSurface(); mLock.lock();
mLock.unlock(); startDrawSurface();
mLock.unlock();
} else {
mIsFirstFrame = false;
refreshRender();
}
} }
}); });
} }
...@@ -102,10 +107,10 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -102,10 +107,10 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
} }
mCurrentTime = System.currentTimeMillis(); mCurrentTime = System.currentTimeMillis();
mSurfaceTexture.updateTexImage();
drawImage(); drawImage();
swapBuffers(); swapBuffers();
mPreTime = mCurrentTime; mPreTime = mCurrentTime;
mSurfaceTexture.updateTexImage();
} catch (Exception e) { } catch (Exception e) {
LiteavLog.e(TAG, "startDrawSurface error: " + e); LiteavLog.e(TAG, "startDrawSurface error: " + e);
} finally { } finally {
...@@ -120,6 +125,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -120,6 +125,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
public boolean initOpengl(Surface surface, boolean needClearOld) { public boolean initOpengl(Surface surface, boolean needClearOld) {
LiteavLog.i(TAG, "initOpengl " + (null == surface ? "null" : "")); LiteavLog.i(TAG, "initOpengl " + (null == surface ? "null" : ""));
isReleased = false; isReleased = false;
mIsFirstFrame = true;
boolean bRet = true; boolean bRet = true;
do { do {
saveCurrentEglEnvironment(); saveCurrentEglEnvironment();
...@@ -212,7 +218,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -212,7 +218,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
EGL14.EGL_ALPHA_SIZE, 8, EGL14.EGL_ALPHA_SIZE, 8,
EGL14.EGL_DEPTH_SIZE, 8, EGL14.EGL_DEPTH_SIZE, 8,
EGL14.EGL_STENCIL_SIZE, 8, EGL14.EGL_STENCIL_SIZE, 8,
EGL14.EGL_RENDERABLE_TYPE, 4, EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT,
EGL14.EGL_NONE EGL14.EGL_NONE
}; };
...@@ -285,31 +291,91 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -285,31 +291,91 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
} }
private void saveCurrentEglEnvironment() { private void saveCurrentEglEnvironment() {
mEGLSavedContext = EGL14.eglGetCurrentContext(); try {
mEGLSavedDisplay = EGL14.eglGetCurrentDisplay(); // 获取当前环境
mEGLSaveDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW); mEGLSavedDisplay = EGL14.eglGetCurrentDisplay();
mEGLSaveReadSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_READ); mEGLSavedContext = EGL14.eglGetCurrentContext();
} mEGLSaveDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
mEGLSaveReadSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_READ);
private void restoreEglEnvironment() {
if (mEGLSavedDisplay != EGL14.EGL_NO_DISPLAY && mEGLSavedContext != EGL14.EGL_NO_CONTEXT // 检查有效性
&& !mEGLSavedContext.equals(mEGLContextEncoder)) { if (mEGLSavedDisplay == EGL14.EGL_NO_DISPLAY || mEGLSavedContext == EGL14.EGL_NO_CONTEXT) {
if (!EGL14.eglMakeCurrent(mEGLSavedDisplay, mEGLSaveDrawSurface, mEGLSaveReadSurface, mEGLSavedContext)) { LiteavLog.w(TAG, "Saving invalid EGL state");
LiteavLog.e(TAG, "restoreEglEnvironment eglMakeCurrent: error");
}
} 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");
} }
} catch (Exception e) {
LiteavLog.e(TAG, "Save EGL error: " + e);
resetSavedEnvironment();
} }
}
private void resetSavedEnvironment() {
mEGLSavedDisplay = EGL14.EGL_NO_DISPLAY; mEGLSavedDisplay = EGL14.EGL_NO_DISPLAY;
mEGLSaveDrawSurface = EGL14.EGL_NO_SURFACE; mEGLSaveDrawSurface = EGL14.EGL_NO_SURFACE;
mEGLSaveReadSurface = EGL14.EGL_NO_SURFACE; mEGLSaveReadSurface = EGL14.EGL_NO_SURFACE;
mEGLSavedContext = EGL14.EGL_NO_CONTEXT; mEGLSavedContext = EGL14.EGL_NO_CONTEXT;
} }
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() { private void releaseEgl() {
if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) { if (mEGLDisplay != EGL14.EGL_NO_DISPLAY) {
EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE,
......
...@@ -28,6 +28,8 @@ public class FTXTextureContainer extends FrameLayout { ...@@ -28,6 +28,8 @@ public class FTXTextureContainer extends FrameLayout {
mTextureHolder.removeAllSurfaceListener(); mTextureHolder.removeAllSurfaceListener();
} else { } else {
LiteavLog.i(TAG, "start add new carrier:" + carrier + ",view:" + hashCode()); LiteavLog.i(TAG, "start add new carrier:" + carrier + ",view:" + hashCode());
// remove old
removeView((View) mTextureHolder);
addView((View) carrier); addView((View) carrier);
} }
mTextureHolder = carrier; mTextureHolder = carrier;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'super_player' 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.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 s.description = <<-DESC
player plugin. player plugin.
...@@ -26,7 +26,7 @@ player plugin. ...@@ -26,7 +26,7 @@ player plugin.
# Player_Premium SDK: s.dependency 'TXLiteAVSDK_Player_Premium' # Player_Premium SDK: s.dependency 'TXLiteAVSDK_Player_Premium'
# Professional SDK: s.dependency 'TXLiteAVSDK_Professional' # 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' # 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.dependency 'FTXPiPKit'
s.vendored_frameworks = [ s.vendored_frameworks = [
'localdep/FTXPiPKit.xcframework' 'localdep/FTXPiPKit.xcframework'
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
part of SuperPlayer; part of SuperPlayer;
abstract class FPlayerPckInfo { 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 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). 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 homepage: https://github.com/LiteAVSDK/Player_Flutter
environment: environment:
......
...@@ -3,5 +3,5 @@ part of demo_super_player_lib; ...@@ -3,5 +3,5 @@ part of demo_super_player_lib;
class PlayerConstants { class PlayerConstants {
static const PKG_NAME = "superplayer_widget"; 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 { ...@@ -145,7 +145,6 @@ class SuperPlayerController {
} }
videoDuration = await _vodPlayerController.getDuration(); videoDuration = await _vodPlayerController.getDuration();
currentDuration = await _vodPlayerController.getCurrentPlaybackTime(); currentDuration = await _vodPlayerController.getCurrentPlaybackTime();
List<TXTrackInfo> aaa = await _vodPlayerController.getAudioTrackInfo();
_onSelectTrackInfoWhenPrepare(); _onSelectTrackInfoWhenPrepare();
break; break;
case TXVodPlayEvent.PLAY_EVT_PLAY_LOADING: // PLAY_EVT_PLAY_LOADING case TXVodPlayEvent.PLAY_EVT_PLAY_LOADING: // PLAY_EVT_PLAY_LOADING
......
name: superplayer_widget name: superplayer_widget
description: superplayer,base on vodplayer description: superplayer,base on vodplayer
version: 12.6.1 version: 12.6.2
environment: environment:
sdk: '>=2.17.0 <4.0.0' sdk: '>=2.17.0 <4.0.0'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论