Closed caraesten closed 3 months ago
Thanks for this.
I recently added the library to jitpack.io, so hopefully you won't have to built it locally anymore.
If you have any other changes, let me know.
Thanks for this.
I recently added the library to jitpack.io, so hopefully you won't have to built it locally anymore.
If you have any other changes, let me know.
will do! I'm actually working on exposing the drawSurface
method right now to minimize copying the bitmaps a little; will let you know how that goes.
So that method is a little dangerous. It assumes the Surface has the correct size and format format. You'll need to either add a call to ANativeWindow_setBuffersGeometry() on the C side, or SurfaceHolder.setFixedSize() and SurfaceHolder.setFormat()
Oh, one more thing the Surface will stretch the image to fill it's bounds, so the aspect ratio will likely be wrong. I use a custom SurfaceView that resizes itself in one my apps. Another option is to use ConstraintLayout's app:layout_constraintDimensionRatio. If you don't know the final aspect ratio you can update it on the fly by change the SurfaceView's layoutParams in code.
ahh thanks! yeah, I sort of ran into what you're describing w/r/t aspect ratio, and instead, decided to just use a hardwarebuffer directly (thanks to your library supporting hardware bitmaps!) and call GLES's glTexImage2D
w/ a pointer to that buffer. works a lot better for me and I can fit it into existing GL libraries (specifically, android-gpuimage). That way, I can use something else that already handles scaling; the hard part was avoiding copying the entire huge bitmap several times, and this solution manages it.
thanks for the replies by the way! great to see active maintenance on this :)
Was just testing out this library in WSL on a Windows 11 NTFS volume and noticed this tiny thing. Figured I would just contribute it back since I already have it on my local, and it might help someone else :)