Conversation
In the intent in ShareRecordingsUtilImpl.kt the intent stream extra was not mentioned,thus file content was unable to be shared.
Included a lifecycle owner as we are creating threads they need to cleared off CoroutineLifecycleOwner.kt mimics the lifecycle of viewmodel coroutine scope thus ensures when the scope cancels the threads are also stopped Corrected name exceptions
The core is quite same as earlier, but MediaCodecPCMDataDecoder.kt not managing any handlerThreads here initCodec takes up a handler that can be still run on the main thread Thus codec is only responsible for decoding audio buffers Corrected names for MediaCodecState.kt The ThreadLifecycleHandler.kt manages creation of thread, for each instance only a single thread instance is managed Though still some worked required as its crashing sometime , we create the thread on start and on destroy we stop it Also when the MediaCodecPCMDataDecoder.kt work is done ie the end of stream is received we clean the native objects
The recorder timeline was malformatted the seconds field was giving incorrect values corrected that
The end of the stream was handled but end of stream cleanup was not called MediaCodec.Callback() onInputBufferAvailable can only queue the buffer not set the _codec state based on the codec buffer info the release state is set, Include locks for batch operations Still the crashing issue is same as the previous time
Removed Visualizer from PlayerControllerModule.kt In AudioVisualizerImpl.kt, the ThreadController.kt is provided via constructor injection, also included lock in releaseObjects MediaCodecPCMDataDecoder.kt handler need to be passed via constructor then later it need to be initiated ,If we are using custom handler then posting cleanup logic in the specified thread this again reduce the no of crashes ThreadController.kt the interface for threading logic, in its impl the core logic is same we prepare the thread an on lifecycle destroyed the handler thread quits and cancels In PlayerVisualizerViewmodel.kt removed the viewmodel onclear super call its not needed
The media extractor instance is now managed by MediaCodecPCMDataDecoder.kt thus no more native exception as media extractor was released synchronously Thus MediaCodecPCMDataDecoder.kt manages the whole pcm/ rms extraction process Thread wait time reduced to 600 millis
RecorderViewModel.kt no onClear super call required
As a new module is added module graph updated Build version no incremented Few of dependencies versions were updated
We are mistakenly calling prepare visuals twice so added a flag there to ensure it's not called twice The VisualizerState.kt rather than isReady boolean gives more info about the state of the visualizer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixes
Others