-
Glenn Kasten authored
Fix bug where StreamSourceAppProxy destructor wasn't reached, which caused all sorts of other problems later on. To see this, enable the logs StreamSourceAppProxy::~StreamSourceAppProxy and StreamPlayer::~StreamPlayer. You'll see that StreamPlayer was destroyed, but not StreamSourceAppProxy. As StreamSourceAppProxy is child of StreamPlayer, make the reference from StreamSourceAppProxy to StreamPlayer a weak reference in case StreamSourceAppProxy's lifetime exceeds StreamPlayer. It is not supposed to any more with this fix, but the wp<> provides extra safety. StreamPlayer preDestroy no longer bypasses the preDestroy in GenericMediaPlayer. Do a full disconnect in GenericMediaPlayer::preDestroy. Push decremented reference counts for strong pointer through binder to workaround binder's "optimization". Extra error-checking in setListener and setBuffers to verify that mediaserver is calling them correctly. Use mutex mLock consistently in StreamSourceAppProxy. Add an explicit StreamSourceAppProxy::disconnect to break a circular reference, and call it in StreamPlayer destructor. Make methods private: receivedCmd_l and receivedBuffer_l. Add explicit clear during preDestroy to give up references earlier. Warning: setDataSource(NULL) is not supported by NuPlayer yet, this depends on another change in frameworks/base, so it is commented out for now. Rename mPlayerPrepared to mPreparedPlayer to avoid confusion with the enum mPlayerPrepared. Change-Id: Ie5f554c206027d22204eb86edd15489c6281b512
a0fa47f7