92 Commits

Author SHA1 Message Date
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
James Dong
d32fba411f Support decoder queries from media profiles xml configuration file 2010-02-12 18:15:45 -08:00
Andreas Huber
fbb3885024 New API on java's MediaPlayer to suspend/resume a session.
related-to-bug: 2231576
2010-02-12 12:44:10 -08:00
Mathias Agopian
000479f9e3 split libsurfaceflinger_client and libcamera_client out of libui 2010-02-11 13:16:22 -08:00
James Dong
e7038ace44 Camcorder profile Java API support
- Use Enum for Quality instead of int
- Use static values() method from Enum, rather than if-else

bug - 2417312
2010-02-04 13:47:36 -08:00
James Dong
c371194e4e Initial check-in for xml-based encoder capabilities retrieval
- Changed the Java API as suggested
- Treat /etc/media_profiles.xml as the default xml configurtion file
2010-02-01 22:38:37 -08:00
Andreas Huber
2564300936 API Extension: Support for optionally specifying a map of extra request headers when specifying the uri of media data to be played.
related-to-bug: 2393577

Original change by Andrei Popescu <andreip@google.com>
2010-01-28 11:52:43 -08:00
Andreas Huber
55e99c6100 Attempt to fix the build ... again. 2010-01-27 13:30:59 -08:00
Andreas Huber
37105cc771 Fixing the build. Why is this suddenly necessary and didn't break the build before??? 2010-01-27 12:39:39 -08:00
Andreas Huber
e4a838051d Reorganize some of the stagefright implementation related to metadata. 2010-01-08 11:54:36 -08:00
Dave Sparks
3c56221af7 Fix SoundPool restart problem CheckJNI issue. 2009-12-23 17:22:57 -08:00
Dave Sparks
f6e43bf290 Add OnLoadCompleteListener to SoundPool. 2009-12-23 09:11:29 -08:00
Dave Sparks
c333133107 am b5fc8ffc: am 91487425: Merge change I0448ef20 into eclair
Merge commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8'

* commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8':
  Fix SoundPool buffer size rounding error. Bug 2327620.
2009-12-15 15:05:37 -08:00
Dave Sparks
66d28cedd9 Fix SoundPool buffer size rounding error. Bug 2327620.
AudioTrack was modified earlier to calculate minimum buffer size
based on the hardware reported latency. Previously, it was a
hard-coded value. As a result of this change, the minimum buffer
size is now variable based on hardware latency. On Passion, this
brought out a subtle rounding error in the buffer size calculation
in SoundPool. This can cause AudioTrack creation to fail based on
the requested sample rate. This fix calculates the total buffer
size first, and then does rounding before dividing by the number
of buffers.
2009-12-14 21:48:17 -08:00
Dave Sparks
3c256cf321 More SoundPool cleanup. Remove mSoundPoolRef and unused notify callback. 2009-12-07 13:01:01 -08:00
Dave Sparks
c0e3ddf8f2 Remove unused Java object reference in native SoundPool code. 2009-12-07 12:36:20 -08:00
Andreas Huber
bfb9fb143b Refactor MediaScanner. Some steps on the way towards being able to build the tree without OpenCore. 2009-12-03 13:21:54 -08:00
Marco Nelissen
c39d2e3c01 Music visualizer support hack.
This currently assumes 44k stereo (won't crash on other formats, but won't give the correct results either), and links statically with libspeex to get FFT data, increasing the size of libmedia by about 45kb.
2009-10-06 08:51:16 -07:00
Dianne Hackborn
a52b4d764e Fix broken build.
I -did- run it...  why did this later break on me?!?

Change-Id: I70db0279f9a1b499496f9808525d2b112495d6c7
2009-09-23 15:17:39 -07:00
Marco Nelissen
8b04661700 When encountering a .nomedia file, notify the MediaScannerClient,
so that it can erase the data column for entries that are in the
folder containing the .nomedia file. This prevents us from
deleting (via a delete trigger) files when somebody adds a
.nomedia file after the fact.
2009-09-03 11:22:28 -07:00
Marco Nelissen
831fbc1c20 We don't need libopencore_author and libcutils in libmedia_jni 2009-08-03 12:11:43 -07:00
Marco Nelissen
4935d05eaa Untangle MediaPlayer, MediaRecorder, MediaScanner and MediaMetadataRetriever JNI
code, so that creating one of those doesn't initialize all the others. Shaves
a hundred milliseconds or so off music app startup time.
2009-08-03 11:32:30 -07:00