Skip to content

Commit c7f5ffe

Browse files
author
Dan Oprea
committed
On my device this it much faster
1 parent 265fa55 commit c7f5ffe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/dan/timelapse/VideoEncoder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class VideoEncoder(
6363
}
6464

6565
private val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
66-
private val bitmapRect = Rect(0,0, width, height)
66+
private val bitmapRect = Rect(0,0, width - 1, height - 1)
6767
private var frameIndex = 0
6868
private var open = true
6969
private var videoTrackIndex = -1
@@ -113,7 +113,7 @@ class VideoEncoder(
113113

114114
Utils.matToBitmap(frame, bitmap)
115115

116-
val canvas = surface.lockHardwareCanvas() ?: return
116+
val canvas = surface.lockCanvas(null) ?: return
117117
canvas.drawBitmap(bitmap, null, bitmapRect, null)
118118
surface.unlockCanvasAndPost(canvas)
119119

0 commit comments

Comments
 (0)