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
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
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
This change refactors ImageDecoder to prepare it for reuse
for multi-slice decoding. There is no functional change.
bug: 78475896
Test: CTS MediaMetadataRetrieverTest;
Manual test of HEIF image decoding and thumbnail extraction.
Change-Id: I8c16042020c7db3d3714d22322e6304ea4192e33
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
Add plumbing to retieve the embedded thumbnail from
MPEG4Extractor/ItemTable.
bug: 74395267
Test: CTS MediaMetadataRetriever test; manual test of thumbnail
extraction by browsing new folders containing heif files in
Downloads app.
Change-Id: Ic49f6dfa47eddc229b9f4b0e1835d58df1dce9f8
Adding support for two new sets of APIs on MediaMetadataRetriever:
- getImageAtIndex() and getPrimaryImage()
- getFrameAtIndex() and getFramesAtIndex()
Outline of changes:
- Proper indexing of all displayable still images, so that they
can be retrieved by getImageAtIndex()
- Exposing still images as "image/x.android.heic" tracks in
MediaExtractor with necessary descriptive keys (such as "grid-*")
- Support to retrieve video frames by absolute index instead
of timestamps, as image use cases mostly are interested in
getting the images and care less about timing.
- Support to retrieve video frames in batches because retrieving
one frame at a time is inefficient.
- Refactor image / frame decoding code into FrameDecoder, and split
still image decoding and video sequence decoding into to sub
classes to facilite future development.
bug: 63633199
test:
cts-tradefed run cts-dev --module CtsMediaTestCases --compatibility:module-arg CtsMediaTestCases:include-annotation:android.platform.test.annotations.RequiresDevice
Change-Id: I2fe8519fb6907f315a8b513921fc1cc7f436e28d
- MediaSource, DataSource and MediaExtractor are moved to
libmediaextractor so that they can be used by extractor
implementations without depending on libmedia and libstagefright.
- XXXFactory classes has been added in order not to expose CreateXXX
methods in libmediaextractor.
- avc_utils is moved to libstagefright_foundation since most of
extractor implementations are relying on that.
Test: build + post submit media CTS tests
Bug: 65851881
Change-Id: I7d5cf18dd25abc10478ac3f6e7d1828ad023e3fb
- 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
- Allow setDataSource() to specify mime. In case of HEIF decoding
request from skia, we don't want to sniff any other format other
than mp4.
- Allow getFrameAtTime() to specify dst 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: I471f41c28a2252417c4b3331dcfd4bd00a24408a
am: 1863e62d0f
* commit '1863e62d0f49b01b7d066e2d7c47fef249fffd9d':
Clear unused pointer field when sending across binder
Change-Id: I6b890a1e3964ba6623344414a5a897cc19a84e88
am: 7c3e69cd12
* commit '7c3e69cd12e2e631ab97ce10b71def69b3490d9d':
Clear unused pointer field when sending across binder
Change-Id: If5f841e873f937669e3e23f77bbfb43f109c563d
am: d2c61d049b
* commit 'd2c61d049b52158c506a2c61727078fccb92b898':
Clear unused pointer field when sending across binder
Change-Id: I5e41f418c9fcdea8bc05c150772a0b87cef101bd
am: 2d4cf313fa
* commit '2d4cf313fa141d11cfae7c31797da114598d8ed7':
Clear unused pointer field when sending across binder
Change-Id: I0d1569e886ff40a43423cdbf83ed5d04e35f2d07
IMediaMetadataRetriever::setDataSource(fd, offset, length) takes the ownership
of |fd| on the direct invocation, and doesn't take the ownership on invocation
from Binder. This is inconsintent to other similar methods like
IMediaPlayer::setDataSource, and causes potential double close of |fd|.
This CL changes the caller and implementations to leave the ownership to make
them consistent.
Also, fixes a double close in IMediaPlayerService::setDataSource in an error
case.
Change-Id: Id551a1e725c4392b0fe6b7293871212eb101c0a5
This allows apps to implement MediaDataSource, which is modeled on
stagefright's DataSource, to supply media data to the framework. This
was already implemented for MediaExtractor, but it was renamed from
DataSource.
MediaExtractor, MediaPlayer and MediaMetadataRetriever each have a new
overload: #setDataSource(android.media.MediaDataSource)
Only NuPlayer supports this new data source.
The change introduces:
* IDataSource: The binder interface for DataSource.
* JMediaDataSource: The native counterpart to the java interface. It
implements IDataSource.
* CallbackDataSource: A stagefright DataSource that wraps an
IDataSource.
Change-Id: Ib3c944b49cc8a792c8eb9c85e5015c07f298ebc1
This gets rids of a bunch of special midi handling and replaces it
with an extractor that works with NuPlayer and MediaMetadataRetriever.
Change-Id: I8d0f5bbdde2ca24267cf4d62ab26afe9630e0217
This gets rids of a bunch of special midi handling and replaces it
with an extractor that works with NuPlayer and MediaMetadataRetriever.
Change-Id: I8d0f5bbdde2ca24267cf4d62ab26afe9630e0217
Add the ability to dynamically register low level MediaPlayer
factories which will be probed at setDataSource time to determine the
proper MediaPlayerBase to instantiate.
This change is in preparation for moving libaah_rtp out of
frameworks/base and into phantasm platform directory.
Change-Id: Icf8904db3ab9e3c85df6e780d5546d9988cb9076
Signed-off-by: John Grossman <johngro@google.com>
o plus a few file relocation: ActivityManager.cpp/h, SoundPool.h, etc
o remove some runtime dependencies to libandroid, libandroid_runtime, etc
Change-Id: I047a47c5fb361dd5cf85cd98798c39f629a75d10
o Removed setMode() methods and related mode constants
o Removed some of the unused the metadata keys
o Updated the javadoc
o part of a multi-project change.
bug - 2433195
Change-Id: I5ed167f1fd6a53cb143b7dc385b149431d434438
At some point the implementation became complicated because of
SurfaceFlinger's special needs, since we are now relying on gralloc
we can go back to much simpler MemoryDealer.
Removed HeapInterface and AllocatorInterface, since those don't need
to be paramterized anymore. Merged SimpleMemory and Allocation.
Made SimplisticAllocator non virtual.
Removed MemoryDealer flags (READ_ONLY, PAGE_ALIGNED)
Removed a lot of unneeded code.