OSDN Git Service

Bug 5287555 create StreamSourceAppProxy once
authorGlenn Kasten <gkasten@google.com>
Fri, 9 Sep 2011 14:41:45 +0000 (07:41 -0700)
committerGlenn Kasten <gkasten@google.com>
Mon, 12 Sep 2011 22:54:48 +0000 (15:54 -0700)
commit5f542f6e29f76ccc34d3072c13638e84d7b88496
tree43b6a0bf6d60c34e33ed04c6dbcdfa461220bde7
parent4adad8df3942f28f1cd36bb22ad7b28b5f28e351
Bug 5287555 create StreamSourceAppProxy once

Create StreamSourceAppProxy once in the StreamPlayer constructor,
rather than dynamically in StreamPlayer::registerQueueCallback.
As StreamPlayer::registerQueueCallback can be called multiple times
(or even not at all), this guarantees we always have only one
StreamSourceAppProxy that never changes.

Also fix bug where we weren't using a stream protector for AudioPlayer
with MPEG-2 TS AndroidBufferQueue data source (we weren't calling
setCallbackProtector on it).

This has some unexpected side benefits of simplifying the code:
 - remove unused parameters and member variables
 - mAppProxyLock not needed since the callback protector is created early
 - remove GenericPlayer::setCallbackProtector
 - inline android_StreamPlayer_realize_l for the use case
   AUDIOPLAYER_FROM_TS_ANDROIDBUFFERQUEUE to be like MediaPlayer

Change-Id: I090c11cde9474285185481192dba2b5c01338a50
wilhelm/src/android/AudioPlayer_to_android.cpp
wilhelm/src/android/MediaPlayer_to_android.cpp
wilhelm/src/android/android_GenericPlayer.cpp
wilhelm/src/android/android_GenericPlayer.h
wilhelm/src/android/android_StreamPlayer.cpp
wilhelm/src/android/android_StreamPlayer.h