java.lang.IllegalStateException: configure() is valid only at Initialized state; currently during configure()
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 22/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- audio-video-rtc, mobile
Hướng nghiên cứu
The trace runs from StreamBase.stopStream (StreamBase.kt:252) into prepareEncoders (StreamBase.kt:575) and then VideoEncoder.prepareVideoEncoder (VideoEncoder.java:172), where MediaCodec.configure() is called while a configure is already in progress. Start by reading how stopStream and prepareEncoders manage encoder state, then reproduce with a quick stop during streaming. Done means stopping a stream no longer throws this exception, and the existing stream tests still pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The application crashes with an IllegalStateException when attempting to stop a screen sharing stream. The error occurs because MediaCodec.configure() is called from an invalid state (during configure()) instead of the required Initialized state.
To Reproduce
Steps to reproduce the behavior:
- Start screen sharing using
ShareScreenService - Initiate stream stop procedure
if (genericStream.isStreaming) {
GlobalScope.launch(Dispatchers.Main) { // Or a custom scope
withContext(Dispatchers.IO) { // Perform blocking operation on IO dispatcher
genericStream.stopStream()
}
}
}
- Observe crash with the following stack trace
Expected behavior
The stream should stop cleanly without throwing an IllegalStateException.
Error Log
configure() is valid only at Initialized state; currently during configure()
2025-12-18 14:29:06.518 30621-30665 VideoEncoder com...rvasystem.quickscreenrecorder E Create VideoEncoder failed. (Explain with AI)
java.lang.IllegalStateException: configure() is valid only at Initialized state; currently during configure()
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2562)
at android.media.MediaCodec.configure(MediaCodec.java:2422)
at com.pedro.encoder.video.VideoEncoder.prepareVideoEncoder(VideoEncoder.java:172)
at com.pedro.encoder.video.VideoEncoder.prepareVideoEncoder(VideoEncoder.java:237)
at com.pedro.library.base.StreamBase.prepareEncoders(StreamBase.kt:575)
at com.pedro.library.base.StreamBase.stopStream(StreamBase.kt:252)
at com.atharvasystem.quickscreenrecorder.services.ShareScreenService$stopStream$1$1.invokeSuspend(ShareScreenService.kt:148)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
Environment Information
- Library Version:
com.github.pedroSG94.RootEncoder:library:2.6.6 - Device: Android Emulator
- OS: Android 16
- Media Server: Local RTMP Server
- Class Used:
GenericStream
- Ngôn ngữ chính
- Kotlin
- Star
- 3k
- Fork
- 946
- Merge trung bình
- 4 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pedroSG94/RootEncoder
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
pedroSG94/RootEncoder#2213 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
pedroSG94/RootEncoder#2207 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pedroSG94/RootEncoder#2203 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
pedroSG94/RootEncoder#2192 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pedroSG94/RootEncoder#2177 · 44 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của pedroSG94/RootEncoder
Issue tương tự
-
Dev
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ankidroid/Anki-Android#22555 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Good first issue: add kotlin-spring-boot stack budget preset (Kotlin + Spring Boot 3 + Gradle)Đang mởenhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
core: RAC_LLM_OPTIONS_DEFAULT.min_p disagrees with the IDL's annotated defaultCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug core p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Java and Kotlin (JVM): parse gradle/wrapper/gradle-wrapper.properties with exact line locationsĐang mởarea: detector eco: java help wanted lane: free-agent roadmap size: S type: parser
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
arminazimi/evergreen#355 ·
Maintainer thường phản hồi trong vòng 1 ngày