Got drawCamera start. GL error: 1281 after version 2.5.8
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 18/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- mobile-dev
Research direction
The crash is raised from GlUtil.checkGlError in com/pedro/encoder/utils/gl/GlUtil.java, called from CameraRender.draw in CameraRender.java around line 99, reached through MainRender.kt drawOffScreen and GlStreamInterface.kt. Start by reading the two linked commits to see what changed in the camera render path between 2.5.8 versions. Done would mean a reproducible fix for GL error 1281 on the SurfaceView preview path, but the thread has 46 comments and no decision, so confirm with maintainers first.
Written by the indexing model from the issue text.
Description
Hi there! I am having a crash when I start the camera render in my SurfaceView after 2.5.8 version. I think the error may when the camera is trying to start with bad parameter even that the parameters are set before starting.
The commit that worked for me was
https://github.com/pedroSG94/RootEncoder/commit/8fdb2831d18257ceacdb5c620fd1bf95c6563600
But I thing after this other change
https://github.com/pedroSG94/RootEncoder/commit/1c5482d38c5834bf8e14866ec708d2d6f5cb48dc
it crashes in my app.
I wanted to know if I can do something in my app to solve this. The error log is this:
Fatal Exception: java.lang.RuntimeException: drawCamera start. GL error: 1281
at com.pedro.encoder.utils.gl.GlUtil.checkGlError(GlUtil.java:132)
at com.pedro.encoder.input.gl.render.CameraRender.draw(CameraRender.java:99)
at com.pedro.encoder.input.gl.render.MainRender.drawOffScreen(MainRender.kt:61)
at com.pedro.library.view.GlStreamInterface.draw(GlStreamInterface.kt:270)
at com.pedro.library.view.GlStreamInterface.onFrameAvailable$lambda$4(GlStreamInterface.kt:284)
at com.pedro.library.view.GlStreamInterface.$r8$lambda$0B-KT4vcqgQlJR7AIT7c70zbmo0()
at com.pedro.library.view.GlStreamInterface$$ExternalSyntheticLambda3.run(D8$$SyntheticClass)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
If helps, this is my SurfaceView:
AndroidView(
factory = { ctx ->
SurfaceView(ctx).apply {
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
surfaceViewRef.value = this
holder.setFormat(PixelFormat.TRANSLUCENT)
holder.addCallback(object : SurfaceHolder.Callback {
override fun surfaceCreated(holder: SurfaceHolder) {
if (!genericStream.isOnPreview) {
genericStream.startPreview(this@apply)
}
}
override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
genericStream.getGlInterface().setPreviewResolution(width, height)
}
override fun surfaceDestroyed(holder: SurfaceHolder) {
if (genericStream.isOnPreview) {
genericStream.stopPreview()
}
}
})
}
},
modifier = Modifier.fillMaxSize()
)
This is how I instantiate generic stream:
val genericStream = remember {
GenericStream(context, object : ConnectChecker {
override fun onConnectionStarted(url: String) {}
override fun onConnectionSuccess() { showToast("Connected") }
override fun onConnectionFailed(reason: String) { showToast("Connection failed: $reason") }
override fun onNewBitrate(bitrate: Long) {}
override fun onDisconnect() { showToast("Disconnected") }
override fun onAuthError() { showToast("Authentication error") }
override fun onAuthSuccess() { showToast("Authentication success") }
}, activeCameraSource, audio).apply {
prepareVideo(videoWidth, videoHeight, videoBitrate, videoFPS)
prepareAudio(audioSampleRate, audioIsStereo, audioBitrate)
setTimestampMode(TimestampMode.CLOCK, TimestampMode.BUFFER)
getGlInterface().autoHandleOrientation = true
}
}
I wanted to have the library updated for the new features and upgrades! Thank you so much
- Dominant language
- Kotlin
- Stars
- 3k
- Forks
- 946
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 9
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pedroSG94/RootEncoder
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
pedroSG94/RootEncoder#2213 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
pedroSG94/RootEncoder#2207 · 1 reaction ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pedroSG94/RootEncoder#2203 ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
pedroSG94/RootEncoder#2192 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pedroSG94/RootEncoder#2177 · 44 comments ·
Maintainers usually reply within 2 days
All issues in pedroSG94/RootEncoder
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
fix: retain the best partial noise-correction solutionPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
world-federation-of-advertisers/cross-media-measurement#4653 ·
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kabirvashisht4-glitch/Vet#22 ·
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
djazairdev/wilayas#23 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lysine-dev/okhttp#9788 ·
Maintainers usually reply within 1 day