SoundPool: Refactor class
Make class names fit the Java API and documentation. Rename Channel -> Stream. Rename Sample -> Sound. Rename SoundPoolThread -> SoundDecoder. Move track start and stop to worker thread. Fix up types to ensure future compatibility with Java ints which are 32 bits always. Upgrade 16 bit types to 32 bits (e.g. sample id, sample rate, etc.) Move sound related code into the SoundManager class. Move stream related code into the StreamManager class. Clean up locking, split SoundPool lock into the following locks 1) mApiLock 2) mStreamManagerLock 3) mSoundManagerLock 4) per Stream mLock. 5) mCallbackLock Group locked data and make private in associated classes to ensure restricted access, yet maximum concurrency. Fix race conditions waiting for next event to play in stream. Ensure track commands are handled consistently when stream is stolen. Test: SoundPoolOggTest Bug: 140807581 Change-Id: I8fcb374ee6329eb5474b973624584ca5080da862
Loading
Please register or sign in to comment