45 Commits

Author SHA1 Message Date
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
Android (Google) Code Review
1b0efec347 am 17c195c8: Merge change 9340 into donut
Merge commit '17c195c8da3470b2e69880e206342f0c2d85f938'

* commit '17c195c8da3470b2e69880e206342f0c2d85f938':
  Fix issue 2025872: Deadlock in SoundPool.stop
2009-07-31 08:55:51 -07:00
Eric Laurent
fd8c0e1ff8 Fix issue 2025872: Deadlock in SoundPool.stop
There were 2 problems in SoundPool:

1 If not using the shared memory buffer mode, there was a problem when a sound channel was stolen. The new channel could sometimes not be added to the restart
list if the AudioTrack callback thread was stopped before the underrun callback was called.

The SoundChannel::play() method is modified so that SoundPool::done() is called immediately after stopping the channel. There is a possibility that done() is called a second time by the callback; in this case it will be added 2 times to the restart list but the second start request will be ignored as the first one will have reset the next chennel ID when processed.

2 There was a deadlock on SoundPool::mLock if SoundPool::stop() was called while a channel restart was pending:
 SoundPool::stop() lock mLock -> SoundChannel::stop() -> SoundPool::done() -> SoundPool::addToRestartList() -> try to lock mLock == deadlock

A second mutex mRestartLock is added to protect the restart list mRestart. mLock is still used to protect mChannels list but mRestart is now used to
protect access to mRestart by restart thread and client thread.
2009-07-31 06:29:13 -07:00
James Dong
cbe7c5441c Remove hardcoded maximum frame rate limit from the framework
bug 1993400
2009-07-30 11:16:11 -07:00
Eric Laurent
a553c25b33 Fix issue 1795088 Improve audio routing code
Initial commit for review.
Integrated comments after patch set 1 review.
Fixed lockup in AudioFlinger::ThreadBase::exit()
Fixed lockup when playing tone with AudioPlocyService startTone()
2009-07-23 06:03:39 -07:00
Android (Google) Code Review
c7bebd1537 am 5f2b05ea: Merge change 8220 into donut
Merge commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09'

* commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09':
  Fix issue 1996218: Disable use of shared memory buffer by SoundPool.
2009-07-22 13:20:05 -07:00
Eric Laurent
45fce58ca1 Fix issue 1996218: Disable use of shared memory buffer by SoundPool.
Disabled USE_SHARED_MEM_BUFFER compilation switch in SoundPool.cpp.
2009-07-22 11:12:31 -07:00
Marco Nelissen
0fc736f321 Don't pass references to temporary objects, and handle the case where we dont have a Surface. 2009-07-10 13:43:41 -07:00
Android (Google) Code Review
b88993f073 Merge change 6797
* changes:
  rename libsgl/libcorecg to libskia
2009-07-10 12:59:40 -07:00
Mike Reed
b5af325fb1 rename libsgl/libcorecg to libskia 2009-07-10 15:33:21 -04:00
Nicolas Catania
5d55c71198 Basic plumbing to retrieve metadata from the native player.
IMediaPlayer.h
Added a getMetadata method that mirrors the on in MediaPlayer.java.

MediaPlayer.java
Added a native method to get the metadata from the native player.
Parse the parcel into a Metadata object.

Metadata.java
Added a stub to parse the Parcel returned by the native player into
a set of metadata.

android_media_MediaPlayer.cpp
JNI call to forward the getMetadata call.

MediaPlayerService.cpp
MediaPlayerService::Client implements the new getMetadata method added in IMediaPlayer.h
2009-07-10 11:00:42 -07:00
Nicolas Catania
b2c693919b Implemented the metadata changed notification filters.
IMediaPlayer:
new setMetadataFilter method so set a filter (2 lists of allowed and blocked metadata type)
serialized in a Parcel.

MediaPlayer.java/android_media_MediaPlayer.cpp/mediaplayer.cpp
new setMetadataFilter that passes the filter down to the MediaPlayerService's binder interface.

MediaPlayerService.cpp
The Client inner class holds the allowed and blocked metadata types.
These are in 2 vectors that get populated in the setMetadataFilter.

A new shourldDropMetadata method returns true if a type of metadata should be dropped according
to the filters.

The notify method in run the metadata update notifications thru the filter and possibly drop them.
2009-07-09 11:46:02 -07:00
Android (Google) Code Review
2387208c9e am 3d7b8d1a: Merge change 5158 into donut
Merge commit '3d7b8d1aa6a362292f56defbe8fb2d5653f79282'

* commit '3d7b8d1aa6a362292f56defbe8fb2d5653f79282':
  Use a ref-counted callback interface for Camera.
2009-06-24 13:54:09 -07:00
Nicolas Catania
20cb94eeb5 Direct api to the native media player.
MediaPlayer.java has 3 new methods:
* newRequest creates a Parcel that can be used to send data to the
  native player using invoke.
* invoke issues synchronous calls to the native player using opaque
  parcels for the request and reply.

IMediaPlayer.h has 1 new abstract method:
* invoke

The Midi and Vorbis players have a stub for these. So far only PV
makes use of that new feature.

To avoid any copy overhead, the JNI interface uses Parcel as a java
object (no serialization/copy happens at the JNI layer).

The remote interface token is inserted when the Parcel is constructed
in java. That way the parcel is already routable when it reaches
 IMediaPlayer.cpp (proxy). No extra copy is needed there.
2009-06-24 08:22:52 -07:00
Dave Sparks
5e27115995 Use a ref-counted callback interface for Camera.
This allows the camera service to hang onto the callback interface
until all callbacks have been processed. This prevents problems
where pending callbacks in binder worker threads are processed
after the Java camera object and its associated native resources
have been released.
Bug 1884362
2009-06-24 07:58:27 -07:00
Android (Google) Code Review
5f80742306 am d670b8c6: Merge change 3981 into donut
Merge commit 'd670b8c61ebd13324ac21bdbc08d8a02fc0a765a'

* commit 'd670b8c61ebd13324ac21bdbc08d8a02fc0a765a':
  Removed trailing whitespaces.
2009-06-12 11:43:55 -07:00
Nicolas Catania
32f8277488 Removed trailing whitespaces. 2009-06-11 16:54:48 -07:00
Android (Google) Code Review
f5b746e157 am b2df1699: Merge change 1548 into donut
Merge commit 'b2df1699c996e62baa78877978cd2c5607ea4194'

* commit 'b2df1699c996e62baa78877978cd2c5607ea4194':
  NJ-1409: (frameworks/base) Support new audio encoding types(AMR and AAC).
2009-06-08 16:00:19 -07:00
Jianhong Jiang
2bcda90c02 NJ-1409: (frameworks/base) Support new audio encoding types(AMR and AAC). 2009-06-08 08:50:42 -07:00
Android (Google) Code Review
4599184a1c am 450ad31b: Merge change 2774 into donut
Merge commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e'

* commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e':
  Limit check on maxChannels for SoundPool.
2009-06-01 09:58:43 -07:00
Android (Google) Code Review
450ad31b62 Merge change 2774 into donut
* changes:
  Limit check on maxChannels for SoundPool. Bug 1838724
2009-06-01 09:57:24 -07:00
Dave Sparks
3c8704b171 Limit check on maxChannels for SoundPool.
Bug 1838724
2009-06-01 08:16:19 -07:00
Android (Google) Code Review
27b3eaf4de am 0f5179c7: Merge change 2716 into donut
Merge commit '0f5179c7d333ddab729b5943766637c21d1b74db'

* commit '0f5179c7d333ddab729b5943766637c21d1b74db':
  Update MediaPlayer to allow setVideoSurface calls after prepare. Also allow
2009-05-29 14:18:55 -07:00
Dave Sparks
8b0b174198 Update MediaPlayer to allow setVideoSurface calls after prepare. Also allow
passing a null surface. The API is now enabled to change the surface while
the video is playing. This could allow orientation changes during playback
or to allow the audio track from a video to play in the background.
NOTE: There are still changes required to pmem driver to allow remapping
shared physical memory into a process in order for this to work. This
change only enables the API to send the appropriate calls when the lower
level code supports it.
2009-05-29 13:51:38 -07:00
Android (Google) Code Review
c5d0343b67 am de8268d6: Merge change 2331 into donut
Merge commit 'de8268d6d1cd168510c490b17e93154d2eab767c'

* commit 'de8268d6d1cd168510c490b17e93154d2eab767c':
  Fix issue 1846343 - part 1
2009-05-26 10:11:44 -07:00
Eric Laurent
4bc035a65c Fix issue 1846343 - part 1
This change is the first part of a fix for issue 1846343, :
- Added new enum values for input sources in AudioRecord and MediaRecorder for voice uplink, downlink and uplink+downlink sources.
- renamed streamType to inputSource in all native functions handling audio record.

A second change is required in opencore author driver and android audio input to completely fix the issue.
2009-05-26 07:44:28 -07:00
Mathias Agopian
25ba5b6564 checkpoint: split libutils into libutils + libbinder 2009-05-20 12:55:02 -07:00
James Dong
429a3b5f1d Fix a JNI layer crash due to null camera object passed to get_native_camera()
The fix will check on the camera object and if it is a null object, we
throw a NullPointerException; application layer should also avoid passing a null
java object to MediaRecorder.setCamera().
2009-05-11 10:58:03 -07:00
Eric Laurent
9648e4b677 fix issue 1641535: SoundPool should use AudioTrack with shared memory buffer
Enabled USE_SHARED_MEM_BUFFER switch in SoundPool.cpp
2009-05-07 03:14:31 -07:00
James Dong
c02cac481c Change 79 in git master branch 2009-04-30 23:42:56 -07:00
Dianne Hackborn
08905cc336 Automated import from //branches/donutburger/...@140818,140818 2009-03-24 18:36:53 -07:00
The Android Open Source Project
105925376f auto import from //branches/cupcake_rel/...@140373 2009-03-18 17:39:46 -07:00
The Android Open Source Project
ba87e3e6c9 auto import from //branches/cupcake_rel/...@138607 2009-03-13 13:04:22 -07:00
The Android Open Source Project
4df2423a94 auto import from //depot/cupcake/@136594 2009-03-05 14:34:35 -08:00
The Android Open Source Project
9066cfe988 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d83a98f4ce auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
076357b856 auto import from //depot/cupcake/@132589 2009-03-03 14:04:24 -08:00
The Android Open Source Project
3dec7d563a auto import from //depot/cupcake/@137055 2009-03-02 22:54:33 -08:00
The Android Open Source Project
da996f390e auto import from //branches/cupcake/...@131421 2009-02-13 12:57:50 -08:00
The Android Open Source Project
d24b8183b9 auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project
b798689749 auto import from //branches/cupcake/...@125939 2009-01-09 17:51:23 -08:00
The Android Open Source Project
f013e1afd1 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project
54b6cfa9a9 Initial Contribution 2008-10-21 07:00:00 -07:00