From 152fc4c86ff52552f748aa26e9117e0b4b6ad08f Mon Sep 17 00:00:00 2001 From: hexleo Date: Mon, 29 Nov 2021 10:38:49 +0800 Subject: [PATCH] =?UTF-8?q?bug:=20=E8=A7=A3=E5=86=B3=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E4=B8=8D=E5=90=8Cfps=E7=B4=A0=E6=9D=90=E5=AF=BC=E8=87=B4fps?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=20close=20#176?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/tencent/qgame/animplayer/AnimConfigManager.kt | 1 + .../src/main/java/com/tencent/qgame/animplayer/AnimPlayer.kt | 4 +++- .../src/main/java/com/tencent/qgame/animplayer/AnimView.kt | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimConfigManager.kt b/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimConfigManager.kt index c6293511..d7d8cc93 100644 --- a/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimConfigManager.kt +++ b/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimConfigManager.kt @@ -144,6 +144,7 @@ class AnimConfigManager(val player: AnimPlayer) { this.defaultVideoMode = defaultVideoMode fps = defaultFps } + player.fps = config.fps return true } diff --git a/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimPlayer.kt b/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimPlayer.kt index 47584951..2dbb1457 100644 --- a/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimPlayer.kt +++ b/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimPlayer.kt @@ -35,6 +35,8 @@ class AnimPlayer(val animView: IAnimView) { decoder?.fps = value field = value } + // 设置默认的fps <= 0 表示以vapc配置为准 > 0 表示以此设置为准 + var defaultFps: Int = 0 var playLoop: Int = 0 set(value) { decoder?.playLoop = value @@ -84,7 +86,7 @@ class AnimPlayer(val animView: IAnimView) { } // 在线程中解析配置 decoder?.renderThread?.handler?.post { - val result = configManager.parseConfig(fileContainer, enableVersion1, videoMode, fps) + val result = configManager.parseConfig(fileContainer, enableVersion1, videoMode, defaultFps) if (result != Constant.OK) { isStartRunning = false decoder?.onFailed(result, Constant.getErrorMsg(result)) diff --git a/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimView.kt b/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimView.kt index d66b1f03..e5c4afaf 100644 --- a/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimView.kt +++ b/Android/PlayerProj/animplayer/src/main/java/com/tencent/qgame/animplayer/AnimView.kt @@ -231,7 +231,8 @@ open class AnimView @JvmOverloads constructor(context: Context, attrs: Attribute } override fun setFps(fps: Int) { - player.fps = fps + ALog.i(TAG, "setFps=$fps") + player.defaultFps = fps } override fun setScaleType(type : ScaleType) {