nbaio is an acronym for "non-blocking audio I/O", and nblog means
"non-blocking logger" so nblog does not belong with nbaio.
There are a lot of improvements planned for nblog, and having the
restructuring done will make it clearer as more files are added.
Test: builds OK
Change-Id: Ib28bada2566c1d64bdbe9f5d7a5ce40e080178ef
This removes the manually rolled IPlayer implementation and instead uses
an aidl generated implementation. The IPlayer aidl file is moved from
frameworks/base/.
Test: run cts --module CtsMediaTestCases
Bug: 64223827
Change-Id: Ia609f7ba1cc6f71ce919d6174dd8b5e0e1b05575
- add HEIF support in MPEG4Extractor.
- decode HEIF image or tiled image in StagefrightMetadataRetriever's
getFrameAt() api and convert to requested color format.
bug: 64077740
Test: cts-tradefed run cts-dev --module CtsMediaTestCases --compatibility:module-arg CtsMediaTestCases:include-annotation:android.platform.test.annotations.RequiresDevice
Change-Id: Id4b26f1584ca6219073ffb0167f208e1c3bf8aa2
Every time merge is called by the thread loop,
the data is also processed and written to
PerformanceAnalysis. A call to dump retrieves
the FIFO of processed data in PerformanceAnalysis
instead of the unprocessed Reader FIFO, and prints
the result to the console.
Test: dumpsys media.log
Change-Id: Ic479f48e9e4fdf4523a8f15db514dbdd85b70434
Because DRM Plugins will not be allowed to call the AMI API under
Treble, the mediadrmservice will need to marshal the metrics out of the
plugin in protobuf format and report them to the AMI API instead. This
patch implements the pulling and interpreting of metrics from DRM
Plugins.
Bug: 36497276
Test: Played Google Play Movies, verified that playback still worked and
Widevine metrics appeared in a dump of the system media metrics.
Change-Id: If07717c1b87022bc1fcdedfbc62b9193899742d5
Implement correct indication of client UID and PID to audio flinger
for AAudio MMAP streams in both exclusive mode and shared mode.
- Add start/stop client methods on MMAP streams used only when the MMAP
stream is in AAudio service and carries a mix of shared streams.
- Add "In Service'" indication from "client" side to AAudioServiceStreamMMAP
so that the behavior can be adapted accordingly.
- Modify logic on audio flinger side with regard to mmap tracks and
audio HAL stream activity:
- use same audio session for all clients on a same stream to match
audio policy logic to share same direct output stream for clients on same
session. This is also more consistent with current volume and effect
handling as all MMAP clients sharing the same output stream have the
same volume and use case.
- start/stop the HAL when the stream is started/stopped with the initial client
handle (returned when the stream is opened) but do not create a track.
AAudioService implementation will always send an additional start command before
first client starts and a stop command after last client stops,
in both shared and exclusive mode.
- start/stop a track only if the start/stop stream command is received
with a handle different from the initial handle.
- Allow more than one active client from the same UID on a MMAP input in audio policy.
Bug: 62950008
Test: verify playback and capture in mmap mode
Change-Id: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
When the vndk is enabled (BOARD_VNDK_VERSION=current),
vendor libraries must only link against vendor variants
in the build system. This also means that they receive restricted
sets of headers and that automatic global headers are restricted.
Test: mma -j BOARD_VNDK_VERSION=current
Test: boots device, audio plays over YouTube
Bug: 37342627
Bug: 63269228
Change-Id: Ifa9c96f6b98b456def485be6bc5046ee54c3c3ca
* Owners are selected from top CL approvals or owners.
They will be suggested to review/approve future CLs.
* OWNERS files are recognized by the new find-owners plugin, see .md files in
https://gerrit.googlesource.com/plugins/find-owners/+/master/src/main/resources/Documentation/
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I7c848855a2d7a0d7f33123ea4ef5c2d03977b495
libstagefright_foundation_vendor is a vendor-only variant of the
libstagefright_foundation. Vendor libs and other VNDK libs should link
against this _vendor.so library. This vendor-only variant does not have
dependency to libpowermanager which is not available to vendors.
Headers are moved from the global include dir to module-local include
dir. This is because global include dir (e.g. frameworks/av/include) is
not provided when building with BOARD_VNDK_VERSION=current. Instead the
headers are exported via the module's export_include_dirs directive.
Short summary on the directory movement:
"some" libstagefright headers are moved from libstagefright/include to
libstagefright/include/media/stagefright. This is because the headers
are included as <media/stagefright/HEADER_NAME,h>.
libstagefrigut_foundation headers are moved from
libstagefright/include/foundation to
libstagefright/foundation/include/media/stagefright/foundation. Again
this is because the headers are included as
<media/stagefright/foundation/HEADER_NAME.h>.
Furthermore, in order to prevent sudden breakage, symlinks to the
module-local header directories are added to the global include
directory.
frameworks/av/include/media/stagefright ->
<libstagefright>/include/media/stagefright
frameworks/av/include/media/stagefright/foundation ->
<libstagefright_foundation>/include/media/stagefright/foundation
Bug: 37462569
Test: sailfish builds and boots
Test: BOARD_VNDK_VERSION=current m libstagefright_foundation_vendor is
successful
Change-Id: Iadfa594e885e0bd39837ccb282993d3ba5b62852
1) Limit number of VolumeShapers that can be created.
a) 16 system VolumeShapers
b) 16 application/client VolumeShapers
2) Return proper volume before VolumeShaper is started.
3) Consistent xOffset definition used internally:
a) this is now always the position on the volumeshaper curve
which can go backwards if in REVERSE.
b) normalized time is always forward going and is scaled
to 0.f and 1.f depending on progress relative to
the curve's duration.
4) Fix replace method.
5) Add comments.
Test: Use updated CTS VolumeShaperTest
Bug: 37536598
Change-Id: I837ab2a481adc0abbd3f1338bfe2cb79831b11fa
hardware/qcom/display includes frameworks/av/include headers
while compiling with -Wextra. Fix warnings that were hidden
by -isystem.
Bug: 31751828
Test: lunch bullhead-userdebug && m -j checkbuild
Change-Id: Ib1ee7165882ff3cc1d85c123815604079483f725
Move libmediandk and libcamera2ndk headers into their module
and export them from there. Also move them to the same path
relative to the export as used in the NDK, media/ for
libmediandk and camera/ for libcamera2ndk.
Test: builds
Change-Id: I0b424e0e48bfb5e2b762694a97d799de08f5dda3
Merged-In: I0b424e0e48bfb5e2b762694a97d799de08f5dda3
(cherry picked from commit 7e8d4ba588)
Move libmediandk and libcamera2ndk headers into their module
and export them from there. Also move them to the same path
relative to the export as used in the NDK, media/ for
libmediandk and camera/ for libcamera2ndk.
Test: builds
Change-Id: I0b424e0e48bfb5e2b762694a97d799de08f5dda3
(cherry picked from commit 7e8d4ba588)
Move libmediandk and libcamera2ndk headers into their module
and export them from there. Also move them to the same path
relative to the export as used in the NDK, media/ for
libmediandk and camera/ for libcamera2ndk.
Test: builds
Change-Id: I0b424e0e48bfb5e2b762694a97d799de08f5dda3
hardware/qcom/display includes frameworks/av/include headers
while compiling with -Wextra. Fix warnings that were hidden
by -isystem.
Bug: 31751828
Test: lunch bullhead-userdebug && m -j checkbuild
Change-Id: Ib1ee7165882ff3cc1d85c123815604079483f725
(cherry picked from commit 27d3c6a329)
Functions in headers that are not static inline will cause duplicate
symbol errors when linking if the header is ever included twice
into different compilation units of the same module. It also causes
-Wunused-function warnings if they are not used in the cpp file, which
were hidden by the use of -isystem frameworks/av/include.
Bug: 31751828
Test: m -j checkbuild
Change-Id: I36f258bb4f5c3df54e874280beab344e63c519d5
Merged-In: I36f258bb4f5c3df54e874280beab344e63c519d5
(cherry picked from commit 413adafb04)
Fix the trivial warnings that are hidden by the use of -isystem to
include frameworks/av and caught by -Werror.
Test: m -j checkbuild
Bug: 31751828
Change-Id: I155f9f772ce0a84b364313814cb7cf528b9de4eb
Merged-In: I155f9f772ce0a84b364313814cb7cf528b9de4eb
(cherry picked from commit b8c35f9447)
These warnings were hidden by -isystem.
Bug: 31751828
Test: m -j checkbuild
Change-Id: Ibb1aa07a6827fcbd29fc15291fcd90280c0f608d
Merged-In: Ibb1aa07a6827fcbd29fc15291fcd90280c0f608d
(cherry picked from commit 6f51c153ea)
A method named dump() is already exported by Binder. The warnings
were hidden by the use of -isystem to include frameworks/av/include.
Bug: 31751828
Test: m -j checkbuild
Change-Id: If460a6efc7c7b108243c3ef068c28619482f599d
Merged-In: If460a6efc7c7b108243c3ef068c28619482f599d
(cherry picked from commit f461f38e08)
One version of the CHECK_* macros are defined by
android-base/logging.h, and another by ADebug.h. Eventually
the ADebug.h ones should be replaced with the libbase ones, but
that ripples out into a long dependency chain that needs to link
against libbase. The redefined macro warnings were hidden by the
use of -isystem to include frameworks/av/include. Hack around it
for now by undefining the libbase ones if they exist.
Bug: 31751828
Bug: 37782039
Test: m -j checkbuild
Change-Id: Ifabff1c2bc6bac198804c951e98f3fee282cd018
Merged-In: Ifabff1c2bc6bac198804c951e98f3fee282cd018
(cherry picked from commit 1b1686db53)
Fix the trivial warnings that are hidden by the use of -isystem to
include frameworks/av and caught by -Werror.
Test: m -j checkbuild
Bug: 31751828
Change-Id: I155f9f772ce0a84b364313814cb7cf528b9de4eb
Merged-In: I155f9f772ce0a84b364313814cb7cf528b9de4eb
(cherry picked from commit b8c35f9447)
These warnings were hidden by -isystem.
Bug: 31751828
Test: m -j checkbuild
Change-Id: Ibb1aa07a6827fcbd29fc15291fcd90280c0f608d
Merged-In: Ibb1aa07a6827fcbd29fc15291fcd90280c0f608d
(cherry picked from commit 6f51c153ea)
hardware/qcom/display includes frameworks/av/include headers
while compiling with -Wextra. Fix warnings that were hidden
by -isystem.
Bug: 31751828
Test: lunch bullhead-userdebug && m -j checkbuild
Change-Id: Ib1ee7165882ff3cc1d85c123815604079483f725
1/ Be more explicit about what usage/format combination is supported.
2/ Get rid of usage1 following the same change in AHardwareBuffer.
3/ No more gralloc1 usage, so don't call android_convertGralloc1To0Usage
anymore.
Bug: 35114769
Bug: 37097572
Test: Ran AImageReaderCts
Change-Id: Ic712d0ac5bd86b2c4c68815125ba9037212dfd65
Fix the trivial warnings that are hidden by the use of -isystem to
include frameworks/av and caught by -Werror.
Test: m -j checkbuild
Bug: 31751828
Change-Id: I155f9f772ce0a84b364313814cb7cf528b9de4eb
Consider whether VolumeShaper has been started or not when
restoring (position). If the VolumeShaper hasn't been started
we restore in that state. If it has been started already,
we advance to the end assuming the duration has been played out.
Test: CTS and headset / kill audioserver
Bug: 37536598
Change-Id: I4b55dca6f6a859563fd20bad4c8f67d2c92321c0
So MediaCodecSource could use the stopTimeOffset to adjust the stop timeout
dynamically.
Test: Camera recording with video stream delay.
Bug: 35925528
Change-Id: Ic186971992bdc03155e9993cb44027002f71a457
Test: Manual use of Camera, Movies, Photos and YouTube apps.
Test: With CtsMediaTestCases.apk installed,
adb shell am instrument -e size small -w
'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Bug: 37302530
Change-Id: Id0d4f7fed57349a2f5484f6b6264981471e8f022
In preparation for moving libcamera_client to Soong, this is a backport
of the camera portion of the change to move headers from include/ into
the appropriate directories.
include/camera -> camera/include/camera
Adds a symlink from the old location to the new one.
Bug: 33241851
Test: mmma -j frameworks/av/camera
Change-Id: Ic508c2d0100f4e84b63e745d50eca1402b6fed6c
(cherry picked from commit d008fd1e4f)
Also had to fix the location and symlink of them.
Test: works with BOARD_VNDK_VERSION := current
Bug: 33241851
Change-Id: Idcfe1eaaf7be10a183b69bafa07f035ab9ca1e4e
Combine the two openSession methods into one that doesn't take any
arguments. This gives the client more flexibility on creating
sessions efficiently. They can better decide whether to share one
session for multiple streams, or create one session per stream.
bug: 22804304
Change-Id: I9634f4dd4fc437229068103b54555cc28a818937
Test: Media post-submit tests on Pixel phone.
Test: Manual use of Camera, Photos, Play Movies and YouTube apps.
Bug: 36952714
Change-Id: I230df51c2d658e29cffec369ba622e336c3402d2
- Set crypto mode to kMode_AES_CTR, since kMode_AES_CBC is not defined
on Java API, and is rejected when the sample is queued to MediaCodec.
- Wrap the plugin object in a RefBase, and hold a strong ref to it
when executing any API calls in CasImpl. This is needed because
CasImpl could be released by Java API, while MediaCodec native is
still trying to access it.
- Fix build warnings.
Tests: cts-tradefed run cts-dev --module CtsMediaTestCases --test android.media.cts.ClearKeySystemTest
It should not fail.
bug: 22804304
Change-Id: Id4ef037d57dd741d2bb22b1de3d04c8d078b69fb
Changes for the new HAL structure have brought about a build time
circular dependency between libmedia and libmediadrm. This set of
changes the media metrics code into its own library and arranges
for the relevant consumers of the media metrics code to link
to this new library (where they had previously picked it up by
including libmedia).
Bug: 36990807
Test: build, boot.
Change-Id: I81768eecca88d5e59e6e6e547f29308a94e30c7b
The header comment says that the default URL is returned, but it
is not. The comment has been corrected.
bug:35257669
Change-Id: Ica6c60382f68d8a70aeab8959eb29cf454ff931b
We are ready for devices to begin migrating to a 64-bit Media DRM
Server. However, not all devices are ready to make this jump yet. A
device needs to have all of its DRM Plugins ready to run as 64-bit
before it can do this. This includes having 64-bit hardware
integrations.
So that devices can turn on 64-bit support as they get ready, I am
adding flags that can be set in a device's device.mk file. There are two
parts:
* ENABLE_MEDIADRM_64 enables building the mediadrmserver as 64-bit.
* Setting drm.64bit.enabled=true in PRODUCT_PROPERTY_OVERRIDES switches
mediadrmserver to searching for DRM Plugins in the 64-bit directory.
Test: Validated that turning on these flags enables a 64-bit
mediadrmserver that loads 64-bit DRM Plugins from the lib64
directory (after setting DISABLE_TREBLE_DRM to true to load this
code as opposed to the Legacy DRM Plugin HAL)
Bug: 36076017
Change-Id: I141cfd57ff75b40c8b0cb40a5bf1439a1ab5b766
This introduces new API that allows AHardwareBuffer access via
AImage/AImageReader.
Bug: 35114769
Test: Build (should have no functional change from headers change), and
existing CTS tests run using cts-tradefed on a Pixel.
Change-Id: I7b6505ca3b9489d86eb564d1ae5707fd3fa25668
Add setParameters to communicate parameter changes when the codec
is in running state.
Bug: 32746065
Change-Id: I223041bebadedfb09848315a360b5efaae451c14
Expose createPersistentInputSurface() and setInputSurface via
NDK-mediaCodec to enable native encoder apps to record from a
persistent input surface.
Bug: 32746065
Change-Id: Ia152f43dacfe376a89c550ecbeaf6d4016ec07b5
Expose createInputSurface() via NDK-mediaCodec to enable native
encoder apps to record from an input surface.
Bug: 32746065
Change-Id: I654f2c0deadb336d492cdd6ba290e09c8996ce40
Also, merge android.hardware.media.omx@1.0-impl into libstagefright_omx.
Test: With CtsMediaTestCases.apk installed,
adb shell am instrument -e size small -w
'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Manual use of Camera, Photos, Play Movies and YouTube apps.
Test: Manual use of screen mirroring.
Bug: 33854657
Change-Id: Ie927bcafd86dc7e9509bb8b76bb3b51f9a423cc7
1/ Use BufferItemConsumer instead of CpuConsumer for AImageReader.
2/ Delay lock image in AImage until the first time getPlaneXXX functions
get called.
3/ Add libmedia_jni as dependency so that we can reuse existing code
from android_media_Utils.h
Bug: 35114769
Test: Ran the following CTS test case from CtsCameraTestCases:
NativeCameraDeviceTest, NativeCameraManagerTest,
NativeImageReaderTest, NativeStillCaptureTest
Change-Id: Ia8dc451ea873e8290592deacc7f8d40360382f86
As we are adding AHardwareBuffer access through AImage and AImageReader,
we now need buffer formats used by GL/Vulkan.
Bug: 35114769
Test: Built system and ran native camera cts
Change-Id: I4157c933b411ab597799c933d18fc78ad3323eb5
(cherry picked from commit de2a544846)
As we are adding AHardwareBuffer access through AImage and AImageReader,
we now need buffer formats used by GL/Vulkan.
Bug: 35114769
Test: Built system and ran native camera cts
Change-Id: I4157c933b411ab597799c933d18fc78ad3323eb5
include/camera -> camera/include/camera
include/media/audiohal -> media/libaudiohal/include
include/media/AudioResampler*.h -> media/libaudioprocessing/include
include/media/Audio*.h,IAudio*.h,IEffect*.h,ToneGenerator.h -> media/libaudioclient/include
include/media/EffectsFactoryApi.h -> media/libeffects/include
include/media/stagefright -> media/libstagefright/include
include/media/nbaio -> media/libnbaio/include
include/media/<rest of files> -> media/libmedia/include
include/cpustats -> media/libcpustats/include/cpustats
Added symlinks from old location to new ones
Bug: 33241851
Test: VNDK linked modules will need to add explicit lib dep.
All other modules should compile the same
Change-Id: I0ecf754a2132640ae781a3cc31428fb8c0bd1669
The initial drm hidl hal implementation assumed one
codec per crypto instance, but in fact there can be
multiple codecs per crypto instance. This change
extends the drm hal to allow multiple memory heaps
per crypto plugin. It fixes the issue of mapping
memory frequently during playback.
bug:35275191
Test: manual verification with Play Movies on angler
in passthrough mode and on marlin in binderized mode.
Change-Id: Icada005f515483d7bc214b08caf6eea46ca354a7
A lot of media makefiles didn’t specify libui or
libgui but included headers from these libraries
directly.
It works because these headers are on the global
include path. With this change, though, rect.h
is not anymore (albeit exported from libui).
Test: built and booted device
Bug: 35164655
Change-Id: I72e8f0b7bd25c6a67eedc17afe52c4c484a147fe
android.hidl.memory is being split into android.hidl.memory and
android.hidl.allocator since the former is a passthrough hal and the
latter is a binderized service.
Bug: 35327976
Test: hidl_test, lshal, youtube/camera works
Change-Id: I7a2e72dcd3721d2689eb7ef95f5b140ecc1c446f
Process all buffers that have been queued to the encoder on
StagefrightRecorder::pause()/stop(). Furthermore, add timestamp support for
pause/stop. Buffers willi keep getting encoded until 1) a buffer with a higher
timestamp is queued, or 2) the bufferqueue is abandoned by the producer.
Test: Recording with hacking GoogleCamera timestamp. And Mediarecorder CTS test.
Bug:32765698
Change-Id: I9ec33d635aef269836d7a5d9f4b906cb41b46a0d
1. Toggling between Treble and non-Treble OMX will now be controlled by
two properties: "persist.hal.binderization" and
"persist.media.treble_omx". (Before this CL, this was controlled by
"debug.treble_omx".)
- If persist.media.treble_omx is not set, it will assume a default value
of -1.
- If persist.media.treble_omx is -1, persist.hal.binderization will be
used to determine whether OMX will be created as a Treble or non-Treble
service.
- If persist.media.treble_omx is 1, OMX will be created as a Treble
service.
- If persist.media.treble_omx has any other value, OMX will be created
as a non-Treble service.
- persist.media.treble_omx can be changed without rebooting, but it will
only take effect after media.codec and mediaserver processes are killed.
2. Remove all dependencies on non-Treble service. This was not done for
MediaCodec, MediaPlayerService::Client, MediaRecorderClient, stagefright
command, and omx_tests command. OMXClient and media.codec process will
now pick the right version of OMX based on properties mentioned above.
Before this CL, media.codec would always present the non-Treble version
of OMX regardless of the flag.
3. Provide workarounds for some HIDL issues.
- A sequence of nested binder and hwbinder calls require many threads to
handle. (b/35283480) The workaround is to increase the number of threads
in the thread pool of media.codec process.
- android.hidl.base@1.0::IBase::unlinkToDeath takes a strong pointer
instead of a weak pointer. (b/35233970) This causes an infinite
recursion in the destructor of ServiceDeathNotifier in
MediaPlayerService::Client and MediaRecorderClient. The workaround moves
calls to unlinkToDeath() outside of the destructor.
Test: Recorded and played videos with Camera app. Ran stagefright and
omx_tests commands.
Bug: 31399200
Change-Id: Id1940ed982838e10bf10fe8ed5b7bb912a5a2d3a
underlying collection of MediaRecorder metrics for getMetrics() API
and for media metrics cloud analysis.
Bug: 35150984
Test: hacked CTS, observation of 'dumpsys media.metrics'
Change-Id: Ife2ab06158b0015549ed17d52d7f4c35781f5e0f
The VolumeShaper is used to apply a volume
envelope to an AudioTrack or a MediaPlayer.
Test: CTS
Bug: 30920125
Bug: 31015569
Change-Id: I42e2f13bd6879299dc780e60d143c2d465483a44
If two application are playing a compatible offload stream at the same
time.
Eg: two games playing MP3. At least one not taking the audio
focus.
The audio policy was offloading both stream resulting in audio glitches
and one stream being dropped.
Concurrent offload streams is intended to be a transitioning state when
an application wants back to back playbacks.
It should not be allowed for two different applications to stream at the
same time.
Test: Play mp3 while mp3 is already offloaded.
Bug: 34012147
Change-Id: I98a8913d6faf5092a1e43a0bdd0f1ce1482221a9
Signed-off-by: Kevin Rocard <krocard@google.com>
plumbing so that user level android.media.MediaExtractor.getMetrics()
will get down to where we keep the metrics and then haul them back
to the application. Includes the right hooks so that per-container-type
metrics will also be managed.
Bug: 35094936
Test: monitor dumpsys output, augmented CTS examination
If the server dies, the binder death callback clears out
the global camera service sp<>, and any current references to it
will become quite unhappy.
Test: Camera CTS passes
Bug: 31992879
Change-Id: I2966bed35d0319e3f26e3d4b1b8dc08006a22348
ACodec will connect to the Treble version of Omx if the property
"debug.treble_omx" is set to true ("1", "y", "yes", "true" or "on").
Also, fix some bugs found so far.
Test: Compiles
Bug: 31399200
Change-Id: I52b27b5f99bc1d6797d3b83b8be794ed2de9956a