desc:调整录像水印的位置

main
xiaowusky 1 year ago
parent 17748cf3cf
commit 7a02ce49c8

@ -10,6 +10,7 @@ object RecordHelper {
private val codecManager: MediaCodecManager = MediaCodecManager.getInstance() private val codecManager: MediaCodecManager = MediaCodecManager.getInstance()
private const val width = 1920 private const val width = 1920
private const val height = 1080 private const val height = 1080
private const val overlayOffset = 20
private var recording = false; private var recording = false;
init { init {
@ -24,7 +25,7 @@ object RecordHelper {
overLayBitmap?.let { overLayBitmap?.let {
val yuv = TxtOverlay.getOverlayYuv() val yuv = TxtOverlay.getOverlayYuv()
yuv?.let { 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) { for (c in 0 until overLayBitmap.width) {
//去掉PNG水印的黑边 //去掉PNG水印的黑边
if (yuv[j * overLayBitmap.width + c] if (yuv[j * overLayBitmap.width + c]
@ -35,7 +36,7 @@ object RecordHelper {
yuv, yuv,
j * overLayBitmap.width + c, j * overLayBitmap.width + c,
nv12Data, nv12Data,
100 + i * 1920 + c, overlayOffset + i * width + c,
1 1
) )
} }

Loading…
Cancel
Save