History log of /frameworks/wilhelm/src/android/android_GenericPlayer.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e21f91df7afb1175ddb5b0045ebb0d5338df2535 18-Dec-2012 Andy McFadden <fadden@android.com> Rename ISurfaceTexture and SurfaceTexture

The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: I54f19904e325518a3af8fe23c018d3c0bb6bd807
/frameworks/wilhelm/src/android/android_GenericPlayer.h
91145ef159d3e165a461cbd76341ff8ed3d72bae 04-May-2012 Jean-Michel Trivi <jmtrivi@google.com> Playback rate on OpenSL ES AudioPlayer playing from URI/FD

Allow AudioPlayer to use the platform's 500-2000 range (in
permille) of playback rate for audio when the data source
is a URI or FD.
Since play events for those players are simulated through
monitoring the playback position, scale the time
between updates so play events are delivered in content
time, not presentation time (as defined in OpenSL ES
specification, "positions do not scale with changes in
playback rate").

Bug 5898620

Change-Id: Ib512caebd7f3983c9e845be62e48dfee8499e59c
/frameworks/wilhelm/src/android/android_GenericPlayer.h
c4374bd42cd7eadda841a6b089234becb4f6c508 16-Sep-2011 Glenn Kasten <gkasten@google.com> Remove virtual from methods that don't need it

The virtual suggested to the reader that the methods are overridden,
when actually they aren't.

Change-Id: I8283c9c7aaa73cd9bafd2d643bb40854d718489b
/frameworks/wilhelm/src/android/android_GenericPlayer.h
3c59249869119ec0f1dd53b8b3045f785c514046 08-Nov-2011 Andreas Huber <andih@google.com> am e87e28c3: Merge "Remove MediaPlayer::setVideoSurface legacy." into ics-mr1

* commit 'e87e28c32f35ed40a12b18ef51cc6af0f44ec270':
Remove MediaPlayer::setVideoSurface legacy.
e2e8fa36bd7448b59fbcdf141e0b6d21e5401d91 29-Jul-2011 Glenn Kasten <gkasten@google.com> Comments

Change-Id: I1592d1979ce5f5811ff5a47b4b60db93e8670313
/frameworks/wilhelm/src/android/android_GenericPlayer.h
167a2af67dcc0d20e6e3e995a23a0567715e0ee1 07-Oct-2011 Glenn Kasten <gkasten@google.com> AudioPlayback_Parameters cleanup

Use AudioPlayback_Parameters more consistently in parameter list of
constructors. Also, StreamPlayer::StreamPlayer was over-assigning to
mPlaybackParams (already assigned by its superclass's constructor).

Move initialization of AudioPlayback_Parameters from each case
to before the switch, as it is shared by each use case.

Remove old asserts.

Change-Id: I8925d36da031c80308457c7e940418d3a4e47b62
/frameworks/wilhelm/src/android/android_GenericPlayer.h
241b9c06493479dc632a8851097c193b724a2b41 26-Oct-2011 Andreas Huber <andih@google.com> Remove MediaPlayer::setVideoSurface legacy.

Change-Id: I95aa181f39b375087b30ac65fea37589108c9f16
/frameworks/wilhelm/src/android/android_GenericPlayer.h
b6aed97f98afa0c20f5b1e854ac07ccacfcdacc6 28-Oct-2011 Glenn Kasten <gkasten@google.com> am d0b07222: Merge "Bug 5526807 inform client of errors after prepare" into ics-mr0

* commit 'd0b0722276aea9a06a118a64abfc8b3e9498e931':
Bug 5526807 inform client of errors after prepare
5e4d65e369f28746767aba11b618dee314bb8197 27-Oct-2011 Glenn Kasten <gkasten@google.com> Bug 5526807 inform client of errors after prepare

Change-Id: Ic5c88f8e1c8e7d6226a7a71a2a89a70f0fa876f8
/frameworks/wilhelm/src/android/android_GenericPlayer.h
1fa5c3206d06bbebdea2dc92f378ce6b8a211e23 30-Sep-2011 Glenn Kasten <gkasten@google.com> Fix race in getting duration

mDuration is protected by mSettingsLock because it is accessed from both
the ALooper thread and from the application thread, but only one of the
two "set"s was using the lock, and the "get" was not using the lock.

Also added some comments about the lock, and moved lock closer inside { }.

Change-Id: I7c96186f31baaad1b941d934549cb50d4f82d0c8
/frameworks/wilhelm/src/android/android_GenericPlayer.h
b4393ef4ef3edb785746c37fd7b68950e85283ae 30-Sep-2011 Glenn Kasten <gkasten@google.com> Multithread safety and code reduction

Remove unsafe GenericPlayer::getSampleRate(). getSampleRate() was not
thread-safe as it accessed a member variable updated in the looper thread
without a lock. If getSampleRate() is ever needed again, the sample rate
is available in the mPcmFormatValues array, which does have a lock.

Replace member variables mChannelMask, mChannelCount, and mSampleRateHz
by local variables for locality and performance.

Change-Id: Ibf92ed090430153d748ded4d0b835e429df47eea
/frameworks/wilhelm/src/android/android_GenericPlayer.h
a9f22e6f5f53e90daa779e38b22f88e4faa35c95 29-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5385386 missing HEADATNEWPOS

Workaround for mediaserver bug where it does not send MEDIA_SEEK_COMPLETE
to the MediaPlayerNotifier after a discontinuity is processed.

Instead, we simulate a seek complete event in this case.
A short delay is applied to compensate for shared memory latency.

A longer-term fix will be to have mediaserver send the event.

Change-Id: Id0d01b842a145fa5762d44f03144741152f7b03f
/frameworks/wilhelm/src/android/android_GenericPlayer.h
3ac5dcc05fe321e4f01918aef2e3e54e22c9a5c1 17-Sep-2011 Glenn Kasten <gkasten@google.com> Remove dead code

AudioPlayback_Parameters fields trackcb and trackcbUser
audioTrack_callBack_uri
android_Player_androidBufferQueue_registerCallback_l
GenericPlayer field mLooperPriority
StreamPlayer::registerQueueCallback
CAudioPlayer::mpLock
AudioSfDecoder::startPrefetch_async
IAndroidBufferQueue does not support AudioRecorder object
android/BufferQueueSource.h #include

Change-Id: I9d7cef243167e10279df452e7c62e66d8f5fe3b6
/frameworks/wilhelm/src/android/android_GenericPlayer.h
f4b45a37248899ae2d27bb172f8387fbf1edff8e 12-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5090073 Callback protectors

Add callback protector for decode to PCM usage cases.
Move callback protection up earlier for URI decode use case only.

Other:
Remove redundant mCallbackProtector field.
Optimization: on exit from callback protector, only broadcast if !mSafeToEnterCb,
that is if destroy has requested callback protectors to finish up.
More callback protector logging.
Add callback protector requestCbExit() [no wait], not yet used.

Unrelated:
3rd parameter of adecoder_writeToBufferQueue is always CAudioPlayer * instead of void *.

Change-Id: I57a46acf0e5ecb213540b13ca08098177ad7ad6e
/frameworks/wilhelm/src/android/android_GenericPlayer.h
7349b2e742b2cedc6d149fac62ed661ad7d47dec 15-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5263052 play events for decoder use case

This version should be more resilient to decode time vs. real time.

Miscellaneous:
- comment about GetPosition accuracy
- remove unused AudioSfDecoder::onRender implementation

Change-Id: I16a7726e0b1459ed1421fe50cb4d683d5c3bdd6b
/frameworks/wilhelm/src/android/android_GenericPlayer.h
7133228a478e16458b659946f2180ecddd13fda7 09-Sep-2011 Glenn Kasten <gkasten@google.com> 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
/frameworks/wilhelm/src/android/android_GenericPlayer.h
485a038f9f0f898227b8ab4218e94c5d56b6ed0b 24-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5193695 Fix crash after MediaPlayer destroyed

The StreamSource callback thread was continuing to run after the
MediaPlayer object was destroyed. Fixed by adding a callback protector
and a pre-destroy hook. GenericMediaPlayer::preDestroy now also
calls MediaPlayer::stop just in case.

Change-Id: I5bd771d4d1936f433d2a8c9959593782c96daed9
Miscellaneous:
- added an explicit destructor on CMediaPlayer::mAVPlayer for consistency
(probably not a bug since there was a clear on it earlier)
- updated comments for CallbackProtector
- made some CallbackProtector fields private since no sub-classes yet
/frameworks/wilhelm/src/android/android_GenericPlayer.h
833251ab9e5e59a6ea5ac325122cf3abdf7cd944 11-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5153313 keep compatibility of local files URI

Also fix a bug in decode from fd to PCM buffer queue, where
we were closing the application's fd.

Change-Id: I220cd1c242f2f5e240b4dd1b9e8d79c88878bdcd
/frameworks/wilhelm/src/android/android_GenericPlayer.h
b238f3ed65f3fa2a3adad602a438fbc98b13cba3 19-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5126938 dependency for video sinks"
85edd878a30caa535b0267d8d6e61b4ccc0d5fd0 13-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5161265 Recover from mediaserver process crash

Use the utility method IMediaDeathNotifier::getMediaPlayerService()
to get a reference to media player service. It retries after errors,
and keeps a single global per-process reference to the service rather
than one per object. If we still can't contact the media player service
after retries, handle it like an unsuccessful prepare.

Miscellaneous:
- Remove unused field Parcel metadatafilter

Change-Id: I451a64bd76b4a7f157774abe967448ec081f1014
/frameworks/wilhelm/src/android/android_GenericPlayer.h
35ac702ee1ad91e5c8748c12450222d50b366a52 08-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5126938 dependency for video sinks

Fixing bug 5126938 will involve configuring the video sink in two places:
at the initial data locator when creating the MediaPlayer object, and
then later in the IAndroidConfiguration interface. This CL is preparation
for that.

Details:
- Abstract out common code into android_Player_setNativeWindow.
- Move the code for checking and initializing the video sink from an
#ifdef ANDROID in the CMediaPlayer_Realize portable code to into
platform-specific android_Player_realize.
- Only set one of mSurface or mSurfaceTexture to non-NULL.
- For methods which can't fail, replace the SLresult return value by void.

Change-Id: Iec8fd91e1a6de45eb64241b35e3f7d7faf63d727
/frameworks/wilhelm/src/android/android_GenericPlayer.h
1b65b2054448050ded9e1475df7b755421a1e2da 05-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5903270 play interface, events, markers, etc."
5933f3d5e532aaac31ce0e6551c59f0197c0ae3c 29-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5903270 play interface, events, markers, etc.

As the media framework does not directly support marker and periodic
callbacks, we use a retriggerable one-shot timer at application level
to emulate this. This has the advantage of being faster, but is also
less accurate than if it were in the framework.

Details:
- Get position is now synchronous and (mostly) lock-free
- Fix regression in SL_PLAYEVENT_HEADATMARKER and SL_PLAYEVENTHEADATNEWPOS
- Fix SMP races in GetPlayState, GetCallbackEventsMask, GetMarkerPosition,
GetPositionUpdatePeriod
- AudioSfDecoder was not updating mPositionMsec when getPositionUsec failed
- Updating attributes is relatively expensive, so only do it when a significant change
in SetMarkerPosition, ClearMarkerPosition, SetPositionUpdatePeriod
- Error on unknown message type in onMessageReceived
- Delete an obsolete FIXME
- "Clearing" a marker is now equivalent to disabling the marker event,
and the default marker position is cleared.
- use Android time units and types (int32_t, ANDROID_UNKNOWN_TIME, etc.) where appropriate
instead of SLmillisecond and SL_TIME_UNKNOWN

Change-Id: Ib78bafa20d883b8d927364769663837389b6ea1d
/frameworks/wilhelm/src/android/android_GenericPlayer.h
f6445d330c05ccc57d1adcc6ee05735a33f78881 03-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5110581 SL_PLAYEVENT_HEADATEND while looping

Change-Id: Ia4d0433b4a6589bfda2f88addbe5b7eb3d0d9789
/frameworks/wilhelm/src/android/android_GenericPlayer.h
f152bc273bc3f8471bca626fe9cc966dad304173 02-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5080320 MediaPlayer volume"
99b927751677abfb60a388d65dfeed1fed1db12c 28-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5080320 MediaPlayer volume

Details:
- re-factor volume-related code yet again
- remove dead variables mAmplFromVolLevel, mAmplFromStereoPos, mDirectLevel
- add placeholders for kEventPrefetchFillLevelUpdate and kEventPrefetchStatusChange

Known issues:
- MPEG-2 TS doesn't yet implement the ability to query channel count, so default to stereo

Change-Id: Ic0f2297b267dc3d380755e8d314e1d5f0f659d7c
/frameworks/wilhelm/src/android/android_GenericPlayer.h
9f07ea788f57654acf29d1321b40162e41eb122b 26-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5081346 fix whole file looping

Change-Id: If4e233f9007d7e48225a342a43f06df7f66cdea7
/frameworks/wilhelm/src/android/android_GenericPlayer.h
fa2bd93c3a9852a1f879663eeff598d13cf8fa81 25-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 4599730 fix mute solo, channel count, volume

Change-Id: I1624c744168233c4ef79f2cd3090447b8aa7d53b
/frameworks/wilhelm/src/android/android_GenericPlayer.h
3610785fa93586ce84a27a27530feb77b8035229 22-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5045590 preset reverb on audio players

Aux effects on MediaPlayer audio players (non-AudioTrack) were broken

Change-Id: I5b97bee08d809b12cb9815d6d277934123780581
/frameworks/wilhelm/src/android/android_GenericPlayer.h
49935c51fddcd0caa0030e2aac0c3a7ba3339e3d 21-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5047695 Handle unsuccessful prepare up to app

Change-Id: I9f1541b37ad5cda21dc49388e42c7fb08b22fc5b
/frameworks/wilhelm/src/android/android_GenericPlayer.h
4b0e0b2860ffd5e246b42c8a434833cca2f068b3 08-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Implement GetPosition for players playing from a URI/FD

AudioPlayer (OpenSL ES) and MediaPlayer (OpenMAX AL) that play
media from a URI or FD are implemented on top of an Android
MediaPlayer. This CL implements requesting the current position
from the underlying MediaPlayer object inside the event loop.
At this stage, GetPosition cannot be called from inside a
callback as the callback is made on the same thread that will
process the asynchronous part of the GetPosition implementation.
Add test app for GetPosition.

Change-Id: Ife768bc40e37fc60cc19f6ba84bbe6cb06cc6590
/frameworks/wilhelm/src/android/android_GenericPlayer.h
1a9c2615d0933d183fcb1b9e34ec8f0da2a85153 07-Jul-2011 Glenn Kasten <gkasten@google.com> Rename ANDROID_UNKNOWN_* to UNKNOWN_*

Change-Id: I0d92b7d943690d9af7e08c400471f8b474728bff
/frameworks/wilhelm/src/android/android_GenericPlayer.h
e6ded5c61944a87fa9e472dec3a6929855d42aeb 28-Jun-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix issues in GenericPlayer destruction

Added a preDestroy() mechanism for the subclasses of
GenericPlayer.
Added a lock around the update and use of the callback
GenericPlayer is using for notifications to the
OpenSL ES framework. This prevents notifications after
the GenericPlayer is flagged for destruction.
Added a lock to protect the update of the audio source
running state, so it doesn't get used after the
AudioSfDecoder is flagged for destruction.
Before stopping the audio source of an AudioSfDecoder
object, release the code buffer if necessary, to
ensure proper teardown of the audio source (OMXCodec)

Change-Id: I6cf08d169a6da622552dda5101dbc61e663ce6aa
/frameworks/wilhelm/src/android/android_GenericPlayer.h
7f5cc1afe49395fefaad9b2bbd728a45d1bfda6a 16-Jun-2011 Jean-Michel Trivi <jmtrivi@google.com> OpenSL ES: additional features when decoding to PCM

Support the following features useful when decoding a compressed
asset to PCM:
- GetDuration in SLPlayItf
- implemented SLMetadataExtractionItf on an AudioPlayer whose
data sink is a buffer queue (i.e. it's a decoder)
- added support for 6 new metadata keys that can be queried
through SLMetadataExtractionItf, which match the fields
of the SLDataFormat_PCM structure.
Updated the decode sample code to use these features: the
slesTestDecodeToBuffQueue app now displays:
- the number of channels
- the channel mask
- the sample size
- the container size
- the sample rate
- the format endianness

Change-Id: I3ca1e29828fd8c16c89da43a28df429c9cdef7af
/frameworks/wilhelm/src/android/android_GenericPlayer.h
4ee246c55533bdab8ab5fa0f0581744fe58e7c91 29-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Move support for SL URI and FD playback under GenericPlayer class

The SfPlayer class was implementing URI and FD decode and playback
in the application process. This CL removes this class entirely
and moves its functionality under the GenericPlayer class. This
means that the playback of URIs and FDs is now implemented through
an android::MediaPlayer object running in the media service.

The SfPlayer header had many StageFright and system includes, which
are now moved to the relevant files where they are required,
instead of automagically coming from sles_allinclusive.h.

Note that this CL breaks support for the following OpenSL ES features
due to missing Android MediaPlayer features:
SLPlayItf.GetPosition
HEADATMARKER
HEADATNEWPOSITION
SLVolumeItf.EnableStereoPosition
SetStereoPosition
SLMuteSoloItf
SLPlaybackRateItf

Support for those features will be reintegrated in subsequent CLs.

Change-Id: I8d7f6ea006eb7b876ef1ca1909d74b4517335850
/frameworks/wilhelm/src/android/android_GenericPlayer.h
37dc2fccf3f122b79ebd554de209d0a3c94ae161 09-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 Implement streamInformation and volume in OpenMAX AL

- Implement StreamInformation for video size notification.
- Implement the XAVolumeItf for volume control
- Fix bug in GUID -> MPH hash.
- Fixed typo in GenericPlayer::pause() log
- Do not signal a discontinuity automatically when the ABQ is
cleared because clearing the queue doesn't imply there will
be a discontinuity in the data (e.g. the same data that was
cleared could be reenqueued)
- In "native-media" test app: add test code to exercise the
XAVolumeItf functionality.

Change-Id: I9f69f8cacbdce51b6d96d60141ec1d0f645df991
/frameworks/wilhelm/src/android/android_GenericPlayer.h
70c49ae2867094072a4365423417ea452bf82231 07-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 support commands in SLAndroidBufferQueueItf

Support for EOS, DISCONTINUITY, and DISCONTINUITY with
a PTS.

- in IAndroidBufferQueue structure, added buffer type
- modified AdvancedBufferHeader structure to have a buffer
type-specific structure that contains all the items for each
buffer
- added parsing of items when enqueueing a buffer
- enforce buffer size enqueue to be a multiple of MPEG-2 TS
block size for buffer of the corresponding types
- when enqueueing a buffer on an empty queue, implemented
an asynchronous notification on StreamPlayer to consume
the newly queued buffer. Verified this kicks off playback
after having starved the framework for buffers.
- report unknown duration when using AndroidBufferQueue

Change-Id: I9bde97a6c6ffca7d376b4963313b820b35f50a26
/frameworks/wilhelm/src/android/android_GenericPlayer.h
13837cf3f7be0eb8b1a9552bd99a89f98c987720 01-Feb-2011 Jean-Michel Trivi <jmtrivi@google.com> OpenSL ES: support decode to PCM buffer queue

Created a new audio player class, APlayer, from which we derive
subclasses to encapsulate OpenSL ES AudioPlayer implementations:
- ASfPlayer derives from APlayer and encapsulates StageFright
functionality for audio decoding to a buffer
- ADecoder derives from ASfPlayer and encapsulates rendering
the decoded audio data to a callback function. It interfaces
with the OpenSL ES Buffer Queue interface to pass the decoded
data back to an OpenSL ES application.

For OpenSL ES, to support decoding to a Buffer Queue, we now
allow an AudioPlayer to have its sink be a PCM buffer queue.

Change-Id: I9aefeb0375a71f7ca770c5c62b4fb8faf59c9c23
/frameworks/wilhelm/src/android/android_GenericPlayer.h