998 Commits

Author SHA1 Message Date
Jaesung Chung
8409c0691f Enable reading a thumbnail from RAW image files in MtpDatabase
Also introduce new supported RAW image file formats, PEF and SRW.

RAW image file formats are not defined in PTP 1.2 specification except
for DNG. They are mostly built on top of TIFF or TIFF/EP. (Fuji's RAF
is the exception).

In this CL, image file formats are classified newly as below:

DNG: dng
TIFF: cr2, nrw, arw, rw2, orf, pef, srw
TIFF/EP: nef
Unknown Image Formats(FORMAT_DEFINED): wbmap, webp, raf

I referred to the following documents for defining MTP formats of RAW
images:

* http://www.rags-int-inc.com/PhotoTechStuff/RawStandards/RawSummary.html
* https://en.wikipedia.org/wiki/Raw_image_format

Bug: 26552863, Bug: 26626825
Change-Id: Ia218f6320c4c1ff051a23ca0060ceac46134b0d7
2016-01-27 18:40:36 +09:00
Yin-Chia Yeh
e76958297a Merge "ImageReader: fix missing pixel stride" 2016-01-25 02:26:11 +00:00
Daichi Hirono
148954a657 Add eventsSupported property to MtpDeviceInfo.
The property provides the set of event code that are supported by
MtpDevice.

BUG=26147375

Change-Id: I54be75e4bb52ddfe9aba8630538ddd32d1a641c8
2016-01-25 10:47:01 +09:00
Yin-Chia Yeh
b99a7f1359 ImageReader: fix missing pixel stride
Change-Id: Ie34cb51fee90e2d5624663fa23da4093fec435e2
2016-01-22 18:02:58 -08:00
Jaesung Chung
1c78b60a49 Merge "ExifInterface: add support for reading metadata from RAW images" 2016-01-19 00:37:13 +00:00
Jaesung Chung
fe968dfc12 ExifInterface: add support for reading metadata from RAW images
This CL depends on piex (github.com/google/piex),
which is owned by Google Photos's RAW team.

piex is capable of reading EXIF data that contains
metadata, and finding the positions in an image of
thumbnail and preview images from RAW images.

piex supports DNG, CR2, NEF, NRW, ARW, RW2, ORF
and RAF image file formats.

ExifInterface gets thumbnail and metadata information
from the above RAW image formats via piex.

Bug: 26177215
Change-Id: I529f8032bcb2a9d3d9e857ff1365a26a4f040066
2016-01-18 22:14:57 +09:00
Daichi Hirono
cc1251b9b2 Merge "Change offset and size arguments of MtpDevice#getPartialObject to Java long." 2016-01-14 02:28:45 +00:00
Daichi Hirono
2dd48256e9 Change offset and size arguments of MtpDevice#getPartialObject to Java
long.

To represents full range of 32-bit unsigned integer, we should use
jlong instead of jint.

BUG=26284424

Change-Id: Id3fa9e3daa778c204ab8e38f821d454c709c317a
2016-01-14 09:42:59 +09:00
Jeff Tinker
c8c0de38d1 Merge "Support AES-CBC sample encryption in MediaDrm" 2016-01-12 17:42:16 +00:00
Daichi Hirono
2a9a43369b Reland "Add event parameters to MtpEvent."
The CL was previously reviewed at ag/842930.

> We can obtain detailed information of MtpEvent from devices. e.g. object
> handle of changed object.  The CL adds the detailed information as
> properties of MtpEvent class.
>
> BUG=26480986

Change-Id: I93afad9caf118d74cd0923d70242133c4fb2a648
2016-01-12 12:14:30 +09:00
Jeff Tinker
d4ea5d3eb6 Support AES-CBC sample encryption in MediaDrm
bug:23719082
Change-Id: I06eb39bd8ad9b55ea0da4011258cac62a8c21ae1
2016-01-11 17:11:51 -08:00
Daichi Hirono
1d4779c29a Add operationsSupported to device info.
Because not all MTP devices support getPartialObject, we need to check
supported operation of MTP devices. The CL adds operationsSupported
field to MtpDeviceInfo class.

BUG=26147375

Change-Id: Iaad968fb4497a5ad11bf6489097abea99c3cbac7
2016-01-08 16:58:24 +09:00
Glenn Kasten
d713c9d65a Merge "Use FCC_2 and FCC_8 to highlight channel count assumptions" 2016-01-07 15:54:45 +00:00
Andreas Gampe
9c180dd387 Media: Fix MtpDevice call
The signature was changed last minute. Update the media side.

Bug: 26284424
Change-Id: Ia8fb665221f60d3eadd2c32831a12aa21c6c5e9c
2016-01-06 21:15:09 -08:00
Daichi Hirono
3ad1a8ee94 Add missing style change to android_mtp_MtpDevice.cpp.
BUG=26284424

Change-Id: I0e288712a8fccfb3dd21fa927388bacf5ce155d0
2016-01-07 13:06:11 +09:00
Daichi Hirono
52da3ad906 Add getPartialObject to Java MtpDevice class.
BUG=26284424

Change-Id: Id05dc6297a1682999eee4e72972fb883fa49a5d1
2016-01-07 12:41:17 +09:00
Glenn Kasten
bd2c3d65d6 Use FCC_2 and FCC_8 to highlight channel count assumptions
Bug: 21656069
Change-Id: I20a74575eddf6e28f1777d04eeab396f28bcc0cc
2016-01-05 11:44:12 -08:00
Yin-Chia Yeh
44581ff4db Camera: add RAW_PRIVATE format
Also add necessary plumbing for RAW_PRIVATE to work for ImageReader.

Bug: 25596619
Change-Id: Ic90f3f44264ac46fae1fafbc27ac64b5319f0970
2015-12-09 11:20:32 -08:00
Jeff Tinker
67b39bfa08 Merge "Remove unused MediaDrm.unprovisionDevice" 2015-12-09 17:07:35 +00:00
Jeff Tinker
dade24c12a Remove unused MediaDrm.unprovisionDevice
bug:25726218
Change-Id: Ibbd51aaa1ee4c21c9ec8b162fc6e378ab7ba6e7b
2015-12-09 09:02:31 -08:00
Zhijun He
dc6bb24a3c media: improve ImageReader/Writer native memory management
* Hook up the native allocation registration with ImageWriter, such that GC
can get some hint when clean up the large memory object.
* Close all pending images when closing ImageReader. This could avoid native
mem leaks for some bad app practice. For example, some apps may hold images
in background service when activity is paused/destroyed, which could cause
huge native memory leaks even ImageReader is closed.
* make Image close thread safe: it is possible the clients close the image
in listener thread and the client main thread.
* Some minor code refactor to reduce the code duplication.

Bug: 25088440
Change-Id: I37d22b52aeb8d2521bf9c702b0f54c05905473e0
2015-12-07 14:38:37 -08:00
Andy Hung
0275a982ab SoundPool: add lock for findSample access from SoundPoolThread
Sample decoding still occurs in SoundPoolThread
without holding the SoundPool lock.

Bug: 25781119
Change-Id: I11fde005aa9cf5438e0390a0d2dfe0ec1dd282e8
2015-12-01 14:40:26 -08:00
Jeff Tinker
3ccb34d707 Improve MediaCodec.CryptoException log messages
The message being logged is "Unknown error" even for
known error types.  This change provides more descriptive
error strings, for the case when the message isn't
explicitly provided by the DRM plugin.

Change-Id: Ic86478d7685cd33e21ecd2f875ef7dbed351e52e
related-to-bug: 25477595
2015-11-09 17:31:05 -08:00
Wonsik Kim
8399506317 Implement pause/resume functionality to MediaRecorder
Bug: 20092236
Change-Id: I02b9f11e210d15f6efe52d44f64ad8a3bc566d96
2015-10-08 08:40:34 +00:00
Daichi Hirono
aeaa12c34e Merge "Add readEvent method to MtpDevice." 2015-09-28 12:40:05 +00:00
Daichi Hirono
0b494663a4 Add readEvent method to MtpDevice.
BUG=23368533

Change-Id: Ibefff559fa7dd0bee17e2812bd7cdd129108d804
2015-09-25 14:54:17 +09:00
Elliott Hughes
434a481b21 am ea1831d2: am b57dd722: resolved conflicts for a884d81e to stage-aosp-master
* commit 'ea1831d211ea0e6b2d161c714bb0786369ef2df5':
  constify JNINativeMethod function pointer tables
2015-09-24 17:23:00 +00:00
Elliott Hughes
b57dd722f1 resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Daniel Micay
76f6a86de2 constify JNINativeMethod function pointer tables
Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
2015-09-22 17:10:35 -04:00
Marco Nelissen
2f01c806e0 Stop SoundPool on error instead of continuing
otherwise we might end up looping forever.

Change-Id: I86e33de5387e3acd148d9bba83d18224bb79fd95
2015-09-15 12:49:07 -07:00
Aaron Vaage
56abfa5ce6 Merge "Resolving createByteBufferFromABuffer null input" 2015-09-08 21:33:29 +00:00
Aaron Vaage
e5b641e6ef Resolving createByteBufferFromABuffer null input
It was found that createByteBufferFromABuffer was recieving a NULL buffer in bug
22726278. Based on returning NULL when buffer->base() == NULL, returning NULL
when buffer == NULL. This does not fix bug 22726278 - but address a problem found
while looking into it.

Bug: 22726278
Change-Id: I933b6a4a535d803576a4cdd7a1ffaf4a428c3201
2015-09-04 10:16:57 -07:00
Tomasz Mikolajewski
b80a3cfd05 Add support for uploading files via MTP.
Change-Id: Id1811ab70cb28be471e0a99999e9ad5380deac49
2015-08-28 10:50:23 +09:00
Tomasz Mikolajewski
87763e6a91 Wire uploading to MtpDocumentsProvider.
This patch does not yet allow to upload files, but uploading (creating)
directories already works.

Bug: 22545670
Change-Id: If4d5a53aa26f791475bb1a783e0ac9540d6760c1
2015-08-20 11:34:44 +09:00
Tomasz Mikolajewski
b04990599a Add API for uploading files to MTP devices.
Bug: 22545670
Change-Id: I038c54db06b7cf780bd027d76693e98c685d57a7
2015-08-14 13:09:52 +09:00
Tomasz Mikolajewski
74d4ff8ab3 Add API for streamed reading on MTP devices.
The existing APIs required to copy all bytes to memory, which will fail in
case of very large files, like movies.

Bug: 22908937
Change-Id: I23bdcbdbf08b7c1b1017591799bbb94e53249a57
2015-08-07 11:47:50 +09:00
Lajos Molnar
d08debcf42 MediaSync: fix flush handling and deadlock
- clear pending video frames
- flush audio track
- reset clock
- restart audio track after flush
- don't hold lock during callback

Bug: 22234976
Change-Id: I681df950b67d7f9f77a9c5783279f1c8c91be856
2015-07-16 17:09:20 -07:00
Chien-Yu Chen
69421363c6 Merge "ImageWriter: Exception when Surface is abandoned" into mnc-dev 2015-07-07 22:16:10 +00:00
Chien-Yu Chen
e0ee63046a ImageWriter: Exception when Surface is abandoned
Throw IllegalStateException when queueing or dequeueing an
image if the input surface is already abandoned by the consumer.

Also fix a crash when planes are not initialized when closing
ImageWriter.

Bug: 22279111
Change-Id: I8301920d64a53c45b29e947e52ff323733abbf16
2015-07-06 18:26:28 -07:00
Jeff Tinker
96a2a957e4 Report specific exception type on decrypt with invalid session
bug: 22235465
Change-Id: Ic1e1a86529d4f2246b9768799aacde5cd1070d04
2015-07-06 14:35:29 -07:00
Chien-Yu Chen
be2e38e01c Merge "ImageReader: Fix format workarounds for legacy devices" into mnc-dev 2015-06-19 19:51:42 +00:00
Eric Laurent
1f98e79abd Merge "audio effect JNI: fix global ref leak." into mnc-dev 2015-06-19 16:46:30 +00:00
Eric Laurent
077999844f audio effect JNI: fix global ref leak.
Remove one more global ref leak in AudioEffect
and Visualizer JNI.

Bug: 21629892.
Change-Id: Id77fc2d10f3dc9d3154d6a1cf0f8cc0f83683584
2015-06-19 09:13:02 -07:00
Jeff Tinker
969a06475c Merge "Improve robustness of MediaDrm after mediaserver crash" into mnc-dev 2015-06-19 16:05:13 +00:00
Chien-Yu Chen
aca98de433 Merge "ImageWriter: Remove exception for closing twice" into mnc-dev 2015-06-18 20:42:21 +00:00
Chien-Yu Chen
0375cb042d ImageWriter: Remove exception for closing twice
because close() will be called again when GC kicks in.

Bug: 20945169
Change-Id: If3c5a13be241977ccf4692d5301c423b7ff38918
2015-06-18 11:55:18 -07:00
Chien-Yu Chen
0782aab077 ImageReader: Fix format workarounds for legacy devices
Legacy shim overrides HAL_PIXEL_FORMAT_BLOB to
HAL_PIXEL_FORMAT_RGBA_8888. Make ImageReader aware of the
workaround when returning the format.

Remove the workaround in legacy shim that overrides YUV_420_888
to YV12 because allocating YUV_420_888 buffers with SW access
is supported on Flo.

Bug: 21707937
Change-Id: I84a8610c82ae986a0064873f611e4f257baf1774
2015-06-17 11:03:04 -07:00
Jeff Tinker
314b7f3af3 Improve robustness of MediaDrm after mediaserver crash
If DEAD_OBJECT is returned from binder calls due to
mediaserver crash, throw new MediaDrmResetException.
This allows the app to detect the condition and handle
it properly.

bug: 20614102
Change-Id: Id08b08fb612672fd94383f0470f5fa3f267b944f
2015-06-17 09:32:58 -07:00
Eino-Ville Talvala
cd17a84a86 Merge "Add more specific consumer names for common buffer queue endpoints." into mnc-dev 2015-06-11 19:36:17 +00:00
Dan Albert
fb48b01424 Merge "Fix format string mismatch. Clang build fix." into mnc-dev 2015-06-11 00:53:27 +00:00