• Home
  • History
  • Annotate
  • only in /frameworks/wilhelm/src/android/
History log of /frameworks/wilhelm/src/android/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2ab5ad96f9ddbf44378546d132dd98a9265a349f 13-May-2016 Glenn Kasten <gkasten@google.com> Don't specify sub-buffer count for non-fast tracks

Bug: 28695447
Change-Id: I81bfd3a02c9600e3f1d9abc68bb2d70d45112260
udioPlayer_to_android.cpp
f930011635e970346ca31d0509a173a695023f27 18-Apr-2016 Glenn Kasten <gkasten@google.com> Allow OpenSL ES to specify a total buffer size for a fast track

by using the OpenSL ES buffer count to indicate the number of
notifications (sub-buffers) per track buffer.

Bug: 27819623
Change-Id: Idd782e971eb415298ea5b47a6f5d39b1bdd5c7fc
udioPlayer_to_android.cpp
b30330217356d0e10abe5220662424231dc57880 17-Mar-2016 Glenn Kasten <gkasten@google.com> Merge "Use audio_session_t consistently" into nyc-dev
15f1e492e8fe7e2b6665009b5facd2b42913ab0f 10-Mar-2016 Paul McLean <pmclean@google.com> Native routing phase 4

Allow Acquire before Realize

Bug: 23899814

Change-Id: I27682ecb5259fc6ebbe3eca5c6aba5d956aa42bb
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
213c31153b9bda7b5a091f2996da7b655c8ed451 08-Mar-2016 Glenn Kasten <gkasten@google.com> Use audio_session_t consistently

Bug: 27562099
Change-Id: Ie04efb44923fdd2f034b771157fa30dababdfb58
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_Effect.cpp
ndroid_Effect.h
ndroid_defs.h
96c2d9fb5afbaca71e04afa1f5fb933aa28f06f7 01-Mar-2016 Glenn Kasten <gkasten@google.com> Merge "Single definition of USE_DEBUG in Configuration.h" into nyc-dev
10d8b6a5f9a7c24203e3ee228ec596d03c1aa78d 01-Mar-2016 Glenn Kasten <gkasten@google.com> Single definition of USE_DEBUG in Configuration.h

Bug: 27423077
Change-Id: I75cf9e7d6dd6134fe5b818951fd23353e16c7656
allbackProtector.h
84017464b6c273771743cdcc274135908c7e8a79 27-Feb-2016 Glenn Kasten <gkasten@google.com> Add use for audio_unique_id_t

Bug: 25641253
Bug: 21019153
Change-Id: I795a013cad2cf1ba85eb7079bf4d994612ce18b8
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
62496886cb4620c09bc5df0de70a883319616c25 22-Feb-2016 Aurimas Liutikas <aurimas@google.com> Enable -Werror and fix warnings in frameworks/wilhelm.

Bug: 27147881
Change-Id: I5e767007d85a160864a606926ee81adb94eae899
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.h
b61bb82c208b2ef75f070199ca82269c4445663e 19-Feb-2016 Aurimas Liutikas <aurimas@google.com> Fix the last warnings in frameworks/wilhelm.

Bug: 27147881
Change-Id: I2723a0bc58d27be30f0f3749699485c8aad50c73
ufferQueueSource.cpp
ndroid_defs.h
28340d1d9199b789f0db015680b008c98084f0b7 12-Feb-2016 ilewis <inl@google.com> Emulating old channel mask behavior for both input and output

This adds the "ignore positional channel masks" behavior back
into output as well as input.

Bug: 27042146
Change-Id: I51fc4a4494cd9477fdcddb6901cd353b88ea2c2e
(cherry picked from commit f4f89da331441ec4693c8ebb6ae3cf5460a22328)
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
d67d2393c62827a91f84b1eed83a789387cff032 09-Feb-2016 Lajos Molnar <lajos@google.com> remove OMXCodec.h dependency

Bug: 17108024
Change-Id: If09b4d935123323e910655172d8c249ad8638a8b
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
81e94ea55bd79a4a6eab987685f0b3c146a40d2f 12-Feb-2016 Lajos Molnar <lajos@google.com> unblock infinite loop when enumerating video codecs

Bug: 27115713
Change-Id: I5ff243ef633bd1419d58df3f964536f60002955f
ideoCodec_to_android.cpp
33f46b8cd9ece650736a4aa5294318c6b51b2ffd 10-Feb-2016 ilewis <inl@google.com> Restore behavior of channel masks on input

In the past we ignored positional masks on input
and used the defaults based on channel count
instead. Changing this behavior to validate positional
input masks breaks apps that had relied on earlier
behavior, without adding much benefit. Restore
the original behavior on input.

Output channel masks have always been defined, so
no change to that behavior.

Bug: 27042146
Change-Id: I91544c719f450f2790b839981243451bc767933f
(cherry picked from commit deb4ccb9556d25dc0ad20a84efadf9a2bf62b20a)
udioRecorder_to_android.cpp
hannels.c
040cca5f36511d632c355b5008ebb09d28fd6402 05-Feb-2016 Lajos Molnar <lajos@google.com> remove OMXCodec.cpp dependency

Switched to SimpleDecodingSource from OMXSource, as we don't do
pause/seek.

Switched to tracking only the capability of the first video codec
for each type, as we only use the first one.

Bug: 17108024
Change-Id: I6bf8e90b6658366b68329494d5805f5a122c8b8a
(cherry picked from commit 8d0a0b3db25cefc27e9b61955cd94f46b391502e)
acBqToPcmCbRenderer.cpp
ideoCodec_to_android.cpp
ndroid_AudioSfDecoder.cpp
d45124f1e81a929a593889e72ea4c8e8056b327d 03-Feb-2016 ilewis <inl@google.com> Missing parentheses around #define.

Change-Id: I4f945c9b5a882b2a787c233e1996fe29e52f9b9d
hannels.h
4e8fe8a60c3aa8085918f15f281e0979682aefdc 13-Nov-2015 Paul McLean <pmclean@google.com> Fixed validation and translation for indexed channel masks

The channel mask validation code had a number of built-in
assumptions around positional masks. Most of these assumptions
are invalid for indexed masks.

The translation between OpenSLES channel masks and Android
channel masks also needed reworking; this CL attempts to
do it the right way by calling helper functions rather than
setting bits directly.

Bug: 23899736
Change-Id: I65b024b71e3267d2e9ca316ac74771e16462e134
acBqToPcmCbRenderer.cpp
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ndroid_AudioSfDecoder.cpp
hannels.c
hannels.h
b0817ae4b8c7e9a8a717bd40d132b4d938cb307d 28-Jan-2016 Marco Nelissen <marcone@google.com> Revert "Get codec from codec process"

This reverts commit db1d696afda13079daeeb584f086eaa49cb82825.

Change-Id: I3dcae785842bcdbed87f846fef744c756a133df4
ideoCodec_to_android.cpp
db1d696afda13079daeeb584f086eaa49cb82825 17-Dec-2015 Marco Nelissen <marcone@google.com> Get codec from codec process

Bug: 22775369
Change-Id: I8f59f004b73d00a4aa2bdd80a35022f763ddf51a
ideoCodec_to_android.cpp
9e5446b1be7627b06a653eaf92786b5e7722b651 08-Jan-2016 Ricardo Garcia <rago@google.com> Merge "Adding UNPROCESSED to the available audio_sources"
680943a4c349712f641b7577e5b0a3fdf49e39d9 16-Dec-2015 Glenn Kasten <gkasten@google.com> Use FCC_2 and FCC_8 to highlight channel count assumptions

Bug: 21656069
Change-Id: I82db40a77e6af507af4b02e732b99f61d02e51b8
hannels.c
hannels.h
e9b57cefb954e7c1bffc5d4b59f89aca5e050797 02-Dec-2015 rago <rago@google.com> Adding UNPROCESSED to the available audio_sources

bug: 25564291
Change-Id: Ie231263a517b7a0305c9e2e86d0608ae007afe3c
udioRecorder_to_android.cpp
aae88e79e307072d05047186fc0d8b1a77c8a188 02-Nov-2015 Gaurav Shah <gauravsh@google.com> Merge "Build libOpenSLES for Brillo." am: 3bfb87aa6d
am: c4dbb71c2f

* commit 'c4dbb71c2f3476d1455424d41aa7e01bfb2270d9':
Build libOpenSLES for Brillo.
c4dbb71c2f3476d1455424d41aa7e01bfb2270d9 02-Nov-2015 Gaurav Shah <gauravsh@google.com> Merge "Build libOpenSLES for Brillo."
am: 3bfb87aa6d

* commit '3bfb87aa6d0400ec0fbec0aacac644509220cd24':
Build libOpenSLES for Brillo.
001c3b5d8e62f459c6253bef164a874e63374ca2 20-Oct-2015 Ralph Nathan <ralphnathan@google.com> Build libOpenSLES for Brillo.

Currently, building libOpenSLES on Brillo requires a bunch of repos that
are not part of it. The dependency on libstagefright_http_support adds
these extra repos.

Break these dependencies by not calling
CreateHTTPServiceInCurrentJavaContext in Brillo. This does not change
the behavior in Brillo as CreateHTTPServiceInCurrentJavaContext returns
NULL if there is no Java VM.

BUG: 24578244
TEST=slesTest_sawtoothBufferQueue works on the dragonboard

Change-Id: I46479e3d223aedc7286eee2329baa507a812c386
ndroid_LocAVPlayer.cpp
2cf0a2ee3672659f922bf0df4368b5a49148c5ff 23-Sep-2015 Marco Nelissen <marcone@google.com> Extractors are now binderized

Change-Id: I492439d7ec4b007009ea43e5c52b111cf1346154
acBqToPcmCbRenderer.cpp
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
nclude/AacAdtsExtractor.h
til/AacAdtsExtractor.cpp
b4e379dd5a7dc764260ace7b73a782077ff10232 20-Aug-2015 Glenn Kasten <gkasten@google.com> Force RAW to reduce latency on platforms that support it

Bug: 10546170
Change-Id: Ida0d060b6b777ff5c920224f051e8ea557ff6c18
udioPlayer_to_android.cpp
84bbadf848f606ff28273baf26fc246cf967059a 30-Jul-2015 Andy Hung <hunga@google.com> Update OpenSL ES for odd channel counts

Bug: 22629234
Change-Id: I3effb86dc7418997e8b24bf8a11c757878c99693
hannels.c
a6585530d8cf92658042c001b6a27fc397c62b9f 16-Jun-2015 Glenn Kasten <gkasten@google.com> Reduce build warnings

Change-Id: I27e41dc5c6cecc4933271a12862bdc297b245ee3
acBqToPcmCbRenderer.cpp
ndroid_GenericPlayer.h
til/AacAdtsExtractor.cpp
4e384ca65e5fd3eabac0621bed98f937d8a263c5 10-Jun-2015 Glenn Kasten <gkasten@google.com> Merge "Check sample size in addition to container size" into mnc-dev
26f9a1c4c14b0f7da8b0d60ffcecbf5e221d15c5 09-Jun-2015 Eric Laurent <elaurent@google.com> Merge "Use only strong references to AudioEffect" into mnc-dev
3a0f65a96a56f18954088bcb43a7b0a57efe2bc0 09-Jun-2015 Glenn Kasten <gkasten@google.com> Merge "Take advantage of audio_channel_in_mask_from_count" into mnc-dev
aa08cb01d58f1da2d0a2b208aed3bf1730f8f63d 05-Jun-2015 Eric Laurent <elaurent@google.com> Use only strong references to AudioEffect

Do not use raw pointers to native AudioEffect objects.

Bug: 21629892.

Change-Id: Ib6af552503584c5f0532ff6dee2829da6e10ac88
udioPlayer_to_android.cpp
ndroid_Effect.cpp
71065fbf12abafd4c2a0dc85c81f13b564ff69fb 04-Jun-2015 Glenn Kasten <gkasten@google.com> Check sample size in addition to container size

Also add comments and fix line length

Change-Id: Iaac8ade2b53c3cc6951dc94413bbe996e1d5e925
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ndroid_sles_conversions.h
ba0b2c989ecbbae4678903954a4629ef342e1089 09-Jun-2015 Glenn Kasten <gkasten@google.com> Add FCC_8 comments to indicate 8-channel assumptions

Bug: 21656069
Change-Id: I411a5c83eec126bc6cda796bd4c9f842ed6ee762
hannels.c
6805ee0037e981af43e990d309280950d13addad 09-Jun-2015 Glenn Kasten <gkasten@google.com> Take advantage of audio_channel_in_mask_from_count

to support more than 2 input channels

Bug: 21375533
Change-Id: I1ccd5d1d68a25f415dc4a62bf7a44d9db12a256b
udioRecorder_to_android.cpp
a80a6ff9a1f80792478c9d43578afa24a07eb2f0 04-Jun-2015 Glenn Kasten <gkasten@google.com> Only allow native byte ordering

Change-Id: Iebe0a9df03b988d84253aa74f6ef8392b337967c
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
df9b397f73d8f063ff66e0fbf86ced075fe6d5aa 04-Jun-2015 Glenn Kasten <gkasten@google.com> Remove redundant checks

Change-Id: I9f0f0063c3d8ba845c937aad97811d296ceaa494
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ff25010cb77455a46357d6dd012631a2599d7bf4 04-Jun-2015 Glenn Kasten <gkasten@google.com> Start rewriting code that handles channel counts and masks

Change-Id: I700d719ee59c595b020979ecae56eb64bf657cca
acBqToPcmCbRenderer.cpp
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_sles_conversions.h
hannels.c
hannels.h
09aeff183fa1353298c47fcb18ff33b0d08a990d 04-Jun-2015 Glenn Kasten <gkasten@google.com> Simplify code in android_audioPlayer_checkSourceSink()

Change-Id: I12bd19ca899dbcc8b3ef7c9a10cf871ad3ac49c5
udioPlayer_to_android.cpp
bf3152158263633892ed730237388ce850cf4f1d 04-Jun-2015 Glenn Kasten <gkasten@google.com> Remove dead code in android_sles_conversions.h

Change-Id: Ibc45f2857d66fcab6902085fc79d55e9ee1ddb36
ndroid_sles_conversions.h
274c079467f6ade516771b4c721c67041243cf4b 29-May-2015 Glenn Kasten <gkasten@google.com> Rewrite audio recorder to match player

Change-Id: I8b6b7d473939ad46db45c36115086b063627d013
udioRecorder_to_android.cpp
904b880cdd214729d04b2cbd374287c3bb6c6606 30-May-2015 Glenn Kasten <gkasten@google.com> Merge "Rename checkSourceSinkSupport to checkSourceSink" into mnc-dev
abd09a98140420b6c861d30e30494cd769e745b7 30-May-2015 Glenn Kasten <gkasten@google.com> Merge "Whitespace" into mnc-dev
5d748826b90e8e3cdb740a220433fa60c6c9f31c 30-May-2015 Glenn Kasten <gkasten@google.com> Merge "Explicitly list all event types in switch for callback" into mnc-dev
88a4a5da5eb158fe00f17af581f7529884c0b474 30-May-2015 Glenn Kasten <gkasten@google.com> Merge "Allow playback of sample rates up to 192 kHz" into mnc-dev
9f3ac83aa036a780ca901f9ff75e47a5a7cbba1f 29-May-2015 Glenn Kasten <gkasten@google.com> Explicitly list all event types in switch for callback

Change-Id: I039ce75df2e6c483d09e7efd2d19303fc165c0d5
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ac28eca1df49f581d952ffbda5d3019f7e3b7be6 29-May-2015 Glenn Kasten <gkasten@google.com> Whitespace

Change-Id: Ie9fa59703d90fa0a6d4b83d6d5bd637f53d4058c
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_Effect.cpp
43f23007e7b6e42fc765e3e7b178492b1a3fc392 29-May-2015 Glenn Kasten <gkasten@google.com> Remove MONITOR_RECORDING

This logging can now be done by AudioFlinger in debug builds.

Change-Id: I178470cfa7a0eb6312087d7f59623963dc610735
udioRecorder_to_android.cpp
00a66a027199238a93b2aa9056af126efc09fe38 28-May-2015 Glenn Kasten <gkasten@google.com> Rename checkSourceSinkSupport to checkSourceSink

to match similar code in AudioPlayer

Change-Id: Ib5d4a23dae6e572e26241dc4c747aa0c72e6af8f
udioRecorder_to_android.cpp
udioRecorder_to_android.h
b8fe327b1505778e82db76de930dd3f62ec99158 28-May-2015 Glenn Kasten <gkasten@google.com> Remove redundant parentheses

Change-Id: Ia7de3564a8065f33aa74655b01357f4138b32aa8
udioPlayer_to_android.cpp
c98c4fac33384a31bf47b59fd2a40920778b0e9d 28-Feb-2012 Glenn Kasten <gkasten@google.com> Remove dead code

Change-Id: I7515a5d3deed85e2835742a362fbc1a2df8f880f
ndroid_sles_conversions.h
04e38178473bb0ffdb4759956db60dd86aa7e732 22-Jul-2011 Glenn Kasten <gkasten@google.com> Add static for methods only used locally

Change-Id: I5e7d5c93869b31f75efc9fd3f040df82b67d9efd
udioPlayer_to_android.cpp
ndroid_Effect.cpp
e05f49175a60182d29d0e38ee2a214854c279d95 28-May-2015 Glenn Kasten <gkasten@google.com> Add const

Change-Id: Ide3011e14c8a4c5c0d29db77e7c99789c37c30a7
udioPlayer_to_android.cpp
45c7c53181a1b10223fa8708432c31c4be4496a3 28-May-2015 Glenn Kasten <gkasten@google.com> Allow playback of sample rates up to 192 kHz

The check for non-common sample rates is still present in data.c

Bug: 21501319
Change-Id: Iffb3c962004d2a0fe1ec1b2cc9ee0ebf943f142b
udioPlayer_to_android.cpp
64c3fe7bd86951eeac27adca2219ce16eabff58c 28-May-2015 Glenn Kasten <gkasten@google.com> Whitespace

Change-Id: I666963a80530aceec9f47e625018844daf29c017
udioPlayer_to_android.cpp
ndroid_sles_conversions.h
d2a31043966c76e4739bb325edcd5a475861a951 28-May-2015 Glenn Kasten <gkasten@google.com> Line length 100

Change-Id: I91c6231d22361361cda80d96c9d3ded5c93b6103
ndroid_StreamPlayer.cpp
baa2db446c404a4443a8e455a412753fc92ed036 28-May-2015 Glenn Kasten <gkasten@google.com> Explicitly compare raw pointers to NULL

Change-Id: I6e867fea4067e0e0497d91c0750bbdcbe44d7f7a
udioPlayer_to_android.cpp
03d4a5ae486538839d02ae8a18e2a5c38bf1e2fb 28-May-2015 Glenn Kasten <gkasten@google.com> Remove redundant semicolon

Change-Id: Ida3b82c09164e3bbf99d36b3cbd8607a9eefb45c
udioPlayer_to_android.cpp
2dc0674aba6242c677365b675795773738397ab9 13-May-2015 Glenn Kasten <gkasten@google.com> Clear mAudioRecord on set() failure

All uses to mAudioRecord were already protected by checks for mAudioRecord != 0

Bug: 20818955
Bug: 20890069
Change-Id: I243205b99b198eb1b5a1a027b27cbb7d5aaaa8db
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
2523b697aa1fda376c2ccd72680394d359acbd3f 28-Apr-2015 Svet Ganov <svetoslavganov@google.com> Respect the record audio app op - wilhelm

Change-Id: I9fca6f47e91f8b755fed8317878e9e98d1730476
udioRecorder_to_android.cpp
ndroid_Effect.cpp
68aeecb932ea18bf472da7eb72c3770ca2596999 14-Apr-2015 Chris Watkins <watk@google.com> Add a static cast to resolve overload ambiguity.

The IMediaPlayer interface was updated with a new overload for
setDataSource which caused a compiler error in StreamPlayer. Add
a static cast to resolve the ambiguity.

Change-Id: I26a3dc4bee1680cb260e93a151483baf398a4399
ndroid_StreamPlayer.cpp
52e35b2c9f25450452ab422c46737a7fb5b67380 04-Mar-2015 Lajos Molnar <lajos@google.com> stagefright: make AMessage use handler vs handler-id

Bug: 19607784
Change-Id: I55accc49eec725ede0da3d1bfab448320fece926
ndroid_AudioSfDecoder.cpp
ndroid_AudioToCbRenderer.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_StreamPlayer.cpp
fe44276c433864352d96a9bc2e9abf676b725a34 18-Nov-2014 Raph Levien <raph@google.com> am 0f6da1a2: Reduce audio output latency

* commit '0f6da1a299c8dd924d19714ee69d343915c32d2c':
Reduce audio output latency
0f6da1a299c8dd924d19714ee69d343915c32d2c 14-Nov-2014 Raph Levien <raph@google.com> Reduce audio output latency

This patch reduces latency in the OpenSL ES player path by calling the
callback immediately before data is consumed, rather than after.

Bug: 12246268
Change-Id: I8273b4a03f16011beec21dd52545f8ad1a25fd95
udioPlayer_to_android.cpp
769b5d55d6733e02dc9ea36c3922ba3880838c9c 10-Nov-2014 Glenn Kasten <gkasten@android.com> Merge "Check that the ABQ mime type matches the expectations"
460bdad43aaec3c6ffe7f259719e00807742ad6d 24-Apr-2014 Glenn Kasten <gkasten@google.com> Audio recorder missing a callback protector

Bug: 14291968
Change-Id: I620d5e82f58e57e87097984a649b5c3a25c42963
udioRecorder_to_android.cpp
udioRecorder_to_android.h
d0081ece36dcb6ecdadeb9fc0ee912cffb7effc7 28-Jul-2014 Eric Laurent <elaurent@google.com> rename AudioSystem::newAudioSessionId()

Rename AudioSystem::newAudioSessionId() to
AudioSystem::newAudioUniqueId() as it can be used
also for I/O handles.

Bug: 12378680.

Change-Id: I5f0eaaadc21ff2aacf81670490ad42c54537d86b
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
d03d766459462a0f86a800ac4cc0cecb05e97beb 02-Jul-2014 Eric Laurent <elaurent@google.com> audio: fixed channel count determination from channel mask

Do not use popcount() to derive channel count from channel mask.

Bug: 15000850.
Change-Id: I7af794e4515cd0f85e5b9744bd4e53e33aa0d5eb
udioPlayer_to_android.cpp
e57c13397185f9ad0f162855e9a8ebeb0c94bfc4 24-May-2014 Andy Hung <hunga@google.com> Add float playback capability to OpenSL ES

Add SLAndroidDataFormat_PCM_EX to match OpenSLES 1.1 header file,
together with related SL_ANDROID_PCM_REPRESENTATION_* constants.
Use slesTest_playbq as the test application.

Change-Id: I04bcd170f5c517051a799bacf8f52da5f1353ad6
udioPlayer_to_android.cpp
ndroid_sles_conversions.h
36c0711b6919c2185a4d6e514d7f421b0d9c7bc6 27-May-2014 Martin Storsjo <martin@martin.st> Check that the ABQ mime type matches the expectations

The code in audioPlayer_getAndroidObjectTypeForSourceSink assumes
that an android buffer queue source combined with an output mix
sink is an mpegts source, while it it assumes that it is an adts
source if it is combined with a simple buffer queue sink. This
assumption never was verified before, making the set up actually
seem to succeed even though the data is interpreted as the wrong
format.

Change-Id: I7e031ec8139fa2d770737935eb9acd3506d3fa3f
udioPlayer_to_android.cpp
c323fec2a2639c0cf7463016d592d0eb0539657c 24-May-2014 Andy Hung <hunga@google.com> Add 24 bit and 32 bit playback capability to OpenSL ES

slesTest_playbq is the test application.

Change-Id: Iaa453471d2e9ff4e6b11ac5c68690993179fea2b
udioPlayer_to_android.cpp
ndroid_sles_conversions.h
76de029ec49b535ca8aa3aef777d0dfb1838889e 24-May-2014 Andy Hung <hunga@google.com> Add mono to android_audioPlayer_validateChannelMask

Change-Id: I898401a1a0b6081dc0d4e9d41be09cb38c675951
udioPlayer_to_android.cpp
759687c36cbeaaa40408960eafa3ffd14e76cbc6 17-May-2014 Ji-Hwan Lee <jihwan@google.com> Fix build on x86_64 targets

Change-Id: Ib60d8552468901af476db61eb7bf666e1ffd81fd
ndroid_Effect.cpp
43bde29538bf33d444d41a0b9cc0d60793fb20fa 17-May-2014 Paul McLean <pmclean@google.com> Merge "Initial Implementation of new NDK effect interfaces"
f8b3141926967ba37d315cc8d3956d7214958e6b 15-May-2014 Paul McLean <pmclean@google.com> Initial Implementation of new NDK effect interfaces

Support for Acousic Echo Cancellation, Automatic Gain
Control and NoiseSuppression effects on AudioRecorder

Change-Id: I85dcb988f59dacaaed540737018b8f629efeaad3
ndroid_Effect.cpp
bb74f23cd3dc877c7eaf4db2132f724d11aeeb8f 15-May-2014 Paul McLean <pmclean@google.com> Initial Implementation of new NDK audio formats

Support for 24-bit audio formats - Support for Quad, 5.1 and 7.1
multi-channel output

Change-Id: I4e4f5d2915a43970ae01f552ba506591902aa070
udioPlayer_to_android.cpp
ndroid_sles_conversions.h
a6babec83b52b08e9d2807afe2be05607fd7a133 14-Feb-2014 Narayan Kamath <narayan@google.com> am 298eac15: Merge "AArch64: Minor changes related to 64-bit platform"

* commit '298eac1548462c05e9c417abb0e401d805700e82':
AArch64: Minor changes related to 64-bit platform
01f8573bc2a850536b02855d483dfe130c050a2f 12-Mar-2013 Ashok Bhat <ashok.bhat@arm.com> AArch64: Minor changes related to 64-bit platform

Changes include
[x] Use %zu for size_t
[x] Use PRId64 to print 64-bit integer value
[x] Use uintptr_t for integer variable used to store address.

Change-Id: I69926cce76b0d645f1abccd584444197a5e40318
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
acBqToPcmCbRenderer.cpp
ndroid_GenericPlayer.cpp
til/AacAdtsExtractor.cpp
fb8035480852914d326eb4c2074060df32382926 30-Jan-2014 Andreas Huber <andih@google.com> FINAL ATTEMPT: HTTP services are now provided from JAVA and made available to media code

Change-Id: Ia7681255410340707b3c84665dbcab98d7507dbf
ndroid_AudioSfDecoder.cpp
ndroid_LocAVPlayer.cpp
f0c3b4edf597c40aae4ea311575f39c8bcf203df 06-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Always request fast track for recording"
3eaa329775fc522d8ea4acd4edc379eabf9ac332 12-Nov-2012 Glenn Kasten <gkasten@google.com> Fix build warnings

narrowing conversion of '-1' from 'int' to 'SLuint32 {aka unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]
converting to non-pointer type 'pthread_t {aka long int}' from NULL [-Wconversion-null]
warning: 'currentRate' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: I066260cc216ff9f15c787f65e3d3efbda8f8ef35
allbackProtector.cpp
5e3bcbffacc309fb2d9e002b7bc1ed131fddc6fc 02-Aug-2013 Glenn Kasten <gkasten@google.com> Always request fast track for recording

Change-Id: I76fc395e3b1babe41522023a56a37e4310b248e3
udioRecorder_to_android.cpp
03a012a855b7edcda0b799031d70765769057be5 08-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Remove requirement for application side double-buffering"
c0e8dc0d40329960136cb8729cb6d19cb393a319 24-Jun-2013 hkuang <hkuang@google.com> Change VP8 mime type name and add VP9 mime type.

Change-Id: I3fafe2482cc51ca2d57976ba6112fea50d8e68ea
ideoCodec_to_android.cpp
e5ede1a139fcedbf075675179d919fbe731898f0 13-Jun-2013 Glenn Kasten <gkasten@google.com> AudioRecord must be used as sp<> only

Bug: 9423855
Change-Id: Icc37559082f6c6c7052ac03a835a3d2c6732af59
udioRecorder_to_android.cpp
92e53bc98cd938e9917fb02d3e5a9be88423791d 16-Mar-2013 Glenn Kasten <gkasten@google.com> Remove requirement for application side double-buffering

At one time it was thought that application side double-buffering was
required for fast tracks to work reliably. It now appears that this
was overly conservative, and that fast tracks work just fine with
single buffers on application side. This is because the moment after
FastMixer pulls the data from the fast track, it synchronously signals
the application's callback thread to wake up, which will then run the
buffer completion callback handler to re-fill the buffer. So disabling
this check now.

Bug: 9276275
Change-Id: I2c74a8c6d752140ccc7d285c5c5c1f7fcd792650
udioPlayer_to_android.cpp
55cb1cdff4e65e9064df49bc8636fe522370b01b 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: Ibc86143858a3c4fe31fb43af0b22087348b8c204
ediaPlayer_to_android.cpp
1cde2eac95a1d76731bdf162db7ec42b584f0bc5 21-Dec-2012 Glenn Kasten <gkasten@google.com> Merge "Remove unnecessary parameter"
3376429dfe306b9bfebf3a50941e2ccf44984495 18-Dec-2012 Glenn Kasten <gkasten@google.com> Remove unnecessary parameter

Just get the parameter on server side

Change-Id: Ief316b125a4c496f995520697c2b53a1c4ebc3bc
ndroid_LocAVPlayer.cpp
ndroid_StreamPlayer.cpp
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
ediaPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.h
b42e943393b119b42b8fdca29be067800c35c78e 13-Nov-2012 Glenn Kasten <gkasten@google.com> Remove dead code android_getMinFrameCount

Change-Id: I1d4779a822e024bb8ae77eff153183bfb6a07b12
udioPlayer_to_android.cpp
b3adfe68492251ab6345b4fda500737822fb9c81 02-Nov-2012 Jean-Michel Trivi <jmtrivi@google.com> am 4a4c7289: Fix race condition when streaming MP2TS to media server

* commit '4a4c728965b10df683d37b4b7ac27211e02006ad':
Fix race condition when streaming MP2TS to media server
4a4c728965b10df683d37b4b7ac27211e02006ad 02-Nov-2012 Jean-Michel Trivi <jmtrivi@google.com> Fix race condition when streaming MP2TS to media server

Data transfer between user space and the media server of MP2TS
packets is done through a queue of buffers. This queue tells
the OpenMAX AL player whenever a buffer is available to be filled
so it can be transferred.
When the player is destroyed, this queue is cleared; this is
indicated by the boolean mBuffersHasBeenSet whose role is to
store whether the queue is properly configured.
There is a race condition where the queue could be cleared right
as the availability of a buffer is signaled.
The fix is to only try to use the available buffer when
mBuffersHasBeenSet is true.

Bug 6971102

Change-Id: Ibbe8f58fc954b84bf560f29944d1018dab261895
ndroid_StreamPlayer.cpp
85b1ba5dfb402b1acbfa516776d946769ccb8ffd 01-Nov-2012 Glenn Kasten <gkasten@google.com> Line length 100

Change-Id: I9a1a2e24e3b66e08ec33d0d8cf5ab2e14b559d4a
ndroid_sles_conversions.h
72721a95943c68ea0d75eb5c1ff2ab7380e4dc6f 14-Mar-2012 Glenn Kasten <gkasten@google.com> Use audio_channel_mask_t consistently

Change-Id: I77a624e2656046075eb38cf880c26cdf8ba36af8
ndroid_sles_conversions.h
3400c346f272492b52c7395c14d4a0f27603f87f 22-Jun-2012 Glenn Kasten <gkasten@google.com> Remove AudioRecord record_flags

Change-Id: I978579be3609c88d6fb6580a8cb3a594c76912a3
udioRecorder_to_android.cpp
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
udioPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
8daa09a2af477dbe495839ccf806919a02aa53cd 18-Apr-2012 Eric Laurent <elaurent@google.com> rename audio policy flags

Change-Id: I652fc4cfe6cc9a273234256e20f0b706182e2e27
udioPlayer_to_android.cpp
78e61e01307d62bd04283ada99ce5df1c647810d 04-Apr-2012 Glenn Kasten <gkasten@google.com> Updates to Wilhelm's use of fast tracks

Move volume and mute/solo interfaces from blacklist to whitelist.
Remove hard-coded frame count; this is now done at a lower level.

Change-Id: Ie9b48941df799dd8cba45dc7015d62e5adb76f5d
udioPlayer_to_android.cpp
7880f29c5ae58e0dd5ac67753049acc8888cb5f5 27-Mar-2012 Glenn Kasten <gkasten@google.com> Fast tracks

Change-Id: I7ab4d843be5bfe759cea8330ab0ede46e236adaf
udioPlayer_to_android.cpp
077405a448705636da29403ff6f24fd63623daac 19-Mar-2012 Glenn Kasten <gkasten@google.com> Merge "audio_channel_in/out_mask_from_count"
ee3ad477a71ba690f0b5721056a6514bf2f76bd8 16-Mar-2012 Glenn Kasten <gkasten@google.com> Merge "Fix indentation and redundant whitespace"
5cb9343d2739da755186f8dcdf1da307671e7353 14-Mar-2012 Glenn Kasten <gkasten@google.com> audio_channel_in/out_mask_from_count

Change-Id: Id62e9dee55367495c1cff04ea0b9ff7f07742e58
ndroid_sles_conversions.h
4a8b57c4e20db8f757a6fa53c05c7b2942d7aa07 10-Mar-2012 Glenn Kasten <gkasten@google.com> Merge "Use audio_policy_output_flags_t consistently"
aadb8f72e49046c8aac8d60d5411f8ca30bd167a 07-Mar-2012 Glenn Kasten <gkasten@google.com> Use AudioRecord::record_flags consistently

Change-Id: Ibb185b1c461df2c17061a8a0d62cba0611a89e1e
udioRecorder_to_android.cpp
1f41f98a87ee3d0070a794d8e8905e7d9d03d755 07-Mar-2012 Glenn Kasten <gkasten@google.com> Use audio_policy_output_flags_t consistently

Change-Id: Ie487ac0776e9bc6f12907945ec9bea0730200ad1
udioPlayer_to_android.cpp
01e4a8ff63523bba5c8f919a72e0adb66daf4b98 26-Feb-2012 Mathias Agopian <mathias@google.com> cleanup includes

Change-Id: Ia98b76b2e0c49ee257e1f31c61c2d6f72a9fe894
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
5f12770df2875b280acaf6a0de08ae0b57c930cf 08-Feb-2012 James Dong <jdong@google.com> Move away from MediaDebug and use ADebug instead

Change-Id: Ic448bdd6462708779f0e5c78a25e0a359b129654
ufferQueueSource.cpp
nclude/AacAdtsExtractor.h
adf8bd5d4360542b6b6c48c4471fdd8d855e05cc 24-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_source_t consistently

Use audio_source_t instead of int.

Change-Id: I88256ee508b8f5b50635985361efa7c458f11296
udioRecorder_to_android.cpp
24c770c9d328ac5516b488e00c77d6c76d13bcfc 17-Jan-2012 Glenn Kasten <gkasten@google.com> Merge "Use audio_stream_type_t consistently"
49f944656984a3047e66b2eb625e343841631789 12-Jan-2012 Glenn Kasten <gkasten@google.com> Merge "Use audio_format_t consistently"
eb0545cb9f6a5df8624fb3e3c3e75aea7a5dab8f 09-Jan-2012 Glenn Kasten <gkasten@google.com> Merge "Fix bug in use of getPositionUsec()"
46d1c53d608344d8f31e12b2f72f24b2908b650c 09-Jan-2012 Glenn Kasten <gkasten@google.com> Merge "Remove virtual from methods that don't need it"
b47c7beddecd38ae565d84b72da526843bfdd43e 08-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I584e6f6a3c52308b7a5a5c9980ca429c831f4320
ideoCodec_to_android.cpp
ndroid_GenericMediaPlayer.h
a93915739311e228a59d93ecd93a5665299953ab 06-Jan-2012 Glenn Kasten <gkasten@google.com> Fix bug in use of getPositionUsec()

getPositionUsec() returns int64_t, not uint32_t, so it would truncate
after 71 minutes. Also the check ANDROID_UNKNOWN_TIME always failed.

Change-Id: I3152d7715dfe4b67a5fad6985c6717c7a802b464
ndroid_AudioSfDecoder.cpp
0bfed90f3b312f7c8f2b744efcf62f1992661d6c 06-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_stream_type_t consistently

Change-Id: I6c02c9b285a00cefefc5d90d655d92ca8690765a
udioPlayer_to_android.cpp
ndroid_defs.h
a6c69c7e1665b38da8d6784e65210acbe501b92c 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I270cbf7b920d5f2fbb5f345f3c88426697c4391d
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
18a0d51a7d8fc7387f40e0c0ca16a93062fb4c6f 04-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_format_t consistently

Change-Id: I81bfafb1fcb374a100b156d9c52771a4b2eb2943
ndroid_sles_conversions.h
4bcfac513e073db89f72e2345be365f95895ca28 20-Dec-2011 Glenn Kasten <gkasten@google.com> Merge "Cleanup CreateAudioPlayer and CreateMediaPlayer"
017d5e6abe9135e67d32c55801d94eb1d5ecba61 20-Dec-2011 Glenn Kasten <gkasten@google.com> Merge "Consistent formatting for if ("
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
ndroid_GenericPlayer.h
22ced1dc023dc000118e3a26517b14e9babd7c5a 12-Aug-2011 Glenn Kasten <gkasten@google.com> Fix indentation and redundant whitespace

Change-Id: I8e0193ad5aa9405f64203bf7814d8a9e434c5dde
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ideoCodec_to_android.cpp
72042d4448cee63528c619537321ba73944c6382 16-Nov-2011 Glenn Kasten <gkasten@google.com> Cleanup CreateAudioPlayer and CreateMediaPlayer

Fix minor bug in MediaPlayer, it was missing an assignment if invalid locator:
mp->mAndroidObjType = INVALID_TYPE;

Cleanup:
- add placeholders for android::AudioSystem::acquireAudioSessionId and
releaseAudioSessionId
- remove duplicate initialization of some fields.
- android_audioPlayer_create can never fail, so make it return void
- add comments
- remove unused method audioPlayer_setInvalid
- simplify android_audioPlayer_create

Change-Id: I237b796f6b828cf53bf2c628e52a05a4bdf86c06
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ediaPlayer_to_android.cpp
70e776a54bc945a6a01717a784e66476bc5d450f 16-Sep-2011 Glenn Kasten <gkasten@google.com> Remove redundant this->

Change-Id: I86eabf51bf79c145d3ceff68f5aa527199d14ef7
ndroid_GenericPlayer.cpp
ca426f63e9c900ecbd28f8e3037aaf47ef739dd4 03-Oct-2011 Glenn Kasten <gkasten@google.com> Consistent formatting for if (

Change-Id: I4213dbe94c7dbc95565a20d12d66eb16707d0caa
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ndroid_AudioSfDecoder.cpp
e62501a9aa791a22f8f35491e74a36a14c8ddd29 30-Nov-2011 Glenn Kasten <gkasten@google.com> am 30f49ce0: Merge "Bug 5622637 missing XA_PLAYEVENT_HEADATPOS" into ics-mr1

* commit '30f49ce0c8f9ee464e87552a6fb4fb3d6b09959c':
Bug 5622637 missing XA_PLAYEVENT_HEADATPOS
02a171afdb1a5198b22f38ed1b306bb8cc6e7043 30-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> resolved conflicts for merge of 2917f475 to master

Change-Id: I63f4689fabb2aee1682d785ad9c41f06de380396
0b8669e6f9d46842bdbe13536283ae468738d211 30-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5622637 missing XA_PLAYEVENT_HEADATPOS" into ics-mr1
4d919aa2a89c65869058a98efcaf9066eab8c125 30-Nov-2011 Andreas Huber <andih@google.com> am 7898a5c5: Reflect (internal) API changes made to the IStreamSource interface.

* commit '7898a5c5f283c9487da48ef92f623c149d8a7a72':
Reflect (internal) API changes made to the IStreamSource interface.
af9b87de97356722370d11d2c5797d75cb43969e 29-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 5553055 support video only format change in MP2TS

Allow command data when enqueueing a format change command.
Support format change where the application signals that the
change is for the video stream only. Consider any other change
or format change command with invalid data as a full format
change.

Change-Id: I6c684eab36a51dded7e3d7e72b8effe13dac6cc8
ndroid_StreamPlayer.cpp
ndroid_defs.h
9dc142db9439e53a3831d7c9e607affe87138db5 29-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Bug fixes and cleanup for video codec profiles"
df200f6a98da83bf2c1b14aff0ed356263dfb8b7 11-Nov-2011 Glenn Kasten <gkasten@google.com> Bug fixes and cleanup for video codec profiles

Bug fixes:
- removed the line VideoDecoderNbProfLevel[c] = 0;"
it could overwrite the MPEG2 entry if only one codec implementation,
or worse if there were multiple codec implementations
- android_videoCodec_getProfileLevelCombinationNb was returning success
and zero count if a decoder has zero profile/level combinations,
but OpenMAX AL 1.0.1 spec says it must fail in that case.

Minor cleanup:
- omx does not need to be global
- We only use the first codec implementation for a given
decoder ID / MIME type, so simplify the code that iterates through
the array of codec implementations
- Add some const
- Add some comments

Also includes #if 0 code to restrict reported video codec profiles,
as a placeholder -- disabled for now.

Change-Id: I81991f164efaf3606beb5789e1a79cf76ad033a0
ideoCodec_to_android.cpp
665ca3f1b0fc90cd5980a435d164354b2529c0b5 29-Nov-2011 Andreas Huber <andih@google.com> Reflect (internal) API changes made to the IStreamSource interface.

Change-Id: I5cde6bc0d4bd9c62b4851d7e6375cd9216c7c062
related-to-bug: 5553055
ndroid_StreamPlayer.cpp
1f20e5c4db4c920bbe7b9e6cd6390ed8df64be9a 29-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Remove AudioTrackProxy since AudioTrack is RefBase"
eccbfb7d9e4065d5a5a5c1995c69e0eb6b526f5f 29-Nov-2011 Glenn Kasten <gkasten@google.com> Bug 5622637 missing XA_PLAYEVENT_HEADATPOS

Fix problem with a missing XA_PLAYEVENT_HEADATPOS after seek backwards,
due to a race condition between getPosition and onSeekComplete.

Change-Id: I408c8675df8a9b3cbd2874435fbeccdca355bc46
ndroid_GenericPlayer.cpp
ae1a5c8dc1fccf7c121eda830f8d23bd094c0f16 15-Nov-2011 Glenn Kasten <gkasten@google.com> Remove AudioTrackProxy since AudioTrack is RefBase

Change-Id: I4a1f755178699e0fdedf58e1f3cbd82e6067e071
udioPlayer_to_android.cpp
udioTrackProxy.h
682f9be91e641e80739c21d6ff124379a806182a 16-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5238515 AndroidBufferQueue miscellaneous

AndroidBufferQueue:
- errors found by setItems are now hard errors, and cause Enqueue to
return an error result (e.g. PARAMETER_INVALID or PRECONDITIONS_VIOLATED)
- disallow EOS with non-zero data
- disallow Enqueue after EOS
- Enqueue checks MPEG-2 sync byte of first packet to reduce chance of downstream failures
- use MPEG-2 terminology "packet" instead of "block"
- Clear and init don't need to erase buffer content, as it is inaccessible
- put placeholder in IAndroidBufferQueue_SetCallbackEventsMask
for additional events beyond SL_ANDROIDBUFFERQUEUEEVENT_PROCESSED
- comment unused field mBufferState in AdvancedBufferHeader
- fix a minor typo
- add dump method, #if 0 out by default

Change-Id: I11921e3784bfdb30e2cebaa1dabb705ea5ab0b92
ndroid_defs.h
e8433e52441e8328281ff149c9fbacd41a5078ed 15-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Simplify code for the AAC decode use case"
70e6a0238597223221a8bf5e506c92acf28aa35f 29-Sep-2011 Glenn Kasten <gkasten@google.com> Simplify code for the AAC decode use case

Details:

AacBqToPcmCbRenderer constructor
now takes an additional parameter: the IAndroidBufferQueue * interface.

So now there is no need to register a callback after construction,
and AacBqToPcmCbRenderer::registerSourceQueueCallback
can be deleted.

This allows android_audioPlayer_androidBufferQueue_registerCallback_l
to be deleted.

AacBqToPcmCbRenderer::mBqSource is always non-NULL and const, so this
allows removal of mBqSourceLock and some error-checking code.

BufferQueueSource source constructor now takes the IAndroidBufferQueue *
interface instead of the list [user, context, caller].

This allows mAndroidBufferQueueSource to be const, which then allows
more code to be deleted in IAndroidBufferQueue_RegisterCallback.

new AacAdtsExtractor can't fail.

Change-Id: I1f39ccc1e69833fe6df616feb76edbe4ce82fca7
acBqToPcmCbRenderer.cpp
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ufferQueueSource.cpp
ufferQueueSource.h
nclude/AacBqToPcmCbRenderer.h
1cbcb3d2c9cb208060ad18b16277c8d0e36832f5 15-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "More logging of media events for debugging"
86d4c6adc589ad73ff38e480151e65e755a7071a 14-Nov-2011 Glenn Kasten <gkasten@google.com> am e75ba3ef: Merge "Bug 5201321 recover from mediaserver crash" into ics-mr1

* commit 'e75ba3eff247622fdf36974d2216dcaff269ea5c':
Bug 5201321 recover from mediaserver crash
aeaf3abab0929cb82222e139cba0a663eb6db8f5 11-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "MediaPlayer kEventPrepared similar to AudioPlayer"
513222822545c3e954176476b263df52a47f43a4 10-Nov-2011 Glenn Kasten <gkasten@google.com> Bug 5201321 recover from mediaserver crash

Add a media player death notifier to recover from media server crashes.
Downgrade some logs.
Destructors should be protected.

Change-Id: I7774733bcb12fc7fbfe237bdbeffca1adde46e78
udioPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_StreamPlayer.cpp
7f250a17c145382b866d5d4d7ef23d65fada6236 30-Sep-2011 Glenn Kasten <gkasten@google.com> MediaPlayer kEventPrepared similar to AudioPlayer

Now that AudioPlayer kEventPrepared logic for successful/unsuccessful
prepare completion has been combined, make MediaPlayer work the same
way. This will make it easier to merge similar code AudioPlayer and
MediaPlayer in an upcoming CL.

Change-Id: Iaa58dcc85b0ede82036c0a5f45d61d0e7853fe0b
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
01d2f560058ab5a5f4cad83aa697d4b05d405522 10-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> am 5696c8a7: Merge "Bug 5585323 Authorize audio decode for system" into ics-mr1

* commit '5696c8a7a0e2fde4b051230544a58db853d3551f':
Bug 5585323 Authorize audio decode for system
a5c0cf350f2559bb96e1ff0b180927b0a420d331 10-Nov-2011 Glenn Kasten <gkasten@google.com> am b9217405: Merge "Bug 5578928 Fix race in stop for destroy" into ics-mr1

* commit 'b921740510e15a4e403e2819f1a8f0a9a6c03da9':
Bug 5578928 Fix race in stop for destroy
22dc81e75a7d50a7fbe07d429a7e8b7ab2a04bd1 09-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Bug 5585323 Authorize audio decode for system" into ics-mr1
f17145ab7ec3eda0c21aafd3b77e9bef97ee3d7c 09-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5578928 Fix race in stop for destroy" into ics-mr1
0c7d40a5f11f6930e6c4b2551a14f41dd721f936 08-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 5585323 Authorize audio decode for system

Authorize the use of specific audio codecs for audio decoding
by the system, which guarantees audio is decoded for playback,
when the appropriate system permission is used.

Change-Id: I0633b04b4d0aebe89804ef48752bf05d72abc56d
ndroid_AudioSfDecoder.cpp
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.
b3990dc973bd3efa83ef56f210560503739108eb 08-Nov-2011 Andreas Huber <andih@google.com> Merge "Remove MediaPlayer::setVideoSurface legacy." into ics-mr1
8ab6c02fa1384397d24eb8c15029577b17ab7c71 07-Nov-2011 Glenn Kasten <gkasten@google.com> Bug 5578928 Fix race in stop for destroy

Change-Id: Ic5c84406bffa372a2fd3e92ad1aca1f6f5185026
ndroid_StreamPlayer.cpp
90ccf2e90fa295dd189abbf8e4f05efafbe74547 07-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Comments"
e2e8fa36bd7448b59fbcdf141e0b6d21e5401d91 29-Jul-2011 Glenn Kasten <gkasten@google.com> Comments

Change-Id: I1592d1979ce5f5811ff5a47b4b60db93e8670313
acBqToPcmCbRenderer.cpp
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_Effect.cpp
ndroid_Effect.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
7df272342694ddc96957ce0c33abb19ee1f5fd9d 07-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "DataSource::getSize() returns ERROR_UNSUPPORTED"
1b775138b2b353710c66de7592a30f274c9026f6 02-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> am 762f1065: am c157a9c2: Bug 5544082 Filter out unsupported codecs in OpenSL ES

* commit '762f10659c2ac6fb66afd09be5bddd7ffebbf9df':
Bug 5544082 Filter out unsupported codecs in OpenSL ES
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
acBqToPcmCbRenderer.cpp
udioPlayer_to_android.cpp
ndroid_AudioToCbRenderer.cpp
ndroid_AudioToCbRenderer.h
ndroid_GenericPlayer.h
ndroid_LocAVPlayer.cpp
ndroid_LocAVPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
ndroid_defs.h
nclude/AacBqToPcmCbRenderer.h
37a0d0ad678553af318d4d3b9ca93e2377b78a31 01-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> am c157a9c2: Bug 5544082 Filter out unsupported codecs in OpenSL ES

* commit 'c157a9c259474d4e1736c4f9ccccad10b5000734':
Bug 5544082 Filter out unsupported codecs in OpenSL ES
3597268c2bf4ff71521e3cbe522d7ee02c41f175 01-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 5544082 Filter out unsupported codecs in OpenSL ES

When decoding compressed audio data, disregard tracks
encoded with unsupported codecs.

Change-Id: If0535013990923c6859829106ccf9e92e5856f90
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
241b9c06493479dc632a8851097c193b724a2b41 26-Oct-2011 Andreas Huber <andih@google.com> Remove MediaPlayer::setVideoSurface legacy.

Change-Id: I95aa181f39b375087b30ac65fea37589108c9f16
ediaPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.h
ndroid_StreamPlayer.cpp
220b874d41bc8d105ea446d5d556fb3592de965c 28-Oct-2011 Glenn Kasten <gkasten@google.com> am 13ffc7f7: am d0b07222: Merge "Bug 5526807 inform client of errors after prepare" into ics-mr0

* commit '13ffc7f7c69e2fabf1ef70ebb2ea81489be9bd74':
Bug 5526807 inform client of errors after prepare
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
6e413fb8c5cde438092736e7fb58abb48e51637d 28-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5526807 inform client of errors after prepare" into ics-mr0
870299140ace824f90086664af176cb06ade4fd6 27-Oct-2011 Glenn Kasten <gkasten@google.com> am 21b2f0ce: am d7762ba2: Bug 5526272 ignore player events during destroy

* commit '21b2f0ce677aa42c34df65995eefb30e20f2c3aa':
Bug 5526272 ignore player events during destroy
d92b6a98b7ff947becfc8824cd4aa2ed12ed68b6 27-Oct-2011 Glenn Kasten <gkasten@google.com> am d7762ba2: Bug 5526272 ignore player events during destroy

* commit 'd7762ba20bc7d13e1af73539d7a2a75183e2960b':
Bug 5526272 ignore player events during destroy
5e4d65e369f28746767aba11b618dee314bb8197 27-Oct-2011 Glenn Kasten <gkasten@google.com> Bug 5526807 inform client of errors after prepare

Change-Id: Ic5c88f8e1c8e7d6226a7a71a2a89a70f0fa876f8
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_defs.h
9d8a98601357c0669dca4de63e43196c0a70553d 27-Oct-2011 Glenn Kasten <gkasten@google.com> Bug 5526272 ignore player events during destroy

Change-Id: I45c67660c7cbfabcf66b0ffffbaedf56c17453d7
ediaPlayer_to_android.cpp
de7c7da8460de9fb1e8739978f25e1463e2e1666 26-Oct-2011 Steve Block <steveblock@google.com> Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I4c0e3dc9da0a0cdf9aef8be4fae7b24da876dc17
ndroid_AudioSfDecoder.cpp
ndroid_GenericPlayer.cpp
409b09b0436e0268b0025a935a42076f8274b7d7 25-Oct-2011 Ed Heyl <ed@google.com> Merge remote branch 'goog/ics-mr0' into ics-mr1
f0605e369850d13c4e5aa30b6548cdf20e3c7a56 24-Oct-2011 Glenn Kasten <gkasten@google.com> am ba6d04f5: Bug 5505856 remove incorrect setDataSource(NULL)

* commit 'ba6d04f523bf6c3c2d4ed6975109e72f328889b8':
Bug 5505856 remove incorrect setDataSource(NULL)
7c40d3b78c609b2a84acd0dd6e874ab24a73f8d7 24-Oct-2011 Glenn Kasten <gkasten@google.com> Bug 5505856 remove incorrect setDataSource(NULL)

Change-Id: Id23cbc43b56c014f5931cd1e941c12a773dba2b5
ndroid_GenericMediaPlayer.cpp
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
ndroid_AudioSfDecoder.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
0e5f0772fac49acfed60f0dcdf02e97fc5e3b5d7 14-Oct-2011 Glenn Kasten <gkasten@google.com> am 70db434d: Merge "Bug 5267571 disable callbacks earlier" into ics-mr0

* commit '70db434d0dc2a58656e792ac8cdcd9a09ee5f17a':
Bug 5267571 disable callbacks earlier
b66dfcb9e7b944c45927314ef2282d6cc95cfa0a 14-Oct-2011 Glenn Kasten <gkasten@google.com> Bug 5267571 disable callbacks earlier

Change-Id: I0da3b85dcce93a8a250b8b225a998b80d92f436b
ediaPlayer_to_android.cpp
0384250ce4221e4a6a16db2725e1232c71a60965 30-Sep-2011 Glenn Kasten <gkasten@google.com> More logging of media events for debugging

Do range-checking of MEDIA_BUFFERING_UPDATE parameters.

The other new logs are LOGV so disabled by default.

Don't forward empty MEDIA_SET_VIDEO_SIZE notifications, as
mediaserver seems to send these even for audio-only tracks.

Change-Id: I49063f83cec7bdfedb768b32f94735983755ebf2
ndroid_GenericMediaPlayer.cpp
02581cf1ea8e4392760f370b9d64f097ea2c81f4 12-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Final revisions for NDK API level 14"
c0030ccb947c24939511020b23f37142fdc70e36 12-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Error logging in AAC"
2f8642e546ca9d53319573616aab840bf6cb2967 11-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Multithread safety and code reduction"
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
acBqToPcmCbRenderer.cpp
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
c3b82a293ed06001ba6d50f111608160c6065ef2 18-Sep-2011 Glenn Kasten <gkasten@google.com> Final revisions for NDK API level 14

Rename ANDROID_MIME_MP2TS to XA_ANDROID_MIME_MP2TS and
ANDROID_MIME_AACADTS to SL_ANDROID_MIME_AACADTS and make public.
ANDROID_MIME_AACADTS_ANDROID_FRAMEWORK remains private.

Change-Id: Ie2cda273b6adb2db453aad188b28e64147f9e6b0
udioPlayer_to_android.cpp
ndroid_defs.h
a3de08c6ee93a63643e9c6118dd66c0eb6398de1 11-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5293383 ~StreamSourceAppProxy wasn't reached"
f5d4ad08eb6318676651f5b026ed8ddd85d122e7 10-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "AudioPlayer kEventPrepared"
a0fa47f72f47fffb80ab2ae791739ce73de1e8f4 12-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5293383 ~StreamSourceAppProxy wasn't reached

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
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
7813fe24115f4b363a4bd952f15156d81b861cb4 10-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5406664 workaround GetPosition for decode"
209c05d9104db8b77ef0846ee8eb3b161bf44031 04-Oct-2011 Glenn Kasten <gkasten@google.com> Bug 5406664 workaround GetPosition for decode

Change-Id: I6158108a8ca192f704558caca2006bf704c80d6e
ndroid_AudioSfDecoder.cpp
dfc864b1f84f1d050763cf84109b9fdca4415bba 10-Oct-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix bug 5374629 Can't create AudioPlayer playing from MP2TS ABQ"
e9f0847ff5df38f50b750c87898a19854e029b39 10-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Don't update prepare state more than once"
93a361e3f2d39870ce307126dc5377715feb3e16 10-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Reduce log spam from callback protectors"
6e0a69b1185405c11a88e3d7c8a8278ac93ccd54 03-Oct-2011 Glenn Kasten <gkasten@google.com> Error logging in AAC

Change-Id: Ie0b620871543b18e58964a42842d1bb9f193c235
til/AacAdtsExtractor.cpp
4efb2aa0d563b86b3c95d418d6d61d97f51c0bbb 07-Oct-2011 Glenn Kasten <gkasten@google.com> DataSource::getSize() returns ERROR_UNSUPPORTED

Per <media/stagefright/DataSource.h>), if a DataSource doesn't know the
size, then getSize() should return error ERROR_UNSUPPORTED.

This exposed a problem in error handling for calculating duration.
The calculation for per-frame duration should still be possible, even
if we can't calculate the total duration when getSize() fails.

Change-Id: I9004e78f8453982025df601b34cc7be3a967f293
ufferQueueSource.cpp
til/AacAdtsExtractor.cpp
796eb075da9c84c5479bdd4dedd9c46c632e8e60 30-Sep-2011 Glenn Kasten <gkasten@google.com> AudioPlayer kEventPrepared

Combine execution paths for successful and unsucccessful paths of
android::GenericPlayer::kEventPrepared: for AudioPlayer to make it easier
to see the similarities and differences (and make some other changes soon).

Remove old asserts.

Change-Id: I59304d368a9b7611f2a16c1c687cf8d827526b58
udioPlayer_to_android.cpp
83c36078465817323d499670a409618cdc134f90 04-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5385386 missing HEADATNEWPOS"
30e81d75c9066a0ba51eadd4289131d9d4f966cf 04-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5161265 Error recovery getting video codecs"
0d1c7e2ccd98bf7e2285c3db98ea263c79b24978 04-Oct-2011 Glenn Kasten <gkasten@google.com> Don't update prepare state more than once

If a MEDIA_ERROR event is received during preparation, it indicates
that prepare has completed unsuccessfully. However, MEDIA_ERROR can
also legitimately be sent after successful prepare. In that case, don't
update the prepare state.

Similarly, in the unlikely case that MEDIA_PREPARED is received after
prepare has already completed successfully or unsuccessfully, ignore it.
This probably indicates a buggy mediaserver, but we wouldn't want that
to take down the client also.

Change-Id: I2a92e98d13b70d1aa5ff6f440ad528f6896a2ead
ndroid_GenericMediaPlayer.cpp
15c706b25a8b9993b5391de574ed52c1628060be 04-Oct-2011 Glenn Kasten <gkasten@google.com> Reduce log spam from callback protectors

Change-Id: I83f40370bf86878e6d8dcabfff3847cab2cbbd6c
allbackProtector.cpp
3e1a45eb4882ae42fb1d55cf89d94b7e30e97f2a 03-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5399251 notify on AAC decode prepare success"
4c178cd8b962c2bcd84cf8a9e9dcf066bcb2f292 01-Oct-2011 Glenn Kasten <gkasten@google.com> Merge "Remove dead code"
457b9394608d48020d156e9525354b421f8f3e08 01-Oct-2011 Glenn Kasten <gkasten@google.com> Bug 5399251 notify on AAC decode prepare success

Change-Id: I35715be7812c6fe671f74afb7a92ebe60b4a6710
acBqToPcmCbRenderer.cpp
779a533785a4b8d2521123bc3c0a035b93ba078d 30-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 5374629 Can't create AudioPlayer playing from MP2TS ABQ

An AudioPlayer playing audio coming from MP2TS data stored in an
AndroidBufferQueue couldn't be created and realized anymore due
to:
- a regression that prevented an OutputMix to be used as the
sink of an AudioPlayer that had an ABQ as a data source
- a missing update when the Realize() method became fully
locked on the object, android_audioPlayer_realize() was
still trying to lock the already locked AudioPlayer.
Both issues are covered by a CTS test.

Also verify the SLSeekItf is not required when using an ABQ
source.

Change-Id: Ibb1b753dcce59b7cf23ba118e287349e00e7fff4
udioPlayer_to_android.cpp
9688e432421a656f21fa3c72f40621d5aa2ae19e 30-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5334969 MediaPlayerNotificationClient safety"
3888f4ba1b3c391104c104ce054f7ad4ec71556c 30-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5161265 Error recovery getting video codecs

Retry if mediaserver happens to be down when asking for OMX codecs.
Use IMediaDeathNotifier::getMediaPlayerService which tries a few times.

Change-Id: Ibeb69c82303f35fbc9e5948997f568e816721328
ideoCodec_to_android.cpp
c0a40f3efef1706f861777ff68003fe344730055 28-Sep-2011 Glenn Kasten <gkasten@google.com> Remove dead code

Change-Id: Ic68d4d7b942ef99120ad30ee3ef7ce48ff1d697a
udioPlayer_to_android.cpp
ufferQueueSource.cpp
ndroid_AudioToCbRenderer.cpp
ndroid_AudioToCbRenderer.h
ndroid_GenericMediaPlayer.cpp
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
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_StreamPlayer.cpp
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
udioPlayer_to_android.cpp
ufferQueueSource.h
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
ndroid_defs.h
947ccd3690e84649878f2583c701ca8de1b19ed4 24-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5365486 GetVideoDecoderCapabilities

If OMX IL implementation reports a codec with 0 profile/level
combinations, it should not be an error for the application to query
the number of profile/level combinations.

Change-Id: I6838ba1168da70a5c5e7d5a2832ec3ee1ee9aef3
ideoCodec_to_android.cpp
d1e9fd4cff80becfef5077090fc90328ba63999a 22-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5267593 Workaround for crash at Destroy

Call IMediaPlayer->stop() from ALooper thread for now, as NuPlayerDriver
does not currently support multi-threaded clients. This fix should be
reverted after NuPlayerDriver is multi-thread safe.

Change-Id: I94dc91bdcc9f840f50c3ed831aa6e15e09a0f96e
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
694466442b595ad10aa90b09e6415488951f34d9 22-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Use async notify everywhere"
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
udioPlayer_to_android.cpp
allbackProtector.cpp
allbackProtector.h
ndroid_AudioToCbRenderer.cpp
ndroid_AudioToCbRenderer.h
ndroid_GenericPlayer.h
ndroid_defs.h
22de06ce0df9144d47069c235e60c9d2b08c0fff 21-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Set mAndroidObjState to ANDROID_READY once"
bc192d2f064588e2620af1986cc85b90a3e5544e 18-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Fix typo"
91ff087fb814063f9faa23ab37a61e8fe4e38f45 16-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5334969 MediaPlayerNotificationClient safety

Fixed race due to missing mutex around 2 updates to mPlayerPrepared.

MediaPlayerNotificationClient had a raw reference to GenericMediaPlayer;
if for some reason the binder thread out-lived the GenericMediaPlayer,
then it might reference a destroyed object. Made it a weak reference,
and issue warning if the GenericMediaPlayer has been destroyed.
This has similar effect as a callback protector.

Minor related:
- mHasVideo is read without mutex, safe since never changed but make it const
- GenericMediaPlayer's reference to MediaPlayerNotificationClient is now const also

Change-Id: I67b50e861a055c73fd490fb537a3d6d23d25c3d2
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
d6be802c5267a3c8599c11af2c38ead666f74a72 17-Sep-2011 Glenn Kasten <gkasten@google.com> Use async notify everywhere

We use asynchronous notify in all places except PLAYEREVENT_PREPARED.
Since there doesn't seem to be a clear reason why this should be
different, make it be the same.

Change-Id: I0a83d4ac7a7e8e16e3404a25f081176701de01ae
ndroid_GenericPlayer.cpp
f66b430471d691de4bf7b6bbc1a6527897f61cbd 17-Sep-2011 Glenn Kasten <gkasten@google.com> Set mAndroidObjState to ANDROID_READY once

The mAndroidObjState field should only be set to ANDROID_READY once,
after prepare completes either successfully or unsuccessfully.
Remove a couple of redundant assignments.

Change-Id: I4b73bc94aea4f8d4afc1111d7fcdccce4bf8a92d
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
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
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
377c6471dbefd6251c11d9c5633193cd57598991 12-Sep-2011 Glenn Kasten <gkasten@google.com> Fix typo

Change-Id: I673830007c2533110006e88b2c344bca3adaf448
acBqToPcmCbRenderer.cpp
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
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
dac31e514613ac4d1559f6d41c3673f966a8d4ab 12-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5287473 realize locks"
4260ff7b8f65fdfe8d0176cdce66faf0a10c4b10 10-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5287473 realize locks

Realize had inconsistent and partial locking.
Now realize runs completely locked by default.

Change-Id: If453cfc0ac874f32cf5a1fcfe7795d24bd2a48d4
udioPlayer_to_android.cpp
a07e6cd61b12a5c6ed78adaa88a08abd028f5a64 10-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 5236913 Update sample app for PLAYEVENT_HEADATEND with MP2TS

Update the sample application to receive the PLAYEVENT_HEADATEND
event after EOS has been processed.
Remove dead code in the corresponding implementation (in class
StreamPlayer).

Change-Id: Ibe484a8c0e9605c05cd47b154d6c0aff1e70d49e
ndroid_StreamPlayer.cpp
6bc8af4e67051af7c86c311cb9c50e294e547500 09-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 5236913 Callback for MP2TS when EOS was processed

When the buffer containing the EOS item in the Android Buffer Queue
gets processed, make sure the application callback gets called.

Change-Id: I7476a908419ec99c52c3d3f3938de3f86ab926c6
ndroid_StreamPlayer.cpp
f8b4af60627f6bda2934ab3cdb8460c833e90417 09-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix bug 5236913 EOS causes HEADATEND event in play callback"
d93a9cb6509ad540125e2aa7f49638b95ec361ee 09-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Bug 5236913 Callback for AAC decode when EOS was processed"
113a9f14ea680a441540436b342f5008605aba27 09-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 5236913 EOS causes HEADATEND event in play callback

In AAC decode through an Android Buffer Queue, after receiving
an EOS command, prevent reading from the queue by returning
a size of 0, which causes the decoder to signal an end of
stream. This will cause the SL_PLAYEVENT_HEADATEND to be
fired (from the same thread that sends the decoded data)
if the event was part of the play event mask, and a callback
had been registered.

Change-Id: I435e8a66dbe9bc37f24c9e1f1c13f0dbd670b395
ufferQueueSource.cpp
ufferQueueSource.h
til/AacAdtsExtractor.cpp
145156a92c1d379e494cb69920d49b87f9c0e300 09-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5280072 decode AAC ADTS fails for CRC content

Also copy in the length check from Stagefright.

Change-Id: I6758dbe370dd3a7178061183bbb83d289e5c00c5
acBqToPcmCbRenderer.cpp
til/AacAdtsExtractor.cpp
5760ef34bd7f50060fd8fbda10e359f8a830bfbc 09-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 5236913 Callback for AAC decode when EOS was processed

When the buffer containing the EOS item in the Android Buffer Queue
gets processed, make sure the application callback gets called.

Change-Id: I0c8dfb61404ea33322a5755afa7c44213e53ce02
ufferQueueSource.cpp
251f90a1a07a721e873a5bfbee96a11cfc33b200 07-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix 5249076 Don't let the shared memory buffer drain"
d9193f90228723898127d6a21b1404c222a479a3 07-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5262776 reliability of play event callbacks"
bc0e642e6c1a51b3ae3a02d490d94b03e718e6b5 02-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix 5249076 Don't let the shared memory buffer drain

Whenever pushing data to the shared memory from the
AndroidBufferQueue, post a message to do the same operation
again if there is still room in the shared memory. This
ensures the consumption of data will keep the
shared memory buffer full, not the notification of space
available in shared memory, which may happen while the
Android Buffer Queue is empty (after a clear() for
instance).

Change-Id: I397d70ebb927fa6a1d0fb97321a70db0440b96fe
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
ddaf8fec2c6362785f8f27e59e30bf6bfe858f3b 03-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5262776 reliability of play event callbacks

This makes HEADMOVING and HEADATMARKER work more reliably, especially
at the beginning of track and under heavy load. Previously if an event
update was missed because update period is too small or mediaserver/client
is too busy to keep up with notifications, then subsequent events
were lost. This happened more than you might expect; the first event
was often lost and things just got worse from there.

Cleanup in AudioSfDecoder:
- Call up to superclass (GenericPlayer) onSeek and onLoop
to make future maintenance easier.
- Delete dead code in onMessageReceived.
- Logic depends on mLastDecodedPositionUs not being ANDROID_UNKNOWN_TIME
- Simplify getPositionUsec

Add more logging in GenericPlayer::updateOneShot.

Change-Id: Iacddafeb3a20b25bee6da602f6a783201d80be10
ndroid_AudioSfDecoder.cpp
ndroid_GenericPlayer.cpp
0f92f48017588949daf7d24a339423e149bb2555 01-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5244675 PCM sample rate metadata units

The current metadata key macro name ANDROID_KEY_INDEX_PCMFORMAT_SAMPLESPERSEC
is confusing. This change renames it to ANDROID_KEY_INDEX_PCMFORMAT_SAMPLERATE,
and documents that it is in Hz rather than milliHz. The key string is
renamed from AndroidPcmFormatSamplesPerSec to AndroidPcmFormatSampleRate.

Details:

OpenSL ES 1.0.1 PCM struct SLDataFormat_PCM field samplesPerSec
[sic] is in milliHz. OpenSL ES 1.1 preserves that struct, but adds
struct SLDataFormat_PCM with field sampleRate also in milliHz. If the
ANDROID_KEY_INDEX_PCMFORMAT_* metadata keys were intended to exactly
model the OpenSL ES PCM data format struct, the metadata sample rate
would also be in milliHz units. However, the rest of Android operates
in Hz so we use Hz here also.

Backwards compatibility for the name should not be an issue,
as the initial beta developer has not yet started using this metadata.

Related change: delete a duplicate header file.

Change-Id: Ib8f620dfe7a328f621ddbb19f55e5691eb22d7b5
acBqToPcmCbRenderer.cpp
penSLES_AndroidMetadata.h
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
d6cd4e9b5c7a02ffa27096b530db5bb9f8a6ecc4 02-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5244675 default channel mask based on count"
c93cf30bdf4b91a9695ee78a4d78fe151e72ff4b 02-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "MediaPlayer GetPosition returns 0 before prefetch"
e52e877354b1477d5cb34d24c70417820b013521 01-Sep-2011 Dave Burke <daveburke@google.com> Require INTERNET permission for network-based content.
Bug #1870981

Change-Id: Ia7b9b75feb5b43fe9358bbbca6b619112984246c
ndroid_LocAVPlayer.cpp
ndroid_StreamPlayer.cpp
20d9a1229c7647dd2c6f1bece715080ec6202eca 31-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5244675 default channel mask based on count

Change-Id: Ica0b1bd5a23d9bbc318003509e2463a588d9bd39
acBqToPcmCbRenderer.cpp
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_sles_conversions.h
136965c92c625d52a6cbad42f82a2091d7769c9c 02-Sep-2011 Glenn Kasten <gkasten@google.com> MediaPlayer GetPosition returns 0 before prefetch

This makes MediaPlayer work the same way as AudioPlayer,
to return current position as zero before prefetch started.

Change-Id: I538919d05074002d46c3dc1632caa4d5a85e8fad
ediaPlayer_to_android.cpp
98effed0f11095eadc14cf3aec121d2d78c6e74b 02-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Bug 5249076 When starting to stream, have at least one buffer in shared mem"
53445ae321e15496dca8f26398766b39a4c18b56 02-Sep-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5244675 handle the switch cases of AAC decode"
b712aebe63a6c50cc01f4493282fc77578242976 02-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 5249076 When starting to stream, have at least one buffer in shared mem

StreamPlayer is receiving notifications from the MediaPlayer that
a buffer in shared memory is available during playback, which
causes StreamPlayer to consume data from the AndroidBufferQueue.
If the shared memory is drained while the player is paused, there
will be no new notification of a buffer in shared memory being
available to start the cycle of consumption from the Android
buffer queue.
This change causes StreamPlayer to consume from the buffer queue
to fill one buffer in shared memory.
A subsequent change will change the logic to make sure the
consumption from the buffer queue fills as much of the shared
memory as possible.

Change-Id: I886832629dd5ef449719b77899ebdcc7ffc64330
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
57ec2b5fbd0c7c08f068e1f7b9d7644b0932617b 29-Aug-2011 Glenn Kasten <gkasten@google.com> Check callback result code and warn if non-success

The result code is currently unused, but reserved for future use.
This change will help make sure that developers do the right thing now,
so that they will not be impacted when we begin to act on the result.

Change-Id: I8c712882d41d09506defa77340676079bb34de6c
ufferQueueSource.cpp
ndroid_StreamPlayer.cpp
f5ff1a75f55677163bd9a8bd804e8f5c33ef592c 30-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5244675 handle the switch cases of AAC decode

Fix handling of AUDIOPLAYER_FROM_ADTS_ABQ_TO_PCM_BUFFERQUEUE decode use case:
- Play::GetPosition: explicitly list decode case and return media
player time; previously returned zero.
- Seek::SetLoop for AudioPlayer or MediaPlayer: return
SL_RESULT_FEATURE_UNSUPPORTED on non-URI data source. This is
correctly passed up to app.

The remaining have no immediate impact, but should make future maintenance easier:
- Play::GetDuration: explicitly list decode case and return unknown time;
no impact as already covered by default.
- Seek::SetPosition: explicitly list decode case and handle as no-op; no
impact as already covered by default.
- Seek::SetPosition for AudioPlayer or MediaPlayer: return
SL_RESULT_FEATURE_UNSUPPORTED with unsupported data source e.g. buffer
queue. No impact as the result is currently ignored, but added a
FIXME to pass this up to app.
- AndroidBufferQueue::Clear: explicitly list decode case as a no-op
other than the partial clear of upper layer queue.
- AndroidBufferQueue::onRefilled: explicitly list decode case as
a no-op, but with a FIXME that this may need more work later.

Change-Id: I53c8a0b736f32cd265ee9c94a70127d4f80869b5
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ediaPlayer_to_android.cpp
027fc8e9695b7567149a6f151d4322de63f6c085 31-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5217144 AndroidBufferQueue::Enqueue error chks"
677c76347d9aaca4cf3746b3dbfc8a741281066b 24-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5217144 AndroidBufferQueue::Enqueue error chks

Add more error checks to Enqueue:
- check for a NULL data pointer with non-zero data size
- check for a NULL item array with non-zero item array size

For the Enqueue item processing:
- examine all items if there is more than one in the array
- check for invalid combinations of items
- check that total length of item array is large enough for each
item's header and any optional data
- check for an EOS with a non-empty item data
- log if an unknown item key is found
- added the EOS item handling code for AAC ADTS
(the underlying implementation is still not yet done).

Fix copy/paste typo in initializeAndroidBufferQueueMembers.

AacBqToPcmCbRenderer::validateBufferStartEndOnFrameBoundaries:
- now returns a more specific result code rather than bool
- readAt return type ssize_t not size_t
- readAt return 0 (EOS) is a LOGV not LOGE.

Fix race in Android buffer queue callback: replaced logic in
BufferQueueSource.cpp by safer code from android_StreamPlayer.cpp

Change-Id: I423ccbd6d76a736a486b49b5dfdb7898b52cdd02
acBqToPcmCbRenderer.cpp
ndroid_StreamPlayer.cpp
nclude/AacBqToPcmCbRenderer.h
til/AacAdtsExtractor.cpp
91540f92d7f1bcda423859af6bd82df083c2afab 28-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5226085 miscellaneous metadata issues

The metadata keys are now exposed for AAC decode.

The metadata keys are now exposed at Realize. The keys were previously
only available after prefetching was complete. This made it more awkward
for an application to use them.

Fixed race condition in access to metadata values.

Change-Id: I3daed2da61f5ed0add6948f1558963cfe66795fc
udioPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
d1df50751f8b112de78970c71f56fcd2edcb81c4 26-Aug-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Metadata keys for PCM decoding"
68c8a1b6deea46eeca57848768a92e96d583aadd 25-Aug-2011 Jean-Michel Trivi <jmtrivi@google.com> Metadata keys for PCM decoding

Declare in a public header the metadata keys an application which
decodes audio data would use to figure out the output PCM format.

Make the SL ES Android header also include the configuration and
metadata headers.
Update test apps to reflect this.

Change-Id: I298db4fdb800df2d48047691441aa7489aad4822
ndroid_defs.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
allbackProtector.cpp
allbackProtector.h
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
86cc74ab4534c4e4dc79a7cfda83815d7c95beb5 24-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5153313 keep compatibility of local files URI"
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
udioPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_LocAVPlayer.cpp
ndroid_defs.h
dd177e2d3923d4653eaa4226f07b89a999907970 02-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5105712 synchronous callbacks

After GetPosition is made synchronous, it is safer to make client
callbacks synchronous also.

Change-Id: I2688f709ed672aaa62d046d5f95db1b81504c9e3
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
8478d83d1e42e2b4e252cc7e7135fd872bb36982 24-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5198051 MediaPlayer prefetch status interface"
d35a79e84406f855c4541b129106e8a3ce33abc6 24-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5198051 MediaPlayer StreamInformation various"
4b9966d5e0569707f23ab2b22e584f7117adc179 24-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5198051 MediaPlayer PLAYEVENT_HEAD* callbacks"
c623c89c0a32c5fc77c998f1742d58e7be69e8c1 22-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5198051 MediaPlayer prefetch status interface

Change-Id: I426c870f803df0a7052f17be955ba797a814b4cc
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
bcfe680db1e392f3bb29382c2e15e89c3af783ed 22-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5198051 MediaPlayer PLAYEVENT_HEAD* callbacks

Change-Id: Ibb04fbf727997281bb77fd22c51cd90bd044e505
udioPlayer_to_android.cpp
udioPlayer_to_android.h
udioRecorder_to_android.cpp
udioRecorder_to_android.h
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
cfc58893afb25621c08372e35d7ee9e69cf37656 23-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5198051 MediaPlayer play state PAUSED at end"
cb441acdda6f8e81d44fcdaadd4ff7ab3d3e367b 21-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5198051 MediaPlayer StreamInformation various

Fix uninitialized field frameRate.

QueryMediaContainerInformation returns XA_RESULT_PARAMETER_INVALID if
info is NULL, otherwise it copies the information via the info pointer,
and returns XA_RESULT_SUCCESS.

QueryStreamName returns XA_RESULT_FEATURE_UNSUPPORTED.

Simplify RegisterStreamChangeCallback.

Change-Id: I261ac0c053be0de7bac5fc80661b979f7f9c84b6
ediaPlayer_to_android.cpp
3d332ff421e7179c36fb652771cc8ded53383729 22-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5198051 MediaPlayer support GetDuration

Change-Id: I09d9292685d82b88cddd243e6e7f5410ffaa2248
ediaPlayer_to_android.cpp
e37c62f0691f9a137afae60f9d6dbd1a65d36aed 22-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5198051 MediaPlayer play state PAUSED at end

Change-Id: I9160336a9e74b2f2f501cb94d1f24047b2979b76
ediaPlayer_to_android.cpp
1dd88ecd2b70dcface5ba4190dec4226a7a53b84 21-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "8-bit now works"
b238f3ed65f3fa2a3adad602a438fbc98b13cba3 19-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5126938 dependency for video sinks"
1452b38f9f4a8a0d76c936c393c794f3995526b6 12-Aug-2011 Glenn Kasten <gkasten@google.com> 8-bit now works

Change-Id: I70ce7e10f0b465250b9f4d7644d21f5c4b4c99fa
udioPlayer_to_android.cpp
749e8abe47a0ded499e580e256ef6ab3cb4bdf67 18-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5161265 Recover from mediaserver process crash"
ccabcf9073f0ccd12016ff1f05d1c4456c41b254 16-Aug-2011 Eric Laurent <elaurent@google.com> Merge "Bug 5147281 prefetch status deadlocks"
e3f648ad6e3634680452b639ee802c657fbfa73d 14-Aug-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "AAC buffer decode to PCM buffer queue"
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
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_LocAVPlayer.cpp
ndroid_StreamPlayer.cpp
a60dbf554549d10780f473b6e1373aa07aec3a28 11-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5147281 prefetch status deadlocks

Fixed two deadlocks related to AudioTrack prefetch event callbacks:
- if PrefetchStatus interface was initialized on an AudioPlayer,
there was a deadlock at the point where it checked whether to do a callback
- prefetch status callbacks are now called with the object unlocked,
so they are permitted to do APIs on the object

Miscellaneous fixes:
- SMP-safe locks for GetPrefetchStatus, GetFillLevel,
GetCallbackEventsMask, SetFillUpdatePeriod, GetFillUpdatePeriod
- SetCallbackEventsMask error handling for invalid bitmask
- Enqueue sets prefetch fill level to 1000

Change-Id: Ic8b2c440aeb4efa3446a4a73d3422d934ceb0578
udioPlayer_to_android.cpp
bb832e853d4afb11b0a3287b2eb0cad87696d631 27-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> AAC buffer decode to PCM buffer queue

Implement AAC ADTS decode with buffers of compressed data being
passed to the framework through an AndroidBufferQueue, and
decoded PCM buffers being passed to the application through
a BufferQueue (just like existing decode from URI/FD).

Change-Id: Id992a44a5ca7e404088b929f2b0afe9ca1f85223
acBqToPcmCbRenderer.cpp
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ufferQueueSource.cpp
ufferQueueSource.h
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.h
ndroid_defs.h
nclude/AacAdtsExtractor.h
nclude/AacBqToPcmCbRenderer.h
til/AacAdtsExtractor.cpp
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
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.h
106a99988093bd3b3b3aafb2da0fbc0d35634787 09-Aug-2011 Jean-Michel Trivi <jmtrivi@google.com> Initialize video decoder capabilities fields even when unknown

We only support the discovery of codecId, profile and level when
using the VideoDecoderCapabilities interface. The other fields
in the XAVideoCodecDescriptor structure need to be initialized
even if they're not filled.

Change-Id: I8833437b3b23748a50076b65baf5b9a250290b86
ideoCodec_to_android.cpp
f093dcf23cb5f54ced676c03a64cc68a165266f4 09-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5126938 dependency and miscellaneous bug fixes"
70045723775b56440b4e10d948831a2190d2d264 09-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 4603165 playback rate change"
c2a325746469c4c7625ec78a169b65a11dbe1e30 08-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5126938 dependency and miscellaneous bug fixes

Fixing bug 5126938 will involve adding the IAndroidConfiguration interface
to CMediaPlayer object. In the process of doing this, I found a few
miscellaneous bugs in the error handling for IAndroidConfiguration. This
CL fixes those bugs, and prepares for adding the interface CMediaPlayer
by making it easier to support new objects with the interface.

Details:

- Generic error handling:
Move some error checks from the object-specific code into the generic
IAndroidConfiguration.c.
Fix bug in SetConfiguration and GetConfiguration where we were not
checking configKey for NULL
Return SL_RESULT_FEATURE_UNSUPPORTED instead of
SL_RESULT_PARAMETER_INVALID if IAConfig interface is exposed on
an object which doesn't really support it (this could if the classes.c
interfaces table was updated before the cases were updated).
Compare with IMuteSolo for non-AudioPlayer.

- Object-specific error handling:
Fix bug where we weren't returning the actual value size in
audioPlayer_getConfig when pValueSize was non-NULL and pConfigValue
was NULL.
Return result SL_RESULT_BUFFER_INSUFFICIENT instead of
SL_RESULT_PARAMETER_INVALID when output buffer is specified
as non-NULL but available space is too small. Compare with
IAudioIODeviceCapabilities.
Return result SL_RESULT_SUCCESS instead of SL_RESULT_PARAMETER_INVALID
when output buffer is specified as NULL; this is intended to allow
the application to discover the required space. Compare with
IAudioIODeviceCapabilities.

- Use 'switch' instead of 'if' for checking object types, to improve
readability when adding more object types

Change-Id: I8b2cdd506a36bfa9b1326a8a9966a6633bbbba6d
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
1b65b2054448050ded9e1475df7b755421a1e2da 05-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5903270 play interface, events, markers, etc."
659e0e44952e06ac36501c9d3df860005410d7ab 04-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5110581 SL_PLAYEVENT_HEADATEND while looping"
6d78c9bfb68f8a0db1855bc28c087c39a7eb6f2c 04-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 4603165 playback rate change

Non-trivial implementation is only for AudioTrack with rate range 500
to 2000 per mille and property SL_RATEPROP_NOPITCHCORAUDIO; for Android
MediaPlayer the rate range is 1000 to 1000 per mille.

Details:
- no multi-range
- fix SMP races in GetRate, SetPropertyConstraints, GetProperties
- SetRate only updates mRate if successful
- Rate_SetPropertyConstraints only updates mProperties if successful
- return SL_RESULT_FEATURE_UNSUPPORTED for non-AudioPlayers
which have this interface (currently only MidiPlayer)
- for Android, atomically set playback rate and constraints
and simplify to use hard-coded constraints rather than querying
- per the spec, SetPropertyConstraints now returns
SL_RESULT_PARAMETER_INVALID if the constraints are out of range,
or SL_RESULT_FEATURE_UNSUPPORTED if the constraints are in range but
not supported by this implementation

Change-Id: I051ff92b20f3845ffa12bccec778937d42823e5d
udioPlayer_to_android.cpp
udioPlayer_to_android.h
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
udioPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_defs.h
f6445d330c05ccc57d1adcc6ee05735a33f78881 03-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5110581 SL_PLAYEVENT_HEADATEND while looping

Change-Id: Ia4d0433b4a6589bfda2f88addbe5b7eb3d0d9789
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.h
f731cc1f3cd5911b0aff730bd504ee47a3ba3c6c 03-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5109153 Remove log spam"
f152bc273bc3f8471bca626fe9cc966dad304173 02-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5080320 MediaPlayer volume"
ecc4fe22e076c4e5c891d823b01db1a683ba6690 02-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5109153 Remove log spam

Change-Id: I6c0c742bfa3f0078968dc5e2ea3578ad786067c5
ediaPlayer_to_android.cpp
ndroid_StreamPlayer.cpp
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
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.h
8b54effee89c829310e16d69bf2d9496789551b6 30-Jul-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5082191 fix slesTest_decodeToBuffQueue assert"
2e0ad5a525247b48d6300ab48774503f55da75ea 29-Jul-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5092976 no spurious callbacks on prefetch fail"
9f07ea788f57654acf29d1321b40162e41eb122b 26-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5081346 fix whole file looping

Change-Id: If4e233f9007d7e48225a342a43f06df7f66cdea7
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.h
06059e5ee1eaf907589c7f8d1320253f92211348 29-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5092976 no spurious callbacks on prefetch fail

Change-Id: I754085b4d1e43c4d10bea36e0fb683d8113844e9
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
e878c470cf58c8654d613ab2449468b44a90d6e5 27-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5082191 fix slesTest_decodeToBuffQueue assert

Change-Id: I2ec181cc7eba000847bd28e6d04733d3496d74d9
ndroid_AudioSfDecoder.cpp
ndroid_defs.h
fa2bd93c3a9852a1f879663eeff598d13cf8fa81 25-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 4599730 fix mute solo, channel count, volume

Change-Id: I1624c744168233c4ef79f2cd3090447b8aa7d53b
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ediaPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_defs.h
5050a75e342ce45794d56666cddde3d46472acc7 27-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Report last decoded position as AudioPlayer position for PCM decode

Change-Id: I1ec413137d549235af4dc66cb033e1cd0bbbad62
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
7bc462c41b66cf28c95f9c47f60307e1d77fd3a4 26-Jul-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5045590 preset reverb on audio players"
6f0f5640d190b0187c356eb53bd96d9f9e49da60 25-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 5022500 MP2TS format change support in OpenMAX AL

Define new command that can be queued in AndroidBufferQueue
to signal an MP2TS format change.
This command maps directly to IStreamListener::kKeyFormatChange.

Change-Id: I67908fd9e1a7d994862ea3e41c4c0fb6e36bc804
ndroid_StreamPlayer.cpp
ndroid_defs.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
ndroid_Effect.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
64621eac543d714d4d3f7cb9c24205f2ddc59201 21-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5068269 Fix assertion failure after prepare

Change-Id: I890a29eeef9021c7432da8a0ccb409846e107097
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_defs.h
dc93696c78e3a089828188a760ece635cb8d8a09 22-Jul-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5047695 Handle unsuccessful prepare up to app"
49935c51fddcd0caa0030e2aac0c3a7ba3339e3d 21-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5047695 Handle unsuccessful prepare up to app

Change-Id: I9f1541b37ad5cda21dc49388e42c7fb08b22fc5b
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_defs.h
b2549c73290f1955f3a7731bf98446a45f295dfa 21-Jul-2011 Glenn Kasten <gkasten@google.com> Add more verbose logging

Change-Id: I0cccee0d59fe3eefc6ef94b22bb6100d96bccdff
udioPlayer_to_android.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
fa52213f4eccd0fd32bc1a3175e2ac675f6150e5 20-Jul-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5047695 missing cases"
81e917a2605e14901b8f5e6cac7eafb5667aad0d 20-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5047695 missing cases

Change-Id: I9ae27ed4e977568a9687b9dd18eb998651569b24
ndroid_GenericMediaPlayer.cpp
581dacbabb3db9dd65ae6cd6dee791e1a7fecd7a 20-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix bug 5049371 Metadata for decode to PCM buffer queue"
54cad4f35a090a06e655fcc9e072e1d38f9e7689 20-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 5049371 Metadata for decode to PCM buffer queue

When decoding a URI or FD with OpenSL ES to a PCM buffer queue,
you cannot rely on the information given by the extractor, or
the OMXCodec before the latter has decoded one buffer.

The fix consists in two parts:
1/ where to retrieve the PCM format from:
the information first retrieved from the extractor if available,
but then overwritten by the OMXCodec values as soon as it
issues INFO_FORMAT_CHANGED
2/ when can the application retrieve the information:
the information is available when the first buffer of decoded
data is returned to the application via the buffer queue
callback. The test app is updated to reflect this, and verify
that the query can safely happen during the callback.

Change-Id: Ic034c7ff9412c94e9df2aaa3c1d61e9d3bf507d9
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
d7ecf117cfac5f2b90a0dc6c62b56dcce0715971 19-Jul-2011 Glenn Kasten <gkasten@google.com> Reduce logs

Change-Id: I82c8a66886bd3b853fac88594370545ed23a0400
ideoCodec_to_android.cpp
76ac21ed01efa794a61d271501ad08ddc0870dae 19-Jul-2011 Glenn Kasten <gkasten@google.com> Merge "Reduce logging"
de015407a89018f9422254624e1b75703f38defd 19-Jul-2011 Glenn Kasten <gkasten@google.com> Reduce logging

Change-Id: I71c5e016147002fa84a56fc703da52e7b5c8417a
ndroid_GenericMediaPlayer.cpp
6e7e174807fc639c49125ced8962aa369370fbf0 13-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Implement XAVideoDecoderCapabilitiesItf

Add support for the OpenMAX AL XAVideoDecoderCapabilitiesItf
engine interface.

Implement the Android support of this interface in
VideoCodec_to_android.*. This functionality relies
on OMXCodec::QueryCodecs() feature, and does only
expose hardware codec capabilities (see full note in
VideoCodec_to_android.h).

Add sample code to list the platform's video decoders
and their profile / level combinations.

Change-Id: Iff6a42542c1db67ca1dcf539449ca96aa5944f6d
ideoCodec_to_android.cpp
ideoCodec_to_android.h
662c25b0ee98928a01ee4ba551e0503fac168857 14-Jul-2011 Andreas Huber <andih@google.com> NuHTTPDataSource.h is no more, get rid of this (redundant) include

Change-Id: I893738d1aa1e91300c966a5ac3a7cc3ce1202152
ndroid_AudioSfDecoder.h
85133c817f6f387cd7d072988a8818f18bb53702 12-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Async callback queue updates, applied to XAStreamInformationItf

Updated the asynchronous callback queue system to support 'piipp'
callback signatures.

Applied this update to make the StreamInformation property change
event notification asynchronous.

Made the XA_PLAYEVENT_HEADATEND also use the callback queue.

Change-Id: I6fd8dee5eefa1d09006661f69de302a8b7fff0f5
ediaPlayer_to_android.cpp
ddf30363c081b598a4df50c30a7e469a2551bdbd 12-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Implement XAPlayItf::GetPosition on MediaPlayer"
35a5a30fdad179ccf38d8d756590411326159a89 12-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Implement XAPlayItf::GetPosition on MediaPlayer

The play interface was only in place for routing calls to an
AudioPlayer in OpenSL ES, not in OpenMAX AL for a MediaPlayer.

Change-Id: Icf514be428396264252874faf1060c76ddee9545
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
3ece92db4f00b14dfa46118c7ef2dd305e8a19c4 12-Jul-2011 Glenn Kasten <gkasten@google.com> Merge "Defer SL_PLAYEVENT_HEADATEND to avoid deadlock"
377aa54ce344adcbc8bac731c6db9e7e39b432c5 10-Jul-2011 Glenn Kasten <gkasten@google.com> Defer SL_PLAYEVENT_HEADATEND to avoid deadlock

This is a first example, and if it works well then will
be implemented for other appropriate callbacks also.

Change-Id: Ieeab6b3498c74305e19a9d9c8ff497eff22243aa
udioPlayer_to_android.cpp
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
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.h
4f3f0f5d1b97008790158f4dde71057f7d8ed41a 08-Jul-2011 Eric Laurent <elaurent@google.com> Merge "Moved and renamed effect API header files"
ea429ee1007c36ade812199ad365c0e659e8053f 17-Jun-2011 Eric Laurent <elaurent@google.com> Moved and renamed effect API header files

Moved specific effect header files to
system/media/audio_effects/include/audio_effects and renamed
to lower case (effect_xxx.h).

Change-Id: I8e8f6e3851f12ae8bb380fa714abe26da06d3b58
ndroid_Effect.cpp
1a9c2615d0933d183fcb1b9e34ec8f0da2a85153 07-Jul-2011 Glenn Kasten <gkasten@google.com> Rename ANDROID_UNKNOWN_* to UNKNOWN_*

Change-Id: I0d92b7d943690d9af7e08c400471f8b474728bff
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_defs.h
13d02b645fc6e8ffe70a8bf8cc5f69f03558ae40 07-Jul-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix metadata value size check

A bug was introduced during the review of the SLMetadataExtractionItf
interface implementation where the value size was improperly
compared against the size given by the application.

Change-Id: Iae1359e84a410e3fec53bd65e0fba9cc97fce08a
ndroid_AudioSfDecoder.cpp
47550bf6cf5cf08a402a54b1589f4b64582a5120 30-Jun-2011 Glenn Kasten <gkasten@google.com> Bug 4980997 Fix the AudioTrack start deadlock

Details:
- Added AudioTrackProxy, a RefBase proxy for AudioTrack
- Call AudioTrack::start() after unlock

Change-Id: Ib1a05ee57f78432eb4c9d3a5bd68dd31a78d6e3e
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
udioTrackProxy.h
ndroid_Effect.cpp
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
udioPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
f4647bf85968ab30eb07f9a80b99177d91068f94 29-Jun-2011 Glenn Kasten <gkasten@google.com> Call AudioTrack start, stop, and pause when needed

These AudioTrack operations are relatively expensive Binder calls (and
will soon be even more expensive to fix a deadlock at AudioTrack::start),
and they were being called excessively. Now AudioTrack start, stop,
and pause are only called when there is an actual play state change.

Details:
- distinguish ATTR_TRANSPORT vs. ATTR_PLAY_STATE for audio players
- android_audioPlayer_setPlayState is only called when the play state changes
- handler_AudioPlayer_transport is only called for transport changes other than play state
- android_audioPlayer_setPlayState is always called with mutex locked
- since media player currently only handles play state, handler_MediaPlayer_transport
is still called for both ATTR_TRANSPORT and ATTR_PLAY_STATE
- since the handlers for ATTR_BQ_ENQUEUE and ATTR_ABQ_ENQUEUE are only called if in
state PLAYING, changed an "if" to an "assert"

Change-Id: Iee2968fd98d215885b7105053bb1604f962ea337
udioPlayer_to_android.cpp
udioPlayer_to_android.h
6cce136651f6fd2c7aecd45bc553270152d75462 28-Jun-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix race condition when deleting an AudioPlayer

When deleting an AudioPlayer that is used as a PCM decoder,
there can be callback underway, for instance when trying to
delete a player just as the notification of its preparation
arrives.

The fix consists in:
- flagging all callback with the CallbackProtector
mechanism,
- only entering callback when it is valid to do so
- renaming AudioTrackProtector to CallbackProtector
as this mechanism is not exclusively used for the
AudioTrack callbacks.

Change-Id: I9336a75981de43f71a983c1300f3a0ff314ac1e0
udioPlayer_to_android.cpp
udioTrackProtector.cpp
udioTrackProtector.h
allbackProtector.cpp
allbackProtector.h
ac18c1cd32408884d3960bd7aa56ba419c2ca68b 25-Jun-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix NPE in audio decoding

If the data source wasn't properly initialized, the corresponding
member field should be accessed.

Change-Id: I811827991078db4b8dc4278014f046361f06e1a2
ndroid_AudioSfDecoder.cpp
8bae97ce4243cb9fe37fa35b82cca48fca735e72 23-Jun-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 4606138"
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
udioPlayer_to_android.cpp
udioPlayer_to_android.h
penSLES_AndroidMetadata.h
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_defs.h
8b565a4139cb37b0682b44cf9a16525ebf6c2058 16-Jun-2011 Eric Laurent <elaurent@google.com> Revert "voice processing"

This reverts commit 7585d227843769079ee2afb385607b3e23ac1e07
ndroid_Effect.cpp
7965455f86c21d6e1f788b284f5fc829e82ff2b5 14-Jun-2011 Glenn Kasten <gkasten@google.com> Bug 4606138

Change-Id: If4745ee39eeedf11388800cc30c26e4c4f8ddaa0
udioPlayer_to_android.cpp
87c9a6bbe9dabec3d795675ab0ef74a773cc1670 12-Jun-2011 Eric Laurent <elaurent@google.com> voice processing

Change-Id: I0b6129f566349fd333f34773589d5d15c36a7c15
ndroid_Effect.cpp
b4fb100d7122d118d3da9d1d08ffacef68dd38b0 03-Jun-2011 Jean-Michel Trivi <jmtrivi@google.com> Stop the OMX codec when destroying the OpenSL ES decoder

The AudioSfDecoder class uses a MediaSource interface from
an OMXCodec object. In the class destructor, the codec must
be stopped before the codec is anihilated.

Change-Id: Ibf0d729e055dcd8f4e05f3fb8332d650f9be0d30
ndroid_AudioSfDecoder.cpp
a84c5e20d9884d7ec7e4b1377a328c1d1a552b70 02-Jun-2011 Glenn Kasten <gkasten@google.com> Revert "Use AudioTrack::event_type not int in callback"

This reverts commit 1d7ee1569f98f7f1b629a04bb0895165255c7f7b
udioPlayer_to_android.cpp
afb606059a28ee6e497e0a8a09a6b66e74a838b6 05-May-2011 Glenn Kasten <gkasten@google.com> Use AudioTrack::event_type not int in callback

Change-Id: Icd60d7eff86e3bdf9907c573b6900c8eca96acf1
udioPlayer_to_android.cpp
10a3840407ac3ed61e7873ee7b86d664ccc6149f 11-May-2011 Dima Zavin <dima@android.com> update for new audio.h header location

Change-Id: I2140f1def08bedd8b2bd5170c6ac5edccb80035c
Signed-off-by: Dima Zavin <dima@android.com>
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
utputMix_to_android.cpp
ndroid_Effect.cpp
ndroid_sles_conversions.h
ca39f4b4dbeb920a5b97bd65be73f2f7cac77431 06-Apr-2011 Dima Zavin <dima@android.com> system/media: convert to use new defines from hardware/audio.h

Change-Id: I8f0f0d26e10dbbb4dfbc3b52f1c02737a375c5e0
Signed-off-by: Dima Zavin <dima@android.com>
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
utputMix_to_android.cpp
ndroid_Effect.cpp
ndroid_defs.h
ndroid_sles_conversions.h
2f6d462d89356cdaa77299ca27b60c5cca198d98 14-Apr-2011 Gloria Wang <gwang@google.com> - Add another parameter in notify() to be able to send timed text sample
through listener during video playback.
For feature request 800939.

Change-Id: I14aa18d2f803163a62c05f9e6bd990518c58cd3f
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
c2538ea97795072fa5edab1ddba47a5d34530c32 13-Apr-2011 Glenn Kasten <gkasten@google.com> Merge "Fix build warnings caused by the 'long' change"
a8179ea15c4ff78db589d742b135649f0eda7ef2 13-Apr-2011 Glenn Kasten <gkasten@google.com> Fix build warnings caused by the 'long' change

Change-Id: I34e74d723ae7fd829dd140614928d7880e669f03
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_AudioToCbRenderer.cpp
ndroid_StreamPlayer.cpp
ndroid_prompts.h
7ef5526a7bd12eccfa777cc8bc167794634f405a 13-Apr-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix stuttering at beginning of playback

When an AudioPlayer is created, its playstate is set to STOPPED
three times. A stop command is translated into a pause + seek(0).
When a seek is underway, any new seek command was postponed. So
when playback would start after a first seek(0), the other seeks
would be executed, causing the stutterring.
This CL verifies that, when seeking to a certain time, any new
seek command to the same point in time received while seeking
is ignored.
It also correct the update of mStateFlags, which should be done
BEFORE the command is issued to the player, in case the seek
complete notification happens syncronously with the seek command.

This CL does NOT fix why a newly created player sees its playstate
updated to STOPPED three times in a test app like slesTest_playUri
before playback starts.

Change-Id: Ic7627678735f559b911ea3c5a0e1e00d7d7534d2
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
e31a69fcbe27894a597176d05a08e04c06092021 13-Apr-2011 Glenn Kasten <gkasten@google.com> Fix various bugs found with unit tests

ISeek::SetLoop was returning undefined status.
Khronos Bug 7614 - sizeof(long) != 32 bits on x86_64.
Fix bug in IID hashing due to the above.
Fix bug in GenericMediaPlayer::onLoop; was using mPlayer without checking for NULL.
Fix wrong API level in tests/sandbox/object.c.
Decrease log level from I to V in MediaPlayerNotificationClient::notify
and GenericPlayer::~GenericPlayer.
Fix memory leak in tests/sandbox/engine.c.
Comment out overly verbose log in tests/sandbox/streamSource/slesTestPlayStream.cpp.

Change-Id: I322fa9e19ee95ea1e18870a20f6a3c03b8f21208
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
36b700a829b7a02b873b4cd0cdb0a95342b20a31 11-Apr-2011 Jean-Michel Trivi <jmtrivi@google.com> Use reference to sp on GenericPlayer

When an object like GenericPlayer is stored in CAudioPlayer or
CMediaPlayer by a sp, don't use a pointer to GenericPlayer when
the object is passed as a function parameter, but rather use
a reference to the sp that maintains it.

Change-Id: I49ff219618ac4b657deb43cfffb65f0e0dd6d58d
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
92b245bf8828db9e469febebbe8774c00570b5b9 07-Apr-2011 Jean-Michel Trivi <jmtrivi@google.com> OpenMAX AL: support the SeekItf and XA_PLAYEVENT_HEADATEND

Implemented support for:
- seeking to a position
- looping (only over full duration is supported, no loop points)
- notification of end of content reached
This is all for the playback of URIs or FDs.

Change-Id: I015c40e66feb7ac280459895f5f7915ac964df31
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
b05ea38e5131001884aa226f90fd50cf594a23f3 06-Apr-2011 Jean-Michel Trivi <jmtrivi@google.com> OpenSL ES / OpenMAX AL code clean up

Do not use cryptic acronyms for Android object type definitions.

Harmonize object state and type naming conventions.

Change-Id: I62bed7aba2e0b9ea0c47264af8e3cf29f74746a8
udioPlayer_to_android.cpp
udioRecorder_to_android.cpp
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_defs.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
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ediaPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_SfPlayer.cpp
ndroid_SfPlayer.h
ndroid_StreamPlayer.cpp
ndroid_defs.h
2b06e20ae32388f6e1dfd088d9773c34e6b1cb45 29-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Reduce include noise in SL and XA class definitions

In classes.h: we should only have to include the headers
for the objects that are actually stored as member variables of
the OpenSL ES and OpenMAX AL objects (so here AudioTrackProtector,
Effect, and GenericPlayer).
In CMediaPlayer.c: remove useless includes and change the video
surface function prototypes to use const refs to strong pointers
instead of pointers to access the GenericMediaPlayer objects.

Note that android_SfPlayer.h is still in sles_allinclusive.h because
it will be dealt with when the SfPlayer functionality is absorbed
under LocAVPlayer.

Change-Id: Ic2c9459862588399d9545a247cc15341effc0f66
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_AudioSfDecoder.cpp
ndroid_AudioToCbRenderer.cpp
ndroid_AudioToCbRenderer.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_LocAVPlayer.cpp
ndroid_LocAVPlayer.h
ndroid_SfPlayer.cpp
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
63c002ab68761be0eace98f28320d8eb2f3f7695 28-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Clean up main header

There are many includes in sles_allinclusive.h that should be moved
to the files that rely on those headers. This is a first cleanup
to move Android audio effect related headers to where they belong.
+ one relocation for a media server related file. More to come
with AudioPlayer refactoring.

Change-Id: I181dde96db522d9cfb537dffea18ba57f855b99e
ndroid_Effect.cpp
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
83ac345e264c1e22b7a2f1a110b2fe92473394ec 19-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 4109988 fix deadlock on destroy

Fix deadlock with an AudioPlayer playing from a PCM buffer queue.
This type of player uses an AudioTrack that pulls data through
its callback from a buffer queue.
This issue is that when you destroy the player (whick locks the
object), it tries to destroy the AudioTrack object. The
AudioTrack destructor can only finish when the AudioTrack
callback thread can exit. If a callback was underway when
trying to destroy the object, a race condition existed for
the AudioPlayer lock.
The fix consists in using the "pre-destroy" hook for the AudioPlayer
object. In it, we unlock the AudioPlayer, and block until the
AudioTrack callback has signaled it's done. The pre-destroy
hook also marks the track as "about to be destroyed" so any
callback that gets called once the pre-destroy hook has been
called can return immediately.

Change-Id: I4ca69157ff381232c1edc8fb576c6d9e90c2777f
udioPlayer_to_android.cpp
udioPlayer_to_android.h
udioTrackProtector.cpp
udioTrackProtector.h
e9236d046fdb5cac0696c42e03443a2439188146 16-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 clean logs, PTS should be unsigned

- Don't pollute logs.
- Save MPEG-2 PTS as an unsigned 64bit value, negative values are
invalid.

Change-Id: I51d427789dd1e42219a63c68159f2e28628f0448
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ndroid_AudioSfDecoder.cpp
ndroid_AudioToCbRenderer.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_LocAVPlayer.cpp
ndroid_SfPlayer.cpp
ndroid_StreamPlayer.cpp
1c853a41d9d9886e60618a7c878ce3912f46bf3c 15-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 callback mask for TS streaming

- declare a "buffer event" item key and the event mask matching
the OpenSL ES 1.1 buffer queue event mask
- added a buffer state field in AdvancedBufferHeader to keep
track of the lifecycle of a buffer in the queue
- in StreamPlayer, store a constant to be sent as the item
each time a buffer is dequeued because it's been processed
- fix bug in playStream test app where after clearing the
queue, the data was read to the last dequeued buffer address,
rather than at the beginning of the cache.

Change-Id: I07141c8a913dfedeb9fde41d80afbce794ab7379
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.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
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_AudioSfDecoder.cpp
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_SfPlayer.cpp
ndroid_StreamPlayer.cpp
ndroid_defs.h
e7bfcdc183454ec959ff51342f0973cabba219b2 08-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 Implement Clear() and GetState() for MPEG-2 TS

- implemented Clear() in AndroidBufferQueue
- declared and implemented GetState() in AndroidBufferQueue
- fixed typo in AudioPlayer_to_android.cpp that cause a "case"
to be compiled as a label (no unused label warning from
compiler)
- more test in sandbox/streamSource

Change-Id: If4eede16430cda943224bf950669cc105ac2f894
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.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
ndroidBufferQueueSource.cpp
ndroidBufferQueueSource.h
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
ndroid_defs.h
ad1ab1d13a9b043202b9d5cdc1d8c4ef66cbbca8 05-Mar-2011 Glenn Kasten <gkasten@google.com> Bug 3329759 Surface texture as video sink

XA_DATALOCATOR_NATIVEDISPLAY now allows either a Surface or SurfaceTexture
together with a JNIEnv *.

Miscellaneous fixes:
- Clarify test button labels.
- Line length 100.
- Fix typos in XA_DATALOCATOR_ANDROIDFD and XA_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE.

Change-Id: I3f3c604dfda3cf66ef7d7adc8689564a83623b2f
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
d158d31a6bbb06426b71c3d097b7768bc3fb79a3 04-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 TS streaming over SLAndroidBufferQueueItf

Modify the SLAndroidBufferQueueItf interface to offer a model
where buffers of data can be queued along with commands
(messages) when used for playback, or buffers of data can be
received along with metadata (messages)

changes:
- new callback and enqueue functions in SLAndroidBufferQueueItf
and XAAndroidBufferQueueItf.
- definition of a new struct, AdvancedBufferHeader, for
the buffers in the queue.
- decoupling of the "buffer available to be filled" from SF
and the call to the ABQ callback. Implemented in new
file AndroidBufferQueueSource.cpp
- source/sink checks and memory allocation when creating an
AudioPlayer or MediaPlayer that uses SLAndroidBufferQueueItf,
and verifying the data fed to the ABQ is declared as
SL_CONTAINERTYPE_MPEG_TS
- updated tests/native-media XA demo code, and
tests/sandbox/streamSource to use the new interface.

Change-Id: I48e44f346e718041d835fde51e349923fcc1f4b1
ndroidBufferQueueSource.cpp
ndroidBufferQueueSource.h
udioPlayer_to_android.cpp
udioPlayer_to_android.h
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
68d56b8ebaf60184a3aef988e3d2b09ed8b88c05 24-Feb-2011 Jean-Michel Trivi <jmtrivi@google.com> OpenMAX AL: consolidate MediaPlayer implementations under superclass

The OpenMAX AL MediaPlayer object has two implementations: one
for playing from URI/FD (LocAVPlayer) and one for playing from
AndroidBufferQueue (StreamPlayer). They both inherit from AVPlayer.
This CL makes LocAVPlayer and StreamPlayer inherit from
GenericMediaPlayer (new name of AVPlayer) which encapsulates the
interaction with an android::MediaPlayer instance running in
the media server process.
Also it makes GenericMediaPlayer inherit from GenericPlayer, the
player superclass also used in OpenSL ES.

After this CL, the OpenMAX AL and OpenSL ES have a common class
hierarchy for their players.

Change-Id: I5f6e279fc29b7f6f26c9ed5c83a9455cfda88ff4
udioPlayer_to_android.cpp
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
ndroid_AVPlayer.cpp
ndroid_AVPlayer.h
ndroid_GenericMediaPlayer.cpp
ndroid_GenericMediaPlayer.h
ndroid_LocAVPlayer.cpp
ndroid_LocAVPlayer.h
ndroid_SfPlayer.cpp
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
93ac9bd4f7722c50dc9882ff74bade233860a940 14-Feb-2011 Jean-Michel Trivi <jmtrivi@google.com> Report an error when the data source can't be created.

Check the value returned by DataSource::CreateFromURI(uri)

Change-Id: Ia94b18b09c68d1e8bf90d2f1a099319d5f5e565e
ndroid_AudioSfDecoder.cpp
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
udioPlayer_to_android.cpp
ndroid_AVPlayer.cpp
ndroid_AVPlayer.h
ndroid_AudioSfDecoder.cpp
ndroid_AudioSfDecoder.h
ndroid_AudioToCbRenderer.cpp
ndroid_AudioToCbRenderer.h
ndroid_GenericPlayer.cpp
ndroid_GenericPlayer.h
ndroid_SfPlayer.cpp
ndroid_SfPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
ndroid_defs.h
ndroid_prompts.h
4e1412ba1d9e74e51a01d34b1c588166d68e4332 25-Jan-2011 Glenn Kasten <gkasten@google.com> Bug 3388299 Fix stack buffer overrun

Change-Id: I22bf369b42faf04ef5bdc7ca8ebca3d31add2ad6
ndroid_Effect.cpp
bcc5c7225e3b7a1dbf2e9e830987f69167acf06f 18-Jan-2011 Glenn Kasten <gkasten@google.com> Rename class__ to clazz, this to thiz

The JNI naming conventions avoid conflict with C++ reserved words.

Change-Id: I93ad6920bf78c0a02ac4b2650a29c9e11252f731
ndroid_AVPlayer.cpp
ndroid_LocAVPlayer.cpp
ndroid_SfPlayer.cpp
ndroid_StreamPlayer.cpp
33381582280416166c8d0242deb8cdad7a5882dd 18-Jan-2011 Bryan Mawhinney <bryanmawhinney@google.com> Minor API change in NuCachedSource2

approxDataRemaining now returns more info about the stream status.

Change-Id: I5549edb3765eb07fcfa5340b8755263e0e0ee196
ndroid_SfPlayer.cpp
b2aeb0f1009555181dabb944fe05901cb6e6f632 12-Jan-2011 Jean-Michel Trivi <jmtrivi@google.com> More file renames and header inclusion reorder

More file renames and include reordering to separate Android
classes, and the mapping of the C OpenSL ES and OpenMAX AL
function calls to the Android implementation.

Change-Id: Id6f63af80bd581ed9cab495e2c11a86589ecf6c9
udioPlayer_to_android.cpp
udioPlayer_to_android.h
udioRecorder_to_android.cpp
udioRecorder_to_android.h
ediaPlayer_to_android.cpp
ediaPlayer_to_android.h
utputMix_to_android.cpp
utputMix_to_android.h
ndroid_AudioPlayer.cpp
ndroid_AudioPlayer.h
ndroid_AudioRecorder.cpp
ndroid_AudioRecorder.h
ndroid_OutputMix.cpp
ndroid_OutputMix.h
ndroid_Player.cpp
ndroid_Player.h
ndroid_defs.h
262059f71a68edc5e510427c63f5f1623d3672a8 12-Jan-2011 Glenn Kasten <gkasten@google.com> Directory re-organization

Change-Id: I8e3f12a22e765d36ddefd87edf204735b25474f6
ndroid_AVPlayer.cpp
ndroid_AVPlayer.h
ndroid_AudioPlayer.cpp
ndroid_AudioPlayer.h
ndroid_AudioRecorder.cpp
ndroid_AudioRecorder.h
ndroid_Effect.cpp
ndroid_Effect.h
ndroid_LocAVPlayer.cpp
ndroid_LocAVPlayer.h
ndroid_OutputMix.cpp
ndroid_OutputMix.h
ndroid_Player.cpp
ndroid_Player.h
ndroid_SfPlayer.cpp
ndroid_SfPlayer.h
ndroid_StreamPlayer.cpp
ndroid_StreamPlayer.h
ndroid_defs.h
ndroid_prompts.h
ndroid_sles_conversions.h