History log of /system/media/opensles/libopensles/android_SfPlayer.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
72018e7db99736eb056c79623a9e04ce83cadf1b 22-Oct-2010 Glenn Kasten <gkasten@google.com> Bug 3101247 - move track ownership

Preliminary fix for torture test failure - move track ownership

Change-Id: I4c9de6a85cc0bd594f16bdb1a5de61f5f268cfdb
/system/media/opensles/libopensles/android_SfPlayer.cpp
9e6172548bb344c24962c8a57274281e4315feba 14-Oct-2010 Adam Momtaz <amomtaz@google.com> Bug# 3111274 - Dump raw audio to file for automated audio quality analysis

This change is compiled for userdebug builds only.
The change enables raw audio capture of transcoded music.
The capture is written to file and used for audio quality analysis against the source audio.
This capture feature is OFF by default even for userdebug builds and requires setting a system property to enable it.

Change-Id: I6d895a2fe3ef9741fea490fe2513404a50c4d4b7
/system/media/opensles/libopensles/android_SfPlayer.cpp
a41e4d61ece0c605b63858a5332db0a867381597 15-Oct-2010 Glenn Kasten <gkasten@google.com> Fix bug 3101835 - play state crash

If a prefetch fails due to invalid data source,
then the application sets play state to PLAYING, it used to crash.

Change-Id: Iaba98c596005715ca6c057de543fa0921225e74c
/system/media/opensles/libopensles/android_SfPlayer.cpp
ffbd220f34d275c6231cac8db8f3b50aa16be2b2 13-Oct-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 3094729 Support AAC+ in OpenSL ES

When playing an AAC+ stream, StageFright will report a change of
configuration in the stream between the prepare phase and the
start of the playback.

The fix consists in retrieving the new configuration in SfPlayer,
create a new AudioTrack with the new parameters, and notify
AudioPlayer that SfPlayer has a new AudioTrack to use. AudioPlayer
will then delete its current AudioTrack, and use the new one
from SfPlayer, after configuring it with the current AudioPlayer
settings.

Change-Id: I23e3ecb2c144b7c4eefae7a970581695545982d4
/system/media/opensles/libopensles/android_SfPlayer.cpp
98a1f3f49f963eb6608771993edc69b2b0d549fa 13-Oct-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 3090610 Report an error on AAC+

Notify an error occured during prefetching when StageFright
reports that a read error was encountered (other than EOS),
and stop playback.

Change-Id: I0c00ee76b148bd80a26679648322633d6e5533da
/system/media/opensles/libopensles/android_SfPlayer.cpp
521de5ed291f559f536fd429521b00c67e756725 12-Oct-2010 Jean-Michel Trivi <jmtrivi@google.com> Stop preparing the player if an audio track cannot be found.

The bug consisted in not exiting from prepare() if an audio track
couldn't be retrieved from the content to play. This is for
instance the case with unsupported file formats.

Change-Id: Ic48ef5c3bfbfc7d16b241eaacfd26fe1b34e1044
/system/media/opensles/libopensles/android_SfPlayer.cpp
67537364adc48cd6fa56e36d4201428b5d9dedaf 29-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix issues with SLPlaybackRateItf interface

Set rate was not applied when the AudioTrack is created after
prepare completed.
Modified playback rate functions in AudioPlayer to pass a
CAudioPlayer pointer, rather than a pointer to IPlaybackRate
so the rate update function can be queried from the CAudioPlayer.
Added test that exercises the SLPlaybackRateItf interface as
well as content looping.
Simplified evaluation of delay between decode and render to
use a fixed (small) delay that balances time to run the
event looper, and prevents clicks.

Change-Id: I598e9a96e93ef7a7c3603c8467f9d6b36dacd26d
/system/media/opensles/libopensles/android_SfPlayer.cpp
b8e52590d14863805bc1ba9d58efa95cbf8ae302 28-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 3004701 do not prefetch during Realize.

Removed unused Android object states in enum, not used in
play state machine.
Made SfPlayer responsible for the creation of its
AudioTrack once it knows the sample rate and number of
channels of the content to play once it's done
preparing.
Added notification from SfPlayer to signal when it's
done preparing. This informs of the audio characteristics
and kicks off the content prefetching.
In the AudioPlayer realize:
- do not start the prefetching, do it when the player
is set to PAUSED
- don not create the AudioTrack, do it when SfPlayer
is done preparing.

Change-Id: Ic345040e71cef0e5953ea47366930d1dfbc5e761
/system/media/opensles/libopensles/android_SfPlayer.cpp
6cb166eb8284fb9c9cf2d26daf7eb802168d710d 26-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Support content looping for URI and FD data sources.

Implement SetLoop() on AudioPlayer with URI and FD
data sources. Only looping over the whole duration
of the audio content is supported here.

Change-Id: Ic033f61063e57c3a9f8c51bad15852a42b21ab46
/system/media/opensles/libopensles/android_SfPlayer.cpp
90417a10fd988e37bc4e51b61c2fb8e70301345c 21-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Implement buffer cache fill level and status notification.

OpenSL ES requires the notification of buffering status
changes and caching fill level updates. Fill level
updates happen only when the level has changed by
a certain amount.

Change-Id: I8b5e82ac1dfff35d7a27eda0dd1f395311d554f3
/system/media/opensles/libopensles/android_SfPlayer.cpp
03716fc64636a68ba59881508e80550b948f0f40 20-Sep-2010 Glenn Kasten <gkasten@google.com> Update logging

Fix bug in ifdef __cplusplus for OpenSLES_Android.h.
Clean up, simplify, and change level of a few log messages.
Use SL_LOGx macros instead of LOGx in SfPlayer.cpp.
Add comments regarding unsupported runtime log level checks.
Line length 100.

Change-Id: I52441ed6fbe9550248fa1b6944fc8e199f1f2724
/system/media/opensles/libopensles/android_SfPlayer.cpp
90a8fd23a41ae9feb4f59005eb20f300a4339e33 12-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Hide media player looper from AudioPlayer.

The ALooper that takes care of the rendering loop in SfPlayer is
only used inside SfPlayer. This CL makes SfPlayer manage the
lifecycle of its rendering looper.

Change-Id: Ia4d5e02ce0a44bcf79021f428b490612a9fead9c
/system/media/opensles/libopensles/android_SfPlayer.cpp
6dbf61484bdd03448395214c2a19e10b3238ac7d 08-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix automated tests testPlayAbsPath and testPlayfilePath

Do not rewind when reaching the end of the stream.

Change-Id: I98fa7cebc2b2d8fa8d10d371cfb78f24fb1ab277
/system/media/opensles/libopensles/android_SfPlayer.cpp
990f7545b17358f184872b1762d77ca88232b5c5 07-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 2947094

"multiplay" is a test that creates an AudioPlayer for each file to
play. When a player reaches the paused state, SetPosition (ISeekItf)
is called with a value of 0 (beginning of file). The bug was that
on Android, the player would stop playing after playing the file
once or twice.
The bug was caused by the logic in ISeek.c which checks that the
new seek position is different than the previous one before issuing
a seek command to the player. The fix consists in not checking
the old requested seek position so the command is always issued.
It works on the desktop because the SndFile version was resetting
the mPos field to SL_TIME_UNKNOWN each time SetPosition was called.

While investigating this bug, it was also found that the player
should reset its decode position to 0 each time it reaches the end of
the stream.

Change-Id: I22f2d6480c62ab6e56c28c7ccae2c117888a7639
/system/media/opensles/libopensles/android_SfPlayer.cpp
7c058fbbcc7037a6f85698a361b2e9cbfe9d9b62 07-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix deadlock when stopping the player while destroying.

Do not acquire an exclusive lock on the player when querying play
callback and event mask, or updating the playstate.

Not related to fix:
Do not notify the end of the stream has been reached once the player
is stopped.

Change-Id: I9c7e1d96c28d1472ff18174c97544faa8deb0e88
/system/media/opensles/libopensles/android_SfPlayer.cpp
99e9db496f5c2cb07e0e83f061fcbd5487c999d7 04-Sep-2010 Jean-Michel Trivi <jmtrivi@google.com> Store decoded buffer in player instance.

Do not store decoded buffer reference in message sent from decoder
to renderer, but rather in player instance. This allows access
to buffer between decoding and playback so the media source can
be correctly stopped.

Change-Id: I7f583366d9895db039ca7d0d9e22f36d0d429f55
/system/media/opensles/libopensles/android_SfPlayer.cpp
dc098b54cd7df1b79b4560ae0570d88e4b9f751e 30-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> Add support for auxiliary effects.

- Implement the OutputMix object.

- Modify the interface of the Android effect initialization since
an effect can be attached to a player (insert) or to an OuputMix
(aux)
- fix bug in EQ where SL_RESULT_CONTROL_LOST was returned on a
properly initialized EQ effect.

- Add a test application which creates an EQ on an OutputMix
- Remove unused constant in test apps.

Change-Id: Id9e4633d0e44e8a784f1154ce1a6df1357b72966
/system/media/opensles/libopensles/android_SfPlayer.cpp
9c03f04a9c6cc2a821182c8be8f2efe964a27efe 13-Aug-2010 Glenn Kasten <gkasten@google.com> Make internal implicit interfaces safer.

Add IsInterfaceInitialized.
Don't directly manipulate a buffer queue.
Call the interface via it's named entry points, not the v-table as it may not be initialized/available.
GetInterface enables the v-table not init.
Update Doxygen comments.
Line length 100.
Allow bool, true, and false in C code.
Add a verbose option to seek torture test.

Change-Id: I37c42834422759b881d2ffe4b171d9aa284fde98
/system/media/opensles/libopensles/android_SfPlayer.cpp
b93a3faa0d84662717243b4c8b1271976e87a42c 13-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> Implement getPosition for an AudioPlayer reading from a URI or FD.

For getPosition, return the last decoded position as the current
position. This is not accurate but will do for a first pass. Since
this requires knowing whether it's seeking, a lock is introduced
to guard against reading the seek flag in getPositionMsec(), and
it being written in the player looper.

Change-Id: I2af6daa7f1415d8b6463d114a7b61c266fd98c97
/system/media/opensles/libopensles/android_SfPlayer.cpp
67894ba1f93e9102fc724b76204e0ef72e15b0e8 12-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> Implement seeking logic as a state updated in the message looper of
the player, so no locks are required.

Change-Id: I14f30ab1e3f3cde5d31c4a6d121d1951c1a11995
/system/media/opensles/libopensles/android_SfPlayer.cpp
19a022e914deb38ce80c61b6e92d53d05c34ef0e 11-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> Cleanup AudioPlayer destroy sequence. Fix seek bug where audio
wouldn't play, or played delayed after a seek.

Change-Id: Id132ddf27774465af3df272707151876bc22f70d
/system/media/opensles/libopensles/android_SfPlayer.cpp
dd1bf4e050672a232c9e34d3d2a580e5fbf66c89 10-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> Prevent consecutive decode operations by discarding
the next one if the decode buffer hasn't been released yet.

Change-Id: I4b9ebed899f6cead5b2ce0619dbb95ec0e1d3b64
/system/media/opensles/libopensles/android_SfPlayer.cpp
0570652da8dcbb61d25b2c856a0911dd1f893bf4 10-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> After stopping an AudioPlayer, playback should resume from the start.

Change-Id: Id524c1b9c74c89813c5699d25288509fa60d7aa5
/system/media/opensles/libopensles/android_SfPlayer.cpp
49f02bb3bb095a45c05e0f1a64ed13053287cc82 10-Aug-2010 Jean-Michel Trivi <jmtrivi@google.com> Do not initialize effect descriptors if the audio player couldn't
be initialized.

Test playback behavior after stop.

Change-Id: I67d78b73f5392948e00af99eaa9335f76256df14
/system/media/opensles/libopensles/android_SfPlayer.cpp
29745d2982365fb0a2a0d28b366aefc0ab79f965 04-Aug-2010 Glenn Kasten <gkasten@google.com> Update logging.

Change-Id: I41f47c400adc1fb13a6d8ba88715a09c52855de4
/system/media/opensles/libopensles/android_SfPlayer.cpp
cbf42b70edd2b71edf57eb12acfc7bd7db1dbe16 28-Jul-2010 Glenn Kasten <gkasten@google.com> Use LOG macros instead of fprintf for logging

Line length 100
Details on logging:
fprintf stderr -> SL_LOGE
fprintf stdout -> SL_LOGV
printf -> SL_LOGV
// fprintf stderr -> // SL_LOGE or LOGV depending
// fprintf stdout -> // SL_LOGV
// printf -> // SL_LOGV
newline is appended by the LOG macro

Change-Id: I5340249529784ec26cfdb2656fc30a2f4650cc11
/system/media/opensles/libopensles/android_SfPlayer.cpp
7cfdade2044c90b6487cf3987394319d72355710 09-Jul-2010 Glenn Kasten <gkasten@google.com> Fix printf format problem.

Change-Id: I8ced7479d29702455bf128337e24f1f4ef8aeb16
/system/media/opensles/libopensles/android_SfPlayer.cpp
00e03878051187063f3c167cd1d0bf02c4d68430 07-Jul-2010 Jean-Michel Trivi <jmtrivi@google.com> Implement seeking on a media player.

Change-Id: I0894e79be80ded39f051c670c30ac380a74f9888
/system/media/opensles/libopensles/android_SfPlayer.cpp
ba6f5a8583a5dabbd05a690b334844dffa179091 01-Jul-2010 Jean-Michel Trivi <jmtrivi@google.com> Let SfPlayer handle the play state with regards to decoding.
This fixes the bug where the player couldn't be resumed after being paused.
Add test of the OpenSL ES play states.

Change-Id: I3793941abf852aaca359346c656e4a8e29ed666c
/system/media/opensles/libopensles/android_SfPlayer.cpp
c5ac6a3baf25c4adde2186ad8235e889ebc11151 30-Jun-2010 Jean-Michel Trivi <jmtrivi@google.com> Declaration of a new DataLocator type for OpenSL ES on Android: file
descriptor.
Implementation of support for SL_DATALOCATOR_ANDROIDFD.
Test application to play a file from a file descriptor.
Fix bug in sles_to_android.cpp where resources were never freed
when destroying the player.

Change-Id: I45156f41ee5ca77d3a944f8f89b75880db8b4aba
/system/media/opensles/libopensles/android_SfPlayer.cpp
15f9f5e609265dff9d6036af38bea084c42a702a 24-Jun-2010 Glenn Kasten <gkasten@google.com> Gain and transport attributes at mutex unlock.

Update both interface and player copies of mute/solo.
Move synchronous gain and transport updates to mutex unlock exclusive.
Update sync thread logic.
Keep track of player position using tracks in PCM frame units.
Implement solo.
Various volume-related fixes.
Mute solo fields are only in IMuteSolo, but IMuteSolo is
immediately after IVolume to make it easier to find.
Move Android volume fields into audio player.
Fix printf missing newline.
Only one copy of mute and solo.
Clean up comments.
Line length 100.
SDL gain and transport updates are synchronous.
Fix unused variable warnings.
Use symbol for number of stereo channels.
Rearrange fields to save memory.
Add comments.
Fix problems introduced during the last merge.

Change-Id: I121fcbe4189b06850983941f540942a745fc51fb
/system/media/opensles/libopensles/android_SfPlayer.cpp
08c0c5b29dd6a834ff4f1a55dc1455621b412a0e 26-Jun-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix prefetching issue where decode shouldn't start before playback
starts.

Change-Id: I01b7b36b388b9bc37ea3c9d5e3f74a531f887128
/system/media/opensles/libopensles/android_SfPlayer.cpp
eee8ad3a39c439b48be3b5cecaa4b71272d5f77d 25-Jun-2010 Jean-Michel Trivi <jmtrivi@google.com> Implement stop for SfPlayer. Fixes crash at end of playMuteSolo test.

Change-Id: I4fb88cae71d8972b03c8d7ad3f108d6aff39ada5
/system/media/opensles/libopensles/android_SfPlayer.cpp
474bc3d17dc75cbaf3f553d16fe21ef35071ddad 23-Jun-2010 Jean-Michel Trivi <jmtrivi@google.com> Share the same AudioTrack instance regardless of the data source
of the AudioPlayer, buffer queue or URI. Refactor code that
handles AudioTrack events so it is shared among the two implementations
of AudioTrack event callbacks.

Change-Id: Ida49fada2515acaac06bdcb42cc833c97ee20dc8
/system/media/opensles/libopensles/android_SfPlayer.cpp
5d9e8432d0217fe139987703b8e1f129296171ff 16-Jun-2010 Jean-Michel Trivi <jmtrivi@google.com> Introduction of Stagefright to replace MediaPlayer.
Change-Id: I59c467ebafed6f5ceee37c2d8f6cd132b25c1459
/system/media/opensles/libopensles/android_SfPlayer.cpp