History log of /frameworks/wilhelm/src/itf/IEngine.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a80a6ff9a1f80792478c9d43578afa24a07eb2f0 04-Jun-2015 Glenn Kasten <gkasten@google.com> Only allow native byte ordering

Change-Id: Iebe0a9df03b988d84253aa74f6ef8392b337967c
/frameworks/wilhelm/src/itf/IEngine.c
904b880cdd214729d04b2cbd374287c3bb6c6606 30-May-2015 Glenn Kasten <gkasten@google.com> Merge "Rename checkSourceSinkSupport to checkSourceSink" into mnc-dev
ac28eca1df49f581d952ffbda5d3019f7e3b7be6 29-May-2015 Glenn Kasten <gkasten@google.com> Whitespace

Change-Id: Ie9fa59703d90fa0a6d4b83d6d5bd637f53d4058c
/frameworks/wilhelm/src/itf/IEngine.c
00a66a027199238a93b2aa9056af126efc09fe38 28-May-2015 Glenn Kasten <gkasten@google.com> Rename checkSourceSinkSupport to checkSourceSink

to match similar code in AudioPlayer

Change-Id: Ib5d4a23dae6e572e26241dc4c747aa0c72e6af8f
/frameworks/wilhelm/src/itf/IEngine.c
64c3fe7bd86951eeac27adca2219ce16eabff58c 28-May-2015 Glenn Kasten <gkasten@google.com> Whitespace

Change-Id: I666963a80530aceec9f47e625018844daf29c017
/frameworks/wilhelm/src/itf/IEngine.c
460bdad43aaec3c6ffe7f259719e00807742ad6d 24-Apr-2014 Glenn Kasten <gkasten@google.com> Audio recorder missing a callback protector

Bug: 14291968
Change-Id: I620d5e82f58e57e87097984a649b5c3a25c42963
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
e5ede1a139fcedbf075675179d919fbe731898f0 13-Jun-2013 Glenn Kasten <gkasten@google.com> AudioRecord must be used as sp<> only

Bug: 9423855
Change-Id: Icc37559082f6c6c7052ac03a835a3d2c6732af59
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
1f20e5c4db4c920bbe7b9e6cd6390ed8df64be9a 29-Nov-2011 Glenn Kasten <gkasten@google.com> Merge "Remove AudioTrackProxy since AudioTrack is RefBase"
ae1a5c8dc1fccf7c121eda830f8d23bd094c0f16 15-Nov-2011 Glenn Kasten <gkasten@google.com> Remove AudioTrackProxy since AudioTrack is RefBase

Change-Id: I4a1f755178699e0fdedf58e1f3cbd82e6067e071
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
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/itf/IEngine.c
05c7b2d09d54b9260ff7f3f5e491f38d0097c406 21-Sep-2011 Glenn Kasten <gkasten@google.com> Bug 5369977 check required interface compatibility

Use required not exposed in checkSourceSinkVsInterfacesCompatibility.

Change-Id: Ib71826b989ddef2e87dd60bec0306ca2a4021fe3
/frameworks/wilhelm/src/itf/IEngine.c
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/itf/IEngine.c
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/itf/IEngine.c
2bb3547351a40ad394b09babec4d2fcc233bfe2e 22-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5198051 Video sink on MediaPlayer is optional

Change-Id: I2c78508fa1efac765ff5812c22e3a4c2cfc33b73
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
e51d469aa14fa9ae94bddc31ae6aab59e41a48ca 03-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5108531 Report the correct API level"
f152bc273bc3f8471bca626fe9cc966dad304173 02-Aug-2011 Glenn Kasten <gkasten@google.com> Merge "Bug 5080320 MediaPlayer volume"
4076e5009bfe70bc06a78f5aafec77af6c03201d 02-Aug-2011 Glenn Kasten <gkasten@google.com> Bug 5108531 Report the correct API level

Use build macro PLATFORM_SDK_VERSION to automatically update the reported
value, however the test program will still need manual updates.

Change-Id: Iae044605db65021c7d1e9825aab80ab5d6b552a8
/frameworks/wilhelm/src/itf/IEngine.c
99b927751677abfb60a388d65dfeed1fed1db12c 28-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5080320 MediaPlayer volume

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

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

Change-Id: Ic0f2297b267dc3d380755e8d314e1d5f0f659d7c
/frameworks/wilhelm/src/itf/IEngine.c
e878c470cf58c8654d613ab2449468b44a90d6e5 27-Jul-2011 Glenn Kasten <gkasten@google.com> Bug 5082191 fix slesTest_decodeToBuffQueue assert

Change-Id: I2ec181cc7eba000847bd28e6d04733d3496d74d9
/frameworks/wilhelm/src/itf/IEngine.c
71139e6bc1f077d285fb04629925d99383d1114f 07-Jul-2011 Glenn Kasten <gkasten@google.com> Make it build again on non-Android

Fix warning about unused variable.
Remove spurious include.
Fix warning about printf format type mismatch.

Change-Id: Ibeeb33a55175e0ec1e5210211d8844df0bbe3bca
/frameworks/wilhelm/src/itf/IEngine.c
1a9c2615d0933d183fcb1b9e34ec8f0da2a85153 07-Jul-2011 Glenn Kasten <gkasten@google.com> Rename ANDROID_UNKNOWN_* to UNKNOWN_*

Change-Id: I0d92b7d943690d9af7e08c400471f8b474728bff
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
7965455f86c21d6e1f788b284f5fc829e82ff2b5 14-Jun-2011 Glenn Kasten <gkasten@google.com> Bug 4606138

Change-Id: If4745ee39eeedf11388800cc30c26e4c4f8ddaa0
/frameworks/wilhelm/src/itf/IEngine.c
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>
/frameworks/wilhelm/src/itf/IEngine.c
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>
/frameworks/wilhelm/src/itf/IEngine.c
f6c0c2346b2ca1ac01c2d68a2cd2a7f1d9ff3427 06-Apr-2011 Glenn Kasten <gkasten@google.com> Fix build on non-Android platform

Change-Id: I85b25467ac5bae45b12ec5b0abfb4696449c2da8
/frameworks/wilhelm/src/itf/IEngine.c
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/itf/IEngine.c
faea005a67ba7e75faea571c521ad2e44fe3dc27 05-Apr-2011 Glenn Kasten <gkasten@google.com> Fix bug in last commit

Always read the documentation:
- Add hooks for new OpenMAX AL interfaces
- Since OpenSL ES engine interface has a deinit hook, add one for OpenMAX AL also

Change-Id: I266bf2112e6f8e525e5b3c06bbb6a68a4764e978
/frameworks/wilhelm/src/itf/IEngine.c
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
/frameworks/wilhelm/src/itf/IEngine.c
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/itf/IEngine.c
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/itf/IEngine.c
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/itf/IEngine.c
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/itf/IEngine.c
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/itf/IEngine.c
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/itf/IEngine.c
2d427f091ef1cf6c1694e3ee5f3521166502a7b1 19-Jan-2011 Glenn Kasten <gkasten@google.com> am 50bccde0: Rename class__ to clazz, this to thiz

* commit '50bccde01980ae803b8656e8b08ecacb65540f50':
Rename class__ to clazz, this to thiz
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/itf/IEngine.c
105e1b828063c07e000e642d225881bdcd93f4de 13-Jan-2011 Glenn Kasten <gkasten@google.com> Update SDK level on master branch only

Change-Id: I15f5976ba656673112f2d1ab006fe417a4fccd22
/frameworks/wilhelm/src/itf/IEngine.c
262059f71a68edc5e510427c63f5f1623d3672a8 12-Jan-2011 Glenn Kasten <gkasten@google.com> Directory re-organization

Change-Id: I8e3f12a22e765d36ddefd87edf204735b25474f6
/frameworks/wilhelm/src/itf/IEngine.c