Ignore releaseBuffer() if it is for a different IAudioTrack than was
used for obtainBuffer().
Bug: 136268149
Test: at bug comments #32 and #45
Change-Id: I2e1955c60479edcba6e7d66c98b9faef088b65d9
Ignore releaseBuffer() if it is for a different IAudioRecord than was
used for obtainBuffer().
Bug: 136268149
Test: at bug comments #26 and #27
Change-Id: I2a08c30bf9187b35535318761eaac7856da68c11
Without trunksize as restriction, function parseClearEncryptedSized()
can read the rest of file. If the file has a large number of saiz trunk,
large number of bytes will be copied, which can lead to high cost of
CPU time.
Bug: 124777526
Test: please see #3 and #8 in bug report:
push senc.mp4 to devices's sdcard
open photo app
manuly print log
Change-Id: I854765c82d02d541b92f2658673aa4ce61fb5412
(cherry picked from commit aa15fefa185278a549fd72dd1b79ae73ca5e4436)
Among the many changes that went in as part of CL ag/9501009, reading empty edit list entry was
also added in MPEG4Extractor. Code modifications for seek functionality with the same is done
now.
Bug: 150956121
Test: atest android.media.cts.MediaMetadataRetrieverTest
atest android.media.cts.MediaMuxerTest
atest android.media.cts.MediaExtractorTest
atest android.media.cts.MediaRecorderTest
Change-Id: I3ec065f56259eaf1d923c6701713c6a445e4e2f4
Bug: 135515629
Test: set forceGoogleEncoder to true in VideoCodecTestBase.java
Test: atest android.media.cts.VideoCodecTes.testSyncFrameHEVCCBR
Change-Id: I869506d13d695b90a280d9bcd42c307043269b74
CHECK() for color format has been replaced with appropriate error
handling.
Bug: 117625412
Bug: 152070124
Test: stagefright -s -S /sdcard/cformat.webm
Test: stagefright -s -S /sdcard/crowd_640x360p50f32_frmPar_1x1.webm
Change-Id: I1fe0be54f9910fd98ff4db9240b4dcfd09888ffb
Merged-In: I1fe0be54f9910fd98ff4db9240b4dcfd09888ffb
Use media utility function limitProcessMemory().
Test: restrict mediametrics memory by property, ensure restart
Bug: 152084875
Change-Id: I20b51cecd67e9ac5e03ab34c1c68b1cfd0b8a964
Three properties are declared as vendor-init-settable:
ro.media.xml_variant.codecs
ro.media.xml_variant.codecs_performance
ro.media.xml_variant.profiles
media_codecs.xml can now be named
media_codecs${ro.media.xml_variant.codecs}.xml
media_codecs_performance.xml can now be named
media_codecs_performance${ro.media.xml_variant.codecs_performance}.xml
media_profiles_V1_0 can now be named
media_profiles${ro.media.xml_variant.profiles}.xml
Test: Rename "media_codecs.xml" to "media_codecs_test.xml",
set ro.media.xml_variant.codecs to "_test", then
call "stagefright -i".
Test: Rename "media_codecs_performance.xml" to
"media_codecs_performance_test.xml",
set ro.media.xml_variant.codecs_performance to "_test", then
run android.media.cts.VideoDecoderPerfTest.
Test: Rename "media_profiles_V1_0.xml" to "media_profiles_test.xml",
set ro.media.xml_variant.profiles to "_test", then
run vts_mediaProfiles_validate_test.
Bug: 142102953
Change-Id: I38fa2924e02363639d1cdc3dd85128e0652343ee
Merged-In: I38fa2924e02363639d1cdc3dd85128e0652343ee
Add an argument to IAudioFlinger::createEffect() API to
ask AudioFlinger to just run the pre flight checks but not
create the actual audio effect instance and allocate resources.
This is the basis of an API for apps to query if a given
effect can be created without having to allocate the resources
and risk an exception when calling the constructor.
Bug: 150699608
Test: CTS and GTS Tests for audio effects
Change-Id: Ibdda22fd945c88c33e3c7342a7a5ed3e02d399ac
Apps are using zero length frames with EOS flag at the end of a track.
However, they are either ignoring timestamp or are setting to zero.
This breaks the CHECK for last frame duration to be positive and media
file is not created at all. Inorder to let apps to compose movie file in that
case, changed the logic of that code to care only when timestamp of EOS
flagged empty buffer is positive. Also, throw only a warning message when
last frame duration becomes negative.
In other cases, old behaviour of copying the previous frame's duration
for the last frame would stay the same.
Bug: 151056554
Test: 1) The issue mentioned in the bug is not happening with this fix.
2) atest android.media.cts.MediaMuxerTest
3) atest android.media.cts.MediaRecorderTest
Change-Id: I1754bb524049a00def232ae82d08fe94fa13bd0f
* changes:
Plumb the notification about audio HAL services update to APM
libaudiohal: Allow late registration of HIDL HAL services
Allow for late audio module discovery in APM
Android added support for correctly applying color transfer for
thumbnails of HDR videos with PQ color transfer, this expands it to HLG
color transfer.
Bug: 151096599
Test: manual - see bug
Change-Id: I880b2baeeab49a623fcc6e3568c1569b9d3788e4
AudioFlinger registers a callback with libaudiohal to receive
notifications when new HAL services get registered. It relays
the notification to AudioPolicyManager via AudioSystem /
IAudioPolicyService interface.
Because AF / APM only interact via Binder interfaces and APM's
interface gets registered later than AF's, the notification
from AF is made asynchronous.
Bug: 149854039
Test: audio test on a regular phone configuration
audio test on a phone with MSD audio HAL module
Change-Id: I158e941b8f75e2a4614b9d84ca798b0f1f47aa6a
DevicesFactoryHalHidl registers a notification callback
with a service manager to get notified about registration
of new HAL services.
The specific code for the MSD HAL has been removed,
this HAL service is now handled using the added generic
mechanism.
Bug: 149854039
Test: make
Change-Id: I2f7f83dec11ac2390f674afd9e4451ef46dde04e
setMediaCas could fail even when the cas object is validated,
don't assume it always succeeds.
bug: 151006394
test: android.media.cts.MediaDrmClearkeyTest#testClearKeyPlaybackMpeg2ts
when the cfi check appears, mediaextractor will crash, and the
above test should show Fail result.
Change-Id: Ie4c04c5bd073e0000de893d16de466b36cb0fb86
Codec2 Vorbis codec was dynamically linking with libvorbisidec.
By linking statically instead, unused code can be stripped, reducing
size and improving relative coverage.
Test: CTS
Bug: 149042245
Change-Id: If1203ecf2d488bd285cb469f786a14a0eb64a7f4
(cherry picked from commit 048d7c3229170a9a0cc4f72c2a47584d93dc9551)
Some non-verbose log messages are less useful now that Codec2 has
stabilized.
Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice
Bug: 139684703
Change-Id: I661260bc3028d057e6809f29a781c6a89f1f06f6
AudioSystem.setAllowedPolicyCapture is only called from audio service.
In that case, checking if the calling uid is system uid to before taking
action.
Bug: 145115448
Test: dumpsys audio, query active playback configuration
Change-Id: I614ac881ecde6bad13f22f1382de701f314a7ada
Merged-In: I614ac881ecde6bad13f22f1382de701f314a7ada
(cherry picked from commit 140a34fbfe)
WebmFrameThread.cpp does not set the resumed state as false in pause() function.
Hence when multiple pause/start APIs are called, both the mPaused and mResumed
variables remain true. When read happens in paused state, since mResumed
is true, timestamp adjustment logic goes wrong causing an abort. So, set
mResumed=false in pause().
Bug: 146319756
Test: atest writerTest -- --enable-module-dynamic-download=true
Change-Id: I8ec246df4e1ff491c3ade6116696c53551fea11c
Merged-In: I8ec246df4e1ff491c3ade6116696c53551fea11c
(cherry picked from commit 36d77d7f25df8f6e9ba80608311b397581c2763c)
1) Don't count tracks with no samples as malformed for MediaMuxer, but
keep the old behavior as it is for MediaRecorder.
2) When there are no samples to be written in a track, skip that one, but
compose mpeg4 file with all other tracks in it.
3) Allow notifications in MediaMuxer during stop() process.
Bug: 144108285
Bug: 146423844
Bug: 148754639
Test: 1) Unit tested by adding a video and an audio track, once leaving
audio track with no samples and once leaving video with no
samples. Mpeg4 file with expected track was created both the times
and played well.
2) android.mediav2.cts.MuxerUnitTest$TestApi#testSimpleStartStopMuxer
3) android.media.cts.MediaMuxerTest
4) android.media.cts.MediaRecorderTest
Change-Id: If76a1f3b60d09836d53bce6f6e759e6a751f5538
Merged-In: If76a1f3b60d09836d53bce6f6e759e6a751f5538
(cherry picked from commit afc9f27233fa7dfb8c03e0fc83f612e7a19f27f2)
Added ability to set duration of last frame by writing an empty buffer with
EOS flag marked along with presentation time stamp at the end.
This timestamp would be used to calculate the duration of the original last frame.
Bug: 141573686
Bug: 121052341
Test: atest android.media.cts.MediaMuxerTest
atest android.media.cts.MediaRecorderTest
Unit tested with last sample duration equal to previous sample,
different from previous sample and zero as well. STTS entries and
track duration were created as expected.
Change-Id: Ie769dcd013c8c13e69529480d51d124a7ee3b094
Merged-In: Ie769dcd013c8c13e69529480d51d124a7ee3b094
(cherry picked from commit 53f255f5fc560274d69cccb9a546f0aa494e76f2)
ASSERT_*() calls in getInbufBUfferInfo() weren't resulting in test failures earlier
Also added a sanity check for MediaAdapter allocation failure
Test: atest writerTest -- --enable-module-dynamic-download=true
Bug: 150181503
Change-Id: I600ab1e7cbbd6d5e508efbf85c3a40753ca14a18
If the CSD is processed before flush, make sure client and component
are in sync.
Bug: 142542964
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: Ia51591770a4fdac1c1334a94fa8d6b2776da1a81
Current encode batching mandates delay for the first frame. Since photo
images are one frame, reduce the latency for encoding the first frame
Test: atest android.media.cts.VideoEncoderTest
Bug: 145356198
Change-Id: I6a8f7dd374a3252ba93f386d3c62cd735fe82802
(cherry picked from commit 84e512b692)
Merged-In: I6a8f7dd374a3252ba93f386d3c62cd735fe82802
releaseAsync() kicks off shutdown sequence but don't wait for it to
finish. Instead, mark itself as pending removal to the resource manager.
Bug: 129008570
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Test: ResourceManagerServce_test
Change-Id: I119945684e4c101c44d64c13913fa01320662fa9
C2BufferData#linearBlocks() returns a std::vector. Chaining method calls
results in an immediate dereference of a dangling pointer. Save a
reference to the otherwise temporary for the duration of the function
call.
Bug: 142544793
Test: m, flash device
Change-Id: I99d662a8fe5deec652cdcd82f420c836c76d5539
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Current encode batching mandates delay for the first frame. Since photo
images are one frame, reduce the latency for encoding the first frame
Test: atest android.media.cts.VideoEncoderTest
Bug: 145356198
Change-Id: I6a8f7dd374a3252ba93f386d3c62cd735fe82802
When creating native audio track, a IAudioTrackCallback will be created
systematically. All callbacks will be cached in Threads and protected by
a lock. Whenever there is a callback event from audio HAL, it will
finally trigger callback to native audio track. Currently, there is only
one callback event, which is codec format change.
Bug: 150301890
Test: manual
Change-Id: I32293627ed923b17dd25f11f0ee0a0c35cd7c01f
There was a link error that process from vendor fails to find
libstagefright_bufferqueue_helper_novndk.so which was only in the
swcodec APEX. To fix this issue, this change enables the library also
from the system libraries.
Bug: 150257951
Test: m -j passed & Tested from betty
Change-Id: I0f6568e043a9ff1b7fdfe059d0619895efffe67d
Make the media.swcodec always link to the no-binder version of
bufferqueue, even if the device build doesn't use vndk. These
devices don't have a "vendor" target and the same system build
of libstagefright_bufferqueue_helper.so is used on the apex,
which brought in libgui/libEGL*.
bug: 150155192
bug: 139201422
Change-Id: Ib356e65019dba4495f2fc1eb6db6de4ff251bbde
Merged-In: Ib356e65019dba4495f2fc1eb6db6de4ff251bbde
Note: new limit, data_size - 8, should be smaller than the previous one,
UINT_MAX, since we global atom size checking with kMaxAtomSize, 2^26.
Test: run poc
Bug: 127973550
Change-Id: I1744d71d2e10183dd2bebfd01b15d9ee5998fdf3
If the CSD is processed before flush, make sure client and component
are in sync.
Bug: 141097367
Bug: 142542964
Bug: 149537770
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: Ia51591770a4fdac1c1334a94fa8d6b2776da1a81
Merged-In: Ia51591770a4fdac1c1334a94fa8d6b2776da1a81
make sure the libstagefright_bufferqueue_helper.so uses the static,
no-binder version of bq on vendor side, while uses libgui on client side.
bug: 139201422
test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
build and manually check the correct version gets installed on
apex & system.
Change-Id: I51ca0943fd89cd944f285e5f4be3db789fd6dc20
NdkJavaVMHelper.h is not a valid NDK header. Replace this one with
NdkJavaVMHelperPriv.h in the cpp directory.
Bug: 149578834
Test: NativeDecoderTest
Change-Id: I07ddec4d31ae84bf4a739fcf512859f794cb1baa
MediaBenchmarkTest sets sdk_version: "system_current", but its
JNI libraries were building against platform APIs.
Bug: 149591057
Test: m checkbuild
Change-Id: I4a62812b8fb5b534bdb698d4138123eb1e4e3cfa
* changes:
AAC decoder: support album mode
AAC decoder: implement support for output loudness query
AAC decoder: fix boost/attenuation defaults, loudness norm off
AAC decoder: enable set/get of DRC parameters during decoding
The dst frame is allocated according to the actual crop size.
When top-left is non-zero, the convert needs to use the dst
rect with top-left adjusted to {0, 0}.
bug: 149667324
test: vendor testing on devices that uses non-zero top-left crop;
CTS MediaMetadataRetrieverTest.
Change-Id: I98ea2e398cf6bb17a6e76116caa145e9be5a110e
For MPEG-D DRC the default value of the boost and attenuation
factors is 127. For MPEG-4 DRC the default value is 0. In the
current DRC presentation mode wrapper, setting boost or attenuation
factor to 0 doesn't work for MPEG-DRC, use value -1 instead.
Fix Target Reference Level set to -1 as a valid value for disabling
loudness normalization.
Bug: 148385721
Test: atest DecoderTestXheAac DecoderTestAacDrc
Change-Id: I33479072c508b5700c0b35f389802dc17b2b4536
Current APEX Namespace is named with APEX name itself, which also uses
.(dot) so linker configuration can keep the syntax safe.
Bug: 148826508
Test: m -j passed
Test: boot succeeded from cuttlefish and walleye
Change-Id: Icc1c5958fcbcceb6f53ad18045cf783e315ebbb0
If the CSD is processed before flush, make sure client and component
are in sync.
Bug: 141097367
Bug: 142542964
Bug: 149537770
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Change-Id: Ia51591770a4fdac1c1334a94fa8d6b2776da1a81
AudioPlaybackRate is now defined in system/audio.h
as 'struct audio_playback_rate_t' (in global namespace).
Similar for the related enums.
To accommodate the existing code, introduce AudioPlaybackRate
as a typedef in the 'android' namespace.
Update code that was forward declaring AudioPlaybackRate
as it's not a struct anymore.
Bug: 133526565
Test: m
Change-Id: Iba20f1de1e8779cd78ac4573f2082416f2b428e2
Set the size of the callback buffer based on the device format
instead of the app format.
Bug: 149249791
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: I0dc5724109a802eea15100782c18986a64e6acd2
The access to call audio (record and play) will be granted only to the app associated with Dialer role, who also includes a new system permission.
Test: Compilation and manual tests
Bug: 135197853
Change-Id: I65ca823c235d4d3420630837427103783ad1d1b0
Extend MONO_HACK to multi-channel output.
Mono track will have only one channel output on multi-channel devices.
Since ARC++ exposed a 4-channel output device and downmix track in
ChromeOS, we need to add this feature to support mono track sample
expansion.
Add support for both re-sample and non-resample path.
For resample path, we need to add MIXTYPE_STEREOEXPAND in
AudioMixerOps.h since AudioResampler will upmix mono track to stereo
track.
Bug: 120222604
Bug: 112341269
Bug: 117116052
Bug: crbug.com/890560
Test: Play mono tracks without re-sampling on ARC++
Test: Play mono tracks with re-sampling on ARC++
Test: Play normal stereo tracks on ARC++
(cherry picked from commit 9b79e0752e6536c31430aa31838a9de1b7b56f9f)
Change-Id: I51f5914c41dd0196db9c6a2e1a99b44e5d87c0d6
CrOS exposes 4-channel output for ARC++ and mixes samples in CRAS
server to real channel format, but AudioMixer will discard right
channel volume when mixing a 2-channel track to 4-channel output.
This behavior will cause ARC++ fail on Audio Frequency Line Test
in CTS-V since the right channel can't be tested.
The code is also updated to work for 3, 5, 6, 7, 8 canonical output
channel position masks, as well as continue the mono volume
handling for output channel index masks.
Bug: 110551766
Test: Run CTS-V Audio Frequency Line Test
Test: atest mixerops_benchmark
Change-Id: I4c6ee86d30bb8296f0e32f9a17b1135e1313fd64
marks video tracks with excessive trun boxes filled with defaults as invalid.
handles overflow in the constructed vector of samples.
Bug: 124389881
Test: poc
Change-Id: If89c912d73340e41fd8ea81d74595a56987c961d
(cherry picked from commit 6707df1fea)
Add meteric to show the difference between drm
playback of protected vs unprotected content.
We log onQueueInputBuffer errors.
Bug: 138862395
Test: adb shell dumpsys media.metrics | grep -i InputBuffer
Change-Id: I26aae706267956b6f944955877347747e573e3c8
This is intended to recover from cases when the MIDI extractor gets
stuck in an infinite (or very long) loop.
The extractor code is 3rd party and hard to harden - this gives us
at least an eventual recovery.
Change-Id: I8d2fd85f91d1d2749c5620cf8518583076d2f6d7
Bug: 127313764
Bug: 127313537
Bug: 127313223
Bug: 127312550
Bug: 127310810
Bug: 126380818
Bug: 123700383
Merged-In: I8d2fd85f91d1d2749c5620cf8518583076d2f6d7
This change fixes the CTS failure in AudioPlaybackCaptureTest caused
by ag/10111312 and ag/10111311.
It contains the following fixes/changes:
- Mix match for playback capture of USAGE_VOICE_COMMUNICATION now
also respects a new flag (AudioMix's mVoiceCommunicationCaptureAllowed)
which is set by AudioService only if the caller explicitly asked
to capture USAGE_VOICE_COMMUNICATION and have the
CAPTURE_VOICE_COMMUNICATION_OUTPUT.
- A permission check on the native side in case
mVoiceCommunicationCaptureAllowed is set.
- Code cleanup, mainly in AudioPolicy.h and AudioPolicy.cpp.
This change is accompanied by ag/10242955 on the Java side.
Bug: 148559127
Test: manual
Test: atest PlaybackCaptureTest (with the version prior to ag/10220852)
Test: atest com.google.android.gts.audio.AudioHostTest
Change-Id: I8ae6249f4da1de35e962c838d91f690eb906570e
Communicate current audio mode owner UID to native service
when changing audio mode via setPhoneState.
This will be used by call audio capture restriction rules.
Bug: 148368476
Test: manual phone call tests
Change-Id: Icf6f168bb431b5232f6127877c40789c0c537bde
Due to some reason, for example bad file, readAt header fails
in AACExtractor(...) and the variable mMeta is not initialized.
Then exception happens when to delete mMeta in ~AMRExtractor().
Bug: 142630125
Test: MTBF test and make sure
no assertion in AMediaFormat_delete(mMeta) of ~AACExtractor()
Change-Id: Ie04989f20170391961c8a6d12e1882262be18d7f
Sometimes, even mStopTimeUs is set by calling setStopTimeUs(), the EOS
buffer may still not be submitted, because fillCodecBuffer_l() may not
be called. So, remove this condition checking, and once if
submitEndOfInputStream_l() be called, mEndOfStremSent will be set to
true. So EOS buffer won't be send twice.
Bug: 2356695
Test: CTS test.
Change-Id: I5b69a9281f577e692eb2a471fe1998b0cb09ba45
The duplicate log allowed suffix ! (e.g. "event!") looked more like
"not equals" so changing from ! to #.
Test: adb shell dumpsys media.metrics
Bug: 138583596
Change-Id: I642334770ed8f5ff0d1f1e187e25eca596603252
Retained the code as per the macros defined and removed all
conditional compilation checks for BUILD_FLOAT, HIGHER_FS,
NATIVE_FLOAT_BUFFER, LVM_PCM, MUL32x32INTO32,
MUL32x16INTO32 and ADD2_SAT_32x32.
Removed multiple blank lines in the code and replaced
with one blank line.
Test: android.media.cts.AudioEffectTest
Test: android.media.cts.AudioPreProcessingTest
Test: android.media.cts.BassBoostTest
Test: android.media.cts.EnvReverbTest
Test: android.media.cts.EqualizerTest
Test: android.media.cts.LoudnessEnhancerTest
Test: android.media.cts.PresetReverbTest
Test: android.media.cts.VirtualizerTest
Test: android.media.cts.VisualizerTest
Test: Tested using standalone application
Bug: 129491957
Change-Id: I392f890811e4277ee13cbfddae07da5b122ca645
Routing strategy call assistant was added without
associated volume stream and wass reusing AUDIO_STREAM_PATCH.
This is violating the rule that two strategies cannot
share the same volume stream.
Bug:148588565
Test: play music and check volume
Change-Id: Ib3fb2a1b7b5f3118bf16a3cc9d8e578fa0431645
This is intended to recover from cases when the MIDI extractor gets
stuck in an infinite (or very long) loop.
The extractor code is 3rd party and hard to harden - this gives us
at least an eventual recovery.
Change-Id: I8d2fd85f91d1d2749c5620cf8518583076d2f6d7
Bug: 127313764
Bug: 127313537
Bug: 127313223
Bug: 127312550
Bug: 127310810
Bug: 126380818
Remove static linking to libaudiohal@N.0.so libraries.
Instead, use HIDL IServiceManager to figure out the actual
version used by the device and load the appropriate library
dynamically.
Bug: 142480271
Bug: 148118201
Test: make and check audio on the device
Change-Id: I8e6eb9eeef3335da516d983d5d4f0f1b128ef0a6
Empty, since the functionality was moved to libbinder/libhwbinder to
remove extra lib dependency.
Bug: 148692216
Test: N/A
Change-Id: I8a1fd821c200f94bd500eed477d7e4ae9f8541d2