History log of /frameworks/wilhelm/src/android/android_StreamPlayer.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d2a31043966c76e4739bb325edcd5a475861a951 28-May-2015 Glenn Kasten <gkasten@google.com> Line length 100

Change-Id: I91c6231d22361361cda80d96c9d3ded5c93b6103
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
52e35b2c9f25450452ab422c46737a7fb5b67380 04-Mar-2015 Lajos Molnar <lajos@google.com> stagefright: make AMessage use handler vs handler-id

Bug: 19607784
Change-Id: I55accc49eec725ede0da3d1bfab448320fece926
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
3376429dfe306b9bfebf3a50941e2ccf44984495 18-Dec-2012 Glenn Kasten <gkasten@google.com> Remove unnecessary parameter

Just get the parameter on server side

Change-Id: Ief316b125a4c496f995520697c2b53a1c4ebc3bc
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
02a171afdb1a5198b22f38ed1b306bb8cc6e7043 30-Nov-2011 Jean-Michel Trivi <jmtrivi@google.com> resolved conflicts for merge of 2917f475 to master

Change-Id: I63f4689fabb2aee1682d785ad9c41f06de380396
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
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
f17145ab7ec3eda0c21aafd3b77e9bef97ee3d7c 09-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5578928 Fix race in stop for destroy" into ics-mr1
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.
8ab6c02fa1384397d24eb8c15029577b17ab7c71 07-Nov-2011 Glenn Kasten <gkasten@google.com> Bug 5578928 Fix race in stop for destroy

Change-Id: Ic5c84406bffa372a2fd3e92ad1aca1f6f5185026
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
e2e8fa36bd7448b59fbcdf141e0b6d21e5401d91 29-Jul-2011 Glenn Kasten <gkasten@google.com> Comments

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

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

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

Remove old asserts.

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

Change-Id: I95aa181f39b375087b30ac65fea37589108c9f16
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_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
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
251f90a1a07a721e873a5bfbee96a11cfc33b200 07-Sep-2011 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix 5249076 Don't let the shared memory buffer drain"
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
e52e877354b1477d5cb34d24c70417820b013521 01-Sep-2011 Dave Burke <daveburke@google.com> Require INTERNET permission for network-based content.
Bug #1870981

Change-Id: Ia7b9b75feb5b43fe9358bbbca6b619112984246c
/frameworks/wilhelm/src/android/android_StreamPlayer.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"
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
485a038f9f0f898227b8ab4218e94c5d56b6ed0b 24-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5193695 Fix crash after MediaPlayer destroyed

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

Change-Id: I5bd771d4d1936f433d2a8c9959593782c96daed9
Miscellaneous:
- added an explicit destructor on CMediaPlayer::mAVPlayer for consistency
(probably not a bug since there was a clear on it earlier)
- updated comments for CallbackProtector
- made some CallbackProtector fields private since no sub-classes yet
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
85edd878a30caa535b0267d8d6e61b4ccc0d5fd0 13-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5161265 Recover from mediaserver process crash

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

Miscellaneous:
- Remove unused field Parcel metadatafilter

Change-Id: I451a64bd76b4a7f157774abe967448ec081f1014
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
ecc4fe22e076c4e5c891d823b01db1a683ba6690 02-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5109153 Remove log spam

Change-Id: I6c0c742bfa3f0078968dc5e2ea3578ad786067c5
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
a8179ea15c4ff78db589d742b135649f0eda7ef2 13-Apr-2011 Glenn Kasten <gkasten@google.com> Fix build warnings caused by the 'long' change

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

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

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

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

Support for those features will be reintegrated in subsequent CLs.

Change-Id: I8d7f6ea006eb7b876ef1ca1909d74b4517335850
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
37dc2fccf3f122b79ebd554de209d0a3c94ae161 09-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 Implement streamInformation and volume in OpenMAX AL

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

Change-Id: I9f69f8cacbdce51b6d96d60141ec1d0f645df991
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
70c49ae2867094072a4365423417ea452bf82231 07-Mar-2011 Jean-Michel Trivi <jmtrivi@google.com> Bug 3329759 support commands in SLAndroidBufferQueueItf

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

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

Change-Id: I9bde97a6c6ffca7d376b4963313b820b35f50a26
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
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
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_StreamPlayer.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
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp
262059f71a68edc5e510427c63f5f1623d3672a8 12-Jan-2011 Glenn Kasten <gkasten@google.com> Directory re-organization

Change-Id: I8e3f12a22e765d36ddefd87edf204735b25474f6
/frameworks/wilhelm/src/android/android_StreamPlayer.cpp