IMPORTANT NOTE:
CL depends on another CL in frameworks/base
https://partner-android-review.googlesource.com/c/platform/frameworks/base/+/1206275
AudioProductStrategies offers the possibility to dynamically
translate attributes to stream types (and vice versa) within
audio policy engine.
Legacy engine has hard coded rules to maintain the translation
service.
This patch removes the hardcoded translation within the helper
and replaces them by AudioProductStrategy APIs.
Test: AudioPolicyTests: AudioProductStrategiesAllStreamsTest
It loops on all stream types supported by strategy and ensures
device selection matches. Hard coded stuff would prevent right device
selection.
Test: CTS: AudioTrackTest AudioRecordTest
Test: audio smoke test on sailfish, walleye blueline
Change-Id: I76589df5555136ed49dbacc7aac9b0b5e828bef2
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
This CL adds required introspection APIs to deal with product strategies:
-getter of the collection of product strategies
-helper function to return the strategy associated to a given attributes.
This API is mandatory to avoid duplicating the logic that compiles the strategy
for a given Audio Attributes structure.
Test: make
Change-Id: I0e107570a44227bb52a4f359954c93215d4f8bae
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
-Adds new Engine APIs for Product Strategy management
-Adds a common engine code to handle product strategies
-Adds a parsing configuration library to feed the strategies
-Prepare both engine for the switch
Test: make
Change-Id: I00f57ece798893bc6f9aa9ed54a3e5237e8d5cf1
Move DataSourceBase and MediaSource to libstagefright, and
MediaBuffer, MediaBufferGroup and MetaData to libstagefright_foundation.
Test: build
Change-Id: I4f0ae01d40a32f4b773a2f74d5f2ae136e375322
Make each extractor plugin export a list of file types it supports,
so we no longer need to hardcode such a list in the framework.
Test: manual
Change-Id: I1e41a5d477ea56960ad3e4bc35f5183c03c3fe3a
Remove support for intermediate extractor format versions
and leave only the 'V3' format, but remove 'V3' from the
names of the classes and structs involved, and reset the
version number back to 2 (version 1 is the C++ interface
shipped in P, which is no longer supported).
Bug: 111407253
Test: build
Change-Id: I702080e6bbfbac265967a93945ee97191d463125
C interface is more stable across upgrades than C++
and simplifies cross-package interfaces in upgradeable components.
Bug: 119675363
Test: parallel metrics generation from nuplayer
Change-Id: I36beeade82a208be64af0860eb6f175a2801b27f
Support secondary plugin API that uses AMediaFormat so plugins can be gradually
changed over to it.
Bug: 111407253
Test: CTS, manual
Change-Id: I25de3cb9463ca3b91370cecd16c80915d6407daf
Also move NdkMediaFormat internals to libmedia to avoid a future circular
dependency between libmedia and libmediandk.
Bug: 111407253
Test: build, boot, play some files
Change-Id: I54d91439f216c3834726e5505afef40dc0d93e67
It is no longer needed in libmediaextractor, and moving it back
to libstagefright will avoid a circular dependency later.
Bug: 111407253
Test: build, boot, play some files
Change-Id: I1373a9eedee27998e7733ea23ae1a375e45cc9c3
Add a C API for DataSource/Base, and a helper so extractors
can continue using a C++ API.
Bug: 111407253
Test: build, boot, play some files
Change-Id: I1c8b2990e17d18eee53c9abf7ebef2ced0e8b7fd
Define a C extractor plugin API, along with some helpers
so extractors can still be implemented in C++ if desired.
Bug: 111407253
Test: build, boot, play some files
Change-Id: Iba947381441769d77929b4235cdb4a4cd5d4f606
Add event logging in case of audioserver watchdog to help
collect statistics.
Test: make. Simulate watchdog and check events in logcat.
Change-Id: I4716852c77d56703ad5f3dfc2500f598a2b80a12
Allows common use for latency computation.
Implementation for AudioRecordServerProxy added.
Test: audio sanity, subsequent latency tests
Bug: 80447764
Change-Id: Ib53181cdced16606bf268769a04bd52c689d89d3
Replaces main and aux buf from track dump.
Bug: 80272001
Test: adb shell dumpsys media.audio_flinger
Change-Id: I5d6565410e652ec7fc6701b171d299dea9f7bc3e
Add an api to IMediaMetadataRetriever to decode image rect.
It will reuse the same full frame IMemory, and decode only
the requested rect. For now, StagefrightMetadataRetriever
will only allow decoding of rect that's a full row of tiles,
and the requested must be issued sequentially (i.e. no
arbitrary rects). When the extract side is fixed to allow
seeking by tiles, it can be extended to allow arbitrary
rects.
This allows HeifDecoderImpl (on client side) to start
processing the getScanlines in parallel with the decoding.
Test: CTS MediaMetadataRetrieverTest;
Manual testing of HEIF decoding of files with or without tiles;
Manual testing of HEIF thumbnails generation in Downloads app.
bug: 78475896
Change-Id: I820b21cdf33f80593ee6092d8e1ba68b3beb65dd
When extracting bitmaps, MediaMetadataRetriever does a copy from
StagefrightMetadataRetriever's VideoFrame to IMemory. We could
just allocate IMemory directly and return that to the client.
bug: 78475896
Change-Id: Ibe07e7d2c68f031261470308476089c2fa9298ea
Implement silencing of audio capture for idle UIDs for
MMAP streams.
Use audio HAL setMicGain() API to silence the mmap buffer for
exclusive mode and when only one client is active in shared mode.
Add new MmapStreamCallback method onStreamSilenced() for AAudio
service to selectively silence streams from silenced UIDs in
shared mode.
Bug: 72134552
Test: manual
Change-Id: I7c92ba0002bc5ba003c1a3c887edddf9ae53b538
Prior to this CL, if an AudioTrack client wrote audio data after
AudioTrack stop(), but before the track was drained by the server,
the newly written client data would be consumed in the drain.
We now limit the server read to the client write position on stop.
This interlocking is essential for rapid asynchronous AudioTrack
command processing.
Test: AudioTrack CTS, SoundPool looping, bug test case
Bug: 75788313
Change-Id: Ib70e3dc46afe047a8c6cf1fb906a618b3c66cc7f
Add a mechanism to monitor execution time of incoming binder
calls to audio flinger and audio policy and cause native audioserver
restart in case of timeout.
Bug: 69250055
Test: manual. audio smoke tests
Change-Id: I01b5bf2599fb2a4cd265cbbe8d4e34b2b059aaf4
- Add MetaDataBase base class that MetaData derives from, but which
does not derive from RefBase.
- MediaBuffer::meta_data() now returns a MetaDataBase& rather than an
sp<MetaData>
- Rename MediaSourceBase to MediaTrack.
- MediaSource no longer derives from MediaSourceBase (or MediaTrack)
- MediaTrack::getFormat(), MediaExtractor::getTrackMetaData() and
MediaExtractor::getMetaData() all take a MetaDataBase& parameter that
they fill out, rather than returning a MetaData directly (the
corresponding methods on MediaSource and RemoteMediaExtractor continue
to return MetaData)
Bug: 67908544
Test: CTS MediaPlayerTest, DecoderTest, EncodeDecodeTest, manually record video
Change-Id: Ib531ab309061290be33d40d6100c9a8127e22083