java.lang.IllegalStateException: configure() is valid only at Initialized state; currently during configure()
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Kotlin
- スター
- 3k
- フォーク
- 946
- 平均マージ
- 4日 6時間
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pedroSG94/RootEncoder のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
pedroSG94/RootEncoder#2213 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
pedroSG94/RootEncoder#2207 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pedroSG94/RootEncoder#2203 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pedroSG94/RootEncoder#2192 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pedroSG94/RootEncoder#2177 · コメント 44 件 ·
メンテナーはふだん 2 日以内に返信
pedroSG94/RootEncoder の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rustyrazorblade/easy-db-lab#1017 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
callstack/react-native-brownfield#492 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
fix: retain the best partial noise-correction solution対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
world-federation-of-advertisers/cross-media-measurement#4653 ·
メンテナーはふだん 1 日以内に返信