113 Commits

Author SHA1 Message Date
James Dong
465206940a am b408f549: am d790c648: Add lost preview surface detection in the JNI layer Throws an IOException if this happens rather than crashes
Merge commit 'b408f5490b8591a2799d6b1db91e29e4b203d2bf'

* commit 'b408f5490b8591a2799d6b1db91e29e4b203d2bf':
  Add lost preview surface detection in the JNI layer
2010-08-12 13:30:57 -07:00
James Dong
d790c6485a Add lost preview surface detection in the JNI layer
Throws an IOException if this happens rather than crashes

Change-Id: I32bb4c889ae596f992a0d05283c9130a99b2d0d5
2010-08-12 11:59:56 -07:00
Mike Lockwood
4b322ce4fb MTP: Push queries for supported formats and properties up to Java.
Change-Id: I4f117090340e3916afda3d194521a6092a672ddc
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-10 09:00:30 -04:00
Mike Lockwood
c642e8a44c MTP: Fix some typos
Change-Id: Ib31708c3a925e3c0ab8eea6922ab09e02b740936
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-09 14:17:52 -04:00
Mike Lockwood
9a2046fb5c MTP: Add support for syncing MTP playlists
MTP playlists now correspond to playlists in the media provider
(like those created by the Music app).

Change-Id: I085cb3cff003037ad62f0e297fb0cfd3047cb3a2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-03 15:36:22 -04:00
Mike Lockwood
23ee42f904 MTP: Fix some thread safety issues in MTP server start/stop sequence.
Change-Id: Ied1cddc6220fa7394e8de99df9bc37a1208b04ff
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-03 15:35:38 -04:00
Mike Lockwood
7a047c8986 MTP: Implement GetNumObjects
Change-Id: Iccc3a445f9a1eab7bb76eddd567c6a3a8f155b2b
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-02 10:52:20 -04:00
Mike Lockwood
59c777a24a Clean up MtpDatabase API.
Return MTP response codes instead of booleans for success or failure.
Remove some unused code.

Change-Id: I82ce80a4d7779233264e3caf139ebd0cece12f5c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-08-02 10:37:41 -04:00
Eric Laurent
ba2709583d am 6fa88882: am 62d83a0c: Merge "Audio effects: modified command() parameter types." into gingerbread
Merge commit '6fa8888254deb4961dc64c6ac03dc103c9cd8bcf'

* commit '6fa8888254deb4961dc64c6ac03dc103c9cd8bcf':
  Audio effects: modified command() parameter types.
2010-07-28 07:53:24 -07:00
Eric Laurent
a4c72acfbc Audio effects: modified command() parameter types.
The type of the cmd, cmdSize and *pReplySize parameters of the effect control interface command()
function have been modified from int to uint32_t. This is more consistent with their role.

Change-Id: I84d289fc262d6753747910f06f485597dfee6591
2010-07-28 05:49:21 -07:00
Eric Laurent
b008e9b128 resolved conflicts for merge of d306cc81 to master
Change-Id: Ib593b7719a837de12605e8c75904634843298ba1
2010-07-27 02:41:41 -07:00
Eric Laurent
ca57d1cc89 Audio Effects: added methods to effects java classes to store and load current effect settings in
a single call.

Addional changes:
- Fixed simulator build
- Use effect interface UUIDs from OpenSL ES includes when available
- Added cleanspec rules to remove now obsolete test effect libraries
- Fixed bug in AudioEffect JNI setParameter function.

Change-Id: Ic25ddb135e2cec5a68c181d727321f5ac7a1ab6b
2010-07-27 00:41:31 -07:00
Mike Lockwood
bc4cb0bc79 MTP host: Add support for reading files from an MTP device via ParcelFileDescriptor
Also added some support for sending files to the device that hasn't been debugged yet.
Add locking to MtpDevice to prevent it from attempting multiple transactions simultaneously.

Change-Id: I2b995ba0af086cc6920bd6b8c869f540ad78560a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-26 20:40:45 -04:00
Eric Laurent
0119ba5bd3 am 34161132: am 7070b365: Added support for auxiliary audio effects to AudioTrack and MediaPlayer.
Merge commit '34161132030254bac7dd64c9713832e2f961a061'

* commit '34161132030254bac7dd64c9713832e2f961a061':
  Added support for auxiliary audio effects to AudioTrack and MediaPlayer.
2010-07-21 09:52:17 -07:00
Eric Laurent
7070b36549 Added support for auxiliary audio effects to AudioTrack and MediaPlayer.
Added methods to AudioTrack and MediaPlayer java classes to enable use of
auxiliary audio effects. The effect can be attached and detached by specifying its
ID and the send level controlled.

Change-Id: Ie74ff54a453096a742688476f612ce355543b6f3
2010-07-21 06:28:01 -07:00
Mike Lockwood
ff164a7d6f Exclude MTP implementation from simulator build
Change-Id: I93364c74c26ba6e2bf6b08f1bd82802b966c8dfb
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-15 15:27:38 -04:00
Mike Lockwood
be125a50b4 MTP: Add support for sending events to the host when objects are added and removed
Change-Id: Ia1d5232b919c644c670ff9ca651eca92b3f9ad42
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-13 20:04:22 -04:00
Mike Lockwood
d815f79766 Integrate host to device file transfer with the media provider.
MTP file transfers happen in two stages.  The SendObjectInfo command sends
some information about the file and reserves an ObjectHandle for the new file.
The file transfer is then performed using the SendObject command.

To support this in the media provider, MtpDatabase.beginSendObject receives
the information from SendObjectInfo and creates an row for it in the MTP objects
table for the new file.  After the file transfer has completed, then
MtpDatabase.endSendObject is called.  In endSendObject, we run the media scanner
on the new file, which will add a row to the images, audio, video
or audio playlist table.

To avoid the media scanner creating a second row for the file in the MTP objects
table, we pass the ObjectHandle created in beginSendObject to the media scanner,
which then passes it to the media provider via the content values when it
performs its insert.

Change-Id: I1ebcc63d6bd4404b0d3a93c703a9d3c097381d3a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-12 14:01:22 -04:00
Jean-Michel Trivi
90787e053a am bd3f8b71: am e7b790f1: Merge "Fix swap of sessionId and output in audio effect API." into gingerbread
Merge commit 'bd3f8b711643a172703537e34a0fa7c21c5b953f'

* commit 'bd3f8b711643a172703537e34a0fa7c21c5b953f':
  Fix swap of sessionId and output in audio effect API.
2010-07-09 12:34:03 -07:00
Jean-Michel Trivi
4cb15cf15d Fix swap of sessionId and output in audio effect API.
Change-Id: Idc93415efef92087507401e50cfb235a6f1f7ed7
2010-07-09 12:11:49 -07:00
Mike Lockwood
c5c7853b63 Remove some scafolding and test code that is no longer worth maintaining.
Change-Id: I9ee62d2463d8df1246a84774e8ac7e674778279a
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-09 11:07:55 -04:00
Mike Lockwood
d21eac9c70 MTP: Use media provider database to implement MTP device support.
Uses a new "MTP objects" table in the media provider to support basic
enumeration of the external storage file system.
Support for accessing audio, video and image metadata in the existing
media provider tables will be added in a later commit.

The C++ MtpDatabase class is now abstract, to support a proxy subclass that
calls through JNI to the Java MtpDatabase class in the media provider.

Change-Id: I90f0db5f3acc5d35ae78c27a8507edff16d14305
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-08 16:21:09 -04:00
Eric Laurent
98449546fa am b91881fd: am dacabf97: Merge "Added Visualizer effect." into gingerbread
Merge commit 'b91881fdd1608cc922f105ec552b5505da1fecb9'

* commit 'b91881fdd1608cc922f105ec552b5505da1fecb9':
  Added Visualizer effect.
2010-07-07 20:55:40 -07:00
Eric Laurent
dacabf97c6 Merge "Added Visualizer effect." into gingerbread 2010-07-07 16:23:30 -07:00
Eric Laurent
df9b81ced4 Added Visualizer effect.
The visualizer enables application to retrieve part of the currently playing audio for visualization purpose.
It is not an audio recording interface and only returns partial and low quality audio content as a waveform or
a frequency representation (FFT).

Removed temporary hack made in MediaPlayer for animated wall papers based on audio visualization (snoop() method.

This commit also includes a change in AudioEffect class:
 - the enable()/disable() methods have been replaced bya more standard setEnabled() method.
 - some fixes in javadoc

Change-Id: Id092a1340e9e38dae68646ade7be054e3a36980e
2010-07-07 11:00:28 -07:00
Mike Lockwood
dad69277b7 MTP: Fix ownership and file permissions for transferred files and folders
All new files and folders are created with group sdcard_rw
Permissions for new files are 0664 and directories 0775

Change-Id: I6d508231150f687e2e529112fd47f10e30fa594f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-02 15:19:32 -04:00
Chih-Chung Chang
4024ddcf66 am bda93c4c: am 09b90057: Add multiple camera support for in MediaProfiles.
Merge commit 'bda93c4cb94b47c86251d22df16e46a514c191ef'

* commit 'bda93c4cb94b47c86251d22df16e46a514c191ef':
  Add multiple camera support for in MediaProfiles.
2010-07-01 11:55:27 -07:00
Mike Lockwood
d0e1a9f40e MTP: Remove an unnecessary thread from the MtpClient class.
Now a single thread is used for passing USB host events up to MtpClient.

Change-Id: I0e3a277956cb3d1036da122ea10acb03a27844d6
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-07-01 11:39:42 -04:00
Chih-Chung Chang
09b9005769 Add multiple camera support for in MediaProfiles.
Change-Id: Ie89568a0f5f5fd08ede77e33f9a559215d6bed9a
2010-07-01 10:57:15 +08:00
Mike Lockwood
81ea83d108 Move MTP JNI code from libandroid_runtime to libmedia_jni
Signed-off-by: Mike Lockwood <lockwood@android.com>

Change-Id: I0c54bbe4e6146beba7d22e782e02ded420f50dbd
2010-06-30 17:54:10 -04:00
Eric Laurent
8e103da1f1 Merge "Various fixes and improvements in audio effects implementation" into gingerbread 2010-06-25 12:35:30 -07:00
Eric Laurent
53334cdb81 Various fixes and improvements in audio effects implementation
Effect API:
- Use different definitions for audio device, channels, formats... in AudioSystem and EffectApi:
  Removed media/AudioCommon.h file created for initial version of EffectApi
- Indicate audio session and output ID to effect library when calling EffectCreate(). Session ID can be useful to optimize
the implementation of effect chains in the same audio session. Output ID can be used for effects implemented in audio hardware.
- Renamed EffectQueryNext() function to EffectQueryEffect() and changed operating mode:
  now an index is passed for the queried effect instead of implicitly querying the next one.
- Added CPU load and memory usage indication in effects descriptor
- Added flags and commands to indicate changes in audio mode (ring tone, in call...) to effect engine
- Added flag to indicate hardware accelerated effect implementation.
- Renamed EffectFactoryApi.h to EffectsFactoryApi.h for consistency with EffectsFactory.c/h

Effect libraries:
- Reflected changes in Effect API
- Several fixes in reverb implementation
- Added build option TEST_EFFECT_LIBRARIES in makefile to prepare integration of actual effect library.
- Replaced pointer by integer identifier for library handle returned by effects factory

Audio effect framework:
- Added support for audio session -1 in preparation of output stage effects configuration.
- Reflected changes in Effect API
- Removed volume ramp up/down when effect is inserted/removed: this has to be taken care of by effect engines.
- Added some overflow verification on indexes used for deferred parameter updates via shared memory
- Added hardcoded CPU and memory limit check when creating a new effect instance

Change-Id: I43fee5182ee201384ea3479af6d0acb95092901d
2010-06-25 11:59:35 -07:00
Andreas Huber
8d65dd2653 Remove most stagefright property overrides, remove VorbisPlayer and VorbisMetadataRetriever as this functionality is now provided by stagefright.
Change-Id: Ieafe75a4550c273ad59b4518d7cd4c0fce0f7cce
related-to-bug: 2370115
2010-06-23 16:40:57 -07:00
Eric Laurent
619346f902 Added support for audio sessions in MediaPlayer and AudioTrack.
Audio sessions are used to associate audio effects to particular instances (or groups) of MediaPlayers or AudioTracks.

Change-Id: Ib94eec43241cfcb416590f435ddce7ab39a07640
2010-06-22 17:14:04 -07:00
James Dong
49b6fbaebd AmrInputStream refresh: eliminate the dependency upon OpenCore's code
Change-Id: I0e66bc0a16fcdcf70136012ae1cd4138506cc94b
2010-06-18 18:56:54 -07:00
Eric Laurent
01f7ac6448 Merge "Issue 2667802: [Audio Effect Framework] AudioEffect base class and JNI." into kraken 2010-06-14 09:02:13 -07:00
Eric Laurent
948235c06e Issue 2667802: [Audio Effect Framework] AudioEffect base class and JNI.
Added AudioEffect C++ class. AudioEffect is the base class for effect specific implementations,
OpenSL ES effect interfaces and audio effect JNI.

Added the AudioEffect JNI and AudioEffect JAVA class. AudioEffect is the base class
to implement more specific JAVA classes to control audio effects from JAVA applications.

Change-Id: If300a1b708f2e6605891261e67bfb4f8330a4624
2010-06-11 06:26:31 -07:00
James Dong
457d5ae3c9 Fix a potential(observed sometimes) media server crash
The problem is that we are referring an temp object returned from a function call.
When the function call returned, the temp object is gone; and thus the reference
may be invalidated.

-- rebased

bug - 2734946

Change-Id: I1993c4462df95610ca478f816adc30058af5850e
2010-06-09 11:27:03 -07:00
Mathias Agopian
5e14010b1f allow re-targetting of surfaces
Surfaces can now be parcelized and sent to remote
processes. When a surface crosses a process
boundary, it looses its connection with the
current process and gets attached to the new one.

Change-Id: I39c7b055bcd3ea1162ef2718d3d4b866bf7c81c0
2010-06-08 20:10:02 -07:00
Mathias Agopian
8b138323d5 don't hardcode "mSurface" throughout our source code
this is used in a few places to get access to the android.view.Surface
native surface. use a macro instead. Also rename the field to mNativeSurface.

Change-Id: I1c6dea14abd6b8b1392c7f97b304115999355094
2010-04-12 16:29:36 -07:00
Dave Sparks
db6cc0ba71 Use local lock for most MediaMetadataRetriever methods. Bug 2560834.
MediaMetadataRetriever uses a single static lock for all operations.
This effectively serializes all metadata retrieval operations in a
single process. This patch uses the object level lock for all normal
operations and only uses the static lock to serialize calls to
release.

Change-Id: I81c9f234c2f0007a26d18e1398c709b41a4dbbd7
2010-04-01 18:08:22 -07:00
Steve Howard
09468dbbe9 Add a name to the previously-unnamed thread created by SoundPoolThread.
SoundPool itself also creates a thread, which was called "SoundPoolThread", unrelated to the SoundPoolThread class.  The SoundPoolThread class then created an unnamed thread, which showed up as "android:unnamed_thread".  That's confusing, so this change renames the SoundPool thread to "SoundPool" and then names the SoundPoolThread thread as "SoundPoolThread".  Say that ten times fast :)

Change-Id: I67b7e644a30c94b6eda44bf970764a52a1c2958b
2010-03-11 13:59:54 -08:00
James Dong
0fc6bc4cac Clean up MediaRecorder for public Java SDK
- update comments and fix a check in setAudioChannels()

bug - 2362412
2010-03-03 17:01:32 -08:00
James Dong
b93003649d Merge "Image encoding settings java API through xml configuration file" 2010-02-25 15:11:29 -08:00
James Dong
9b433f0b65 Image encoding settings java API through xml configuration file
- I decided to completely remove jpeg decoding related stuff from this change
  I think that setting is better off if it is specified by the system properties.
  We don't have to include MediaProfiles.h header in skia files
2010-02-24 18:10:12 -08:00
Gloria Wang
196863d274 Fix for the safty check. It checks that nFir21 + jNpoints <= BUF_SIZE,
but when it calls GetByteArrayRegion, it multiplies it by 2 which
 defeats the "// safety first" check at the beginning.
2010-02-22 15:59:03 -08:00
Dave Sparks
7bef5a58f1 Fix logging in SoundPool. 2010-02-17 09:09:24 -08:00
Dave Sparks
675ee6ac36 Merge "Add SoundPool API to pause and resume all active streams. Bug 2426531." 2010-02-16 16:41:19 -08:00
Dave Sparks
f992cbb9aa Add SoundPool API to pause and resume all active streams. Bug 2426531. 2010-02-16 16:19:32 -08:00
James Dong
62ed7a6d4a Merge "Support decoder queries from media profiles xml configuration file" 2010-02-16 10:59:13 -08:00