From 7a02ce49c8a8f0bdf0b88c67c69f3acfc44f7bfe Mon Sep 17 00:00:00 2001 From: xiaowusky Date: Thu, 30 Nov 2023 15:42:31 +0800 Subject: [PATCH] =?UTF-8?q?desc:=E8=B0=83=E6=95=B4=E5=BD=95=E5=83=8F?= =?UTF-8?q?=E6=B0=B4=E5=8D=B0=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yinuo/safetywatcher/watcher/utils/RecordHelper.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/RecordHelper.kt b/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/RecordHelper.kt index 4f41285..3385b27 100644 --- a/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/RecordHelper.kt +++ b/app/src/main/java/com/yinuo/safetywatcher/watcher/utils/RecordHelper.kt @@ -10,6 +10,7 @@ object RecordHelper { private val codecManager: MediaCodecManager = MediaCodecManager.getInstance() private const val width = 1920 private const val height = 1080 + private const val overlayOffset = 20 private var recording = false; init { @@ -24,7 +25,7 @@ object RecordHelper { overLayBitmap?.let { val yuv = TxtOverlay.getOverlayYuv() yuv?.let { - for ((j, i) in (100 until overLayBitmap.height + 100).withIndex()) { + for ((j, i) in (overlayOffset until overLayBitmap.height + overlayOffset).withIndex()) { for (c in 0 until overLayBitmap.width) { //去掉PNG水印的黑边 if (yuv[j * overLayBitmap.width + c] @@ -35,7 +36,7 @@ object RecordHelper { yuv, j * overLayBitmap.width + c, nv12Data, - 100 + i * 1920 + c, + overlayOffset + i * width + c, 1 ) }