- check dump permission
- fix truncation happening when details field is too long
Bug: 140444741
Test: dumpsys media.player
Test: atest CtsSecurityTestCases:android.security.cts.ServicePermissionsTest#testDumpProtected
Change-Id: Id04afba8195347c6a174e13743cedb422c8624a1
into libdatasource, which contains:
DataSourceFactory
(Clear)FileSource
(Clear)MediaHTTP
DataURISource
HTTPBase
NuCachedSource2
This is needed to break a circular dependency in an upcoming CL.
Test: build, boot
Change-Id: I34d9937235c78f18f51b18945342a0743e209577
Merged-In: I34d9937235c78f18f51b18945342a0743e209577
into libdatasource, which contains:
DataSourceFactory
(Clear)FileSource
(Clear)MediaHTTP
DataURISource
HTTPBase
NuCachedSource2
This is needed to break a circular dependency in an upcoming CL.
Test: build, boot
Change-Id: I34d9937235c78f18f51b18945342a0743e209577
This change renames the IMemory raw pointer accessors to
unsecure*() to make it apparent to coders and code reviewers
that the returned buffer may potentially be shared with
untrusted processes, who may, after the fact, attempt to
read and/or modify the contents. This may lead to hard to
find security bugs and hopefully the rename makes it harder
to forget.
The change also attempts to fix all the callsites to make
everything build correctly, but in the processes, wherever the
callsite code was not obviously secure, I added a TODO requesting
the owners to either document why it's secure or to change the
code. Apologies in advance to the owners if there are some false
positives here - I don't have enough context to reason about all
the different callsites.
Test: Completely syntactic change. Made sure code still builds.
Change-Id: I5fb99aa797c488406083178a6b05355d98710d3b
Check actual bytes read when feeding the data to TS parser.
bug: 140177694
test: poc in bug; StreamingMediaPlayerTest
Change-Id: I4b498fe375af657e17838e5839e6348e1463d559
Allow sequential frame retrieval to reuse the decoder without
re-init and re-seek.
Get rid of IMediaMetadataRetriever api that retrieves multiple
frames at a time, this method could hold up more memory than
what's needed, because the client side has to copy the frames
to a separate set of bitmaps anyways.
This change is needed to support animation Drawbles efficiently
which typically get one frame at a time.
bug: 120414514
test: cts MediaMetadataRetrieverTest, local tests that tests MetadataRetriever thumbnails
Change-Id: I09924408b51bc7491fc5dee121dce9a286c5911f
onPollBuffering() monitors EOS(finalStatus == ERROR_END_OF_STREAM),
then notifyPreparedAndCleanup(finalStatus) notifies prepared error.
Previous Google's patch "GenericSource: fix error handling during
preparing or rebuffering" should focus on error except ERROR_END_OF_STREAM.
Bug: 134911527
Test: http streaming can play a mp4 video whose duration is less than 5s
Change-Id: I5c738bbe7242314b24463679b5bd996ab59d2b04
(cherry picked from commit 89703072ec4edf7a384ec07024debc0a6e085ae0)
mLock and mDisconnect lock order interleaving,
which has potential risk of deadlock if other code locks/unlocks them in a different order.
Bug: 135211710
Test: (1) android.hardware.camera2.cts.FastBasicsTest#testCamera1
(2) android.media.cts.MediaPlayerFlakyNetworkTest
Change-Id: I9486f2c6780c2f246786299a3d6c7c2f7295b768
Added mDisconnectLock to seperate it from mLock, used for protecting
mDataSource, mHttpSource and mDisconnected in order that disconnect()
won't be blocked by mLock.
Bug: 133900877
Test: android.media.cts.MediaPlayerFlakyNetworkTest
Change-Id: I15693c0a61f898aad4035d0fa55c8af25de4fc96
take the collected media.metrics (as they arrive) and push a copy over
to statsd, the statistics logging subsystem.
gather data, wrap in protobufs apppropriately, and submit it to statsd.
Bug: 118782504
Test: statsd's test_drive app
Change-Id: Ieb82c43633851075e9eaf65d2a95c8cba87441ea
don't emit the -1 (default, unspecified) values for
movie, audio, and video timescale fields in the 'recorder'
mediametrics type.
Bug: 78600173
Test: y
ftruncate(fd) would be useless if mWriter was NULL already.
Hence moved mWriter nullptr check before ftruncate(fd).
Bug: 128366317
Test: atest CtsMediaTestCases:android.media.cts.MediaRecorderTest
Change-Id: I46b8c4718bc8a90712b7ec0b54d8239106106018
Bug: 127693962
StagefrightRecorder receives next file descriptor in it's function setNextOutputFile() from
MediaRecorder.setNextOutputFile(). It duplicates the received file descriptor, but doesn't close
the duplicated one when done.
This CL fixes that issue by not duplicating it in StagefrighRecorder as it has to just pass it on
to Mpeg4Writer. Mpeg4Writer duplicates received file descriptor. It frees them during release.
Test: cts-tradefed run cts-dev -m CtsMediaTestCases --compatibility:module-arg
CtsMediaTestCases:include-annotation:android.platform.test.annotations.RequiresDevice
Change-Id: I24fc12bd957a2abdb8785625261c95da62952736
mediaserver is no longer forced to 32-bit mode, floating to primary
architecture which is usually 64 bits.
Bug: 16890215
Test: boot, record video, android.media.cts.MediaPlayerTest
Change-Id: If5265e251a4201e7037ddaa2f36fa998936622aa
Bug: http://b/116873221
Mark the functions in this class that aren't defined as pure virtual.
If not, Clang assumes that the TU which defines the first undefined
function will contain the vtable for the class as well. Since there's
no out-of-line definition of this funciton, no TU ends up with the
vtable.
This causes a problem with coverage builds, which are built with -O0,
where calls don't get inlined, thereby requiring a definition of the
vtable. For non -O0 builds, the vtable is not required since the
virtual calls get inlined/optimized-out.
Test: Build with and without coverage
Change-Id: I4644dcd892c5f47031f1603b0f809c1da95314db
when audio tear down happens, audio gets flushed and seek is issued.
If video is not flushed before seek, previous video buffers will be
rendered and leads to A/V sync issue. Hence call video flush.
Author: Cong Jiajia <jcong@codeaurora.org>
Bug: 70919418
Test: MediaPlayerTest
Change-Id: I01f744c1eae99a1d0f81ca84f536d493a2a54b01
Clear the vector which holds all tracks when the
GenericSource is reset to prevent any stale access
Author: Umesh Pandey <umeshp@codeaurora.org>
Bug: 70919418
Test: TBD
Change-Id: If7042b3344ce36ba56e38df1a43bc2bb287cc40c
nuplayer's updateMetrics() referenced an unprotected shared stats buffer.
It's a small buffer, so we now make a copy during updateMetrics()
[at a point where we are mutexed] instead of putting a mutex on the
underlying frequently used construct.
Ensure that nuplayer2 has the same protections.
Bug: 123256408
Test: race condition
Check if MediaAnalyticsItem class is valid before
calling any of its functions.
Author: Paras Nagda <pnagda@codeaurora.org>
Bug: 70919418
Test: TBD
Change-Id: I2d5704063b9479301f03d6f57ce74108873ef4cc
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>
there is a clamping value in getDurationUsIfPlayedAtSampleRate function
numFrames parameter is uint32_t type. when return value, cast uint32_t to int32_t.
that make clamp value of numFrames
Signed-off-by : Hyoungjun Byun <hyoungjun.byun@lge.com>
Change-Id: Ib97d89b33a8e5b6bea3d499e4b44d1056d7fae66
When the system partition is a later version than vendor,
new MediaDrm APIs will not have HAL implementations. In
this case throw java.lang.UnsupportedOperationException.
bug:110701831
bug:123375769
test: cts media test cases, gts media tests
Change-Id: Ib631bf4d4d245d857e61bd3fe0e5808e430a034d
Check if variables used in AudioOutput::open()
are 0 before using them as a divisor.
Bug: 123375287
Change-Id: I1c65a80a12eda84d11e7526fe0c730cb10565c36
CRs-Fixed: 2286455
(cherry picked from commit 9e67171a2f4e2b7dc38017789700f629a3885734)
Currently, there is a lot of logspam in nudriver. Reduce the spam.
Test: flash the device and let it idle. Open 'adb logcat'. Observe.
Before the change: logspam @ about 10 messages / second
After the change: no logspam
Bug: 65494379
Change-Id: Ie952fdcab61aa89bb72d9c6dc63487643febd974
Move DataSourceBase and MediaSource to libstagefright, and
MediaBuffer, MediaBufferGroup and MetaData to libstagefright_foundation.
Test: build
Change-Id: I4f0ae01d40a32f4b773a2f74d5f2ae136e375322
initFromDataSource and onPrepareAsync are called with mLock acquired.
When initFromDataSource returns with error, notifyPreparedAndCleanup
will be called and it requires mLock acquired.
Test: cts
Bug: 122564587
Change-Id: I430dbc5f1f30c06223ea22438282bd388174f7df
When audio reaches EOS and MediaClock has not started, use video
timestamp to start MediaClock.
Test: MediaPlayer sends MEDIA_PLAYBACK_COMPLETE
Bug: 122052445
Change-Id: Ia37643b8d5260cda0e7cde22dea883804511cff6
(cherry picked from commit 1225b93293)
When audio reaches EOS and MediaClock has not started, use video
timestamp to start MediaClock.
Test: MediaPlayer sends MEDIA_PLAYBACK_COMPLETE
Bug: 122052445
Change-Id: Ia37643b8d5260cda0e7cde22dea883804511cff6
Add method to retrieve unique port ID for the AudioRecord instance
associated with a MediaRecorder.
Bug: 111438757
Test: CTS tests for MediaRecorder
Change-Id: I77295ccd163bfa2319a492ed64186a28b691ac38
Webm, OGG container extensions to hold opus.
hooks so we can say that we're recording in opus format.
OMX-specific changes are omitted since our target is Codec2
Bug: 111850384
Test: with separate omx routines
Change-Id: Iecb8b53df3fbd8506d2e6f007602284eb2d0decc
Remove diagnostics mode from CFI across the board. This should reduce
performance overhead and also allows the minimal runtime to work when
other ubsan sanitizers are enabled. CFI stack dumps should include a
cfi related function, so it should be apparent when a crash is CFI-related.
Bug: 117417735
Test: make -j
Change-Id: Id2cb6cb64425c4c89c031d93156fb1a20be5fa7b
Previously all WAV/FLAC files were extracted as 16 bit data.
Changes this so that 24/32 bit are extracted as float data
to maintain the higher quality.
Note: Update for master branch supersedes iot branches.
Bug: 63770882
Bug: 110480091
Test: Used media player to play 24 bit, 32 bit, and float wav files, plus 16 bit and 24 bit FLAC files,
ensured data went through successfully without loss of quality
Change-Id: Ic09bd2fe994bbf3ed8441549904712c534030c96
For cases when StagefrightRecorder is used for recording
videos with a different capture and frame ratio (time lapse
or slow motion) with a surface source, recorded video
is incorrectly updated by a capture/recorded fps ratio.
To fix this, such factor will be used only with camera source.
Bug: 119070689
Test: timelapse/slowmotion and pause/resume with surface input
Change-Id: Id9df526324f3ead8117eb4571f9459beceea9fff
In MediaPlayer2, we don't need to call setNetworkForUser
since the framework already handles data usage billing
for application processes.
Test: build
Bug: 112767419
Change-Id: I0d4464f7ac024e0a0cf41e1d5cc97372c3e37017
Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I5b7ab7abb46884b363e13284382eddf7a256a3e2
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
undo earlier change moving this to the handler thread, instead using
a mutex to protect the contended resources: mAudioDecoder and
mVideoDecoder.
Bug: 110855771
Bug: 78365291
Bug: 111910846
Test: playback with persist.debug.sfstats=={0,1}
Change-Id: If8822dba9dae6ac0698b142166604371cd6742b2