1635 Commits

Author SHA1 Message Date
Dave Burke
ec3f31f621 Added support for HE-AAC recording.
Not unhiding HE-AACv2 since that requires stereo mics.

Bug: 6275957

Change-Id: I953a6d21e615c8fd23f9390e3c86d63089f5fb75
2012-04-30 09:24:01 -07:00
James Dong
6d6f233a62 Merge "Unhide APIs for timed text and multiple audio track switch APIs" into jb-dev 2012-04-27 17:49:28 -07:00
James Dong
7a9734d769 Unhide APIs for timed text and multiple audio track switch APIs
o made all the member variables in helper classes for TimedText to be public and final
  since they are read-only
o removed Text and TextPos helper classes
o added two public methods in TimedText class: getText() and getBounds()
o cleaned up the javadoc of related methods in MediaPlayer.java and TimedText.java classes
o make the inner classes of TimedText static and final
o change invoke and let it throw RuntimeException on failure (thus a test class needs to be
  modified also).

o related-to-bug: 6110705,5542712

Change-Id: Ia1dd1fd5eb8e9fd1b61c6c0d67405edb627a3002
2012-04-27 15:48:46 -07:00
Jeff Sharkey
098d580cc2 Migrate ringtone playback to SystemUI.
Introduce IRingtonePlayer, which handles playback for both Ringtone
objects and Notifications. SystemUI now hosts this player, which it
registers with AudioService. It also keeps MediaPlayer instances
warm, and cleans them up after stop() or Binder death.

Move both Ringtone and NotificationManagerService to play back audio
through this new interface.

Bug: 6376128, 6350773
Change-Id: I1dcb86d16ee3c4f07cdb2248d33dcff4ead3609a
2012-04-27 14:15:05 -07:00
Jeff Sharkey
f5d70fd2ad Merge "Protect system services with DUMP permission." into jb-dev 2012-04-27 10:16:40 -07:00
Eric Laurent
6d5176638c system and UI sounds volume policy
Implement a more consistent policy for system and UI sounds (key clicks, lock/unlock,
camera shutter, DTMF, low battery...):
- All system sounds are played over STREAM_SYSTEM stream type.
- The STREAM_SYSTEM volume that was previously fixed now tracks the volume of a "master"
stream type. This "master" stream type is STREAM_RING for phones and STREAM_MUSIC for
tablets which corresponds to the stream whose volume is modified by default by the volume
keys.
- The STREAM_SYSTEM volume ranges from -24dB to -6dB (-24dB to -12dB over headphones) when the
"master" stream volume ranges from its min to its max.
- DTMF tones are played over STREAM_DTMF that tracks the "master" stream volume in the same
manner with the following exception: when in call, DTMF stream tracks STREAM_VOICE_CALL volume.
- Camera shutter sound is played over STREAM_SYSTEM_ENFORCED stream that tracks the "master"
stream volume except in countries where regulation enforces this sound. In this case
its volume is fixed and cannot be muted.
- Low battery sound is played over STREAM_SYSTEM and therefore has a tunable volume and is
heard while in call.

Issue 6344620.
Issue 6069229.
Issue 6213100.

Change-Id: I53a237878ead596e706c5dbbb1420e62cde32bd7
2012-04-26 18:36:56 -07:00
Jeff Sharkey
eb4cc492c9 Protect system services with DUMP permission.
Change-Id: I5e53859f8b8e5473e54eca43ebd7de841f1a05ff
2012-04-26 18:17:29 -07:00
Dave Burke
2996cf03a2 Merge "Unhide new AAC-ELD audio record type." into jb-dev 2012-04-26 10:58:57 -07:00
Andreas Huber
129a6ccbb8 Merge "The MediaExtractor can now unselect tracks and has more control over seeking." into jb-dev 2012-04-26 10:56:58 -07:00
Andreas Huber
f2855b3df5 The MediaExtractor can now unselect tracks and has more control over seeking.
Change-Id: I12c28bf31fe9fb4057352999fa38213ae289a417
related-to-bug: 6276111
2012-04-26 10:43:31 -07:00
Eric Laurent
8037cad6c1 Merge "Fix AudioManager.forceVolumeControlStream()" into jb-dev 2012-04-26 10:22:13 -07:00
Dave Burke
6644a826a1 Unhide new AAC-ELD audio record type.
Change-Id: Ibb9d3cd797c0b14c495776dc172ff7dadf6df7d6
2012-04-25 23:15:22 -07:00
Eric Laurent
45c90cefd1 Fix AudioManager.forceVolumeControlStream()
AudioManager.forceVolumeControlStream() is used by VolumePanel to temporarily force the
stream type which volume is controlled by volume keys.

Current implementation is not working if the VolumePanel is not executed by the same process
as the one receiving the volume key events.

Issue 6302421.

Change-Id: I2700587a027ffb962429b42083312cd92fe79215
2012-04-25 18:28:09 -07:00
Marco Nelissen
0b718392c1 Further speed up playlist processing
Previously when processing playlists, the entire audio table would be read for
every line in a playlist file. While there would be only one query, a lot of
data was being moved from sqlite to java over and over again, and if the data
didn't all fit in a CursorWindow, additional queries would be done under the
hood.
With this change, playlists are first cached in memory. Then the audio table
is queried, and for every row in the audio table, the best match from the
playlist cache is found. This way the audio table is only traversed once,
so each row is only fetched once. Once the entire audio table has been read,
the in-memory playlist cache contains the best matching entry for each line,
and the playlists are written out to the database. Currently, the audio table
is traversed once for each playlist. This could be further optimized in the
future by processing all playlists at the same time.

b/6346786

Change-Id: Iead3f9ae838d600d085e8e6d3c4874d42314468e
2012-04-25 16:30:42 -07:00
Jeff Sharkey
d7a2a428db Merge "Move RINGTONE_PICKER to handle external storage." into jb-dev 2012-04-25 15:25:46 -07:00
Jeff Sharkey
6dcf382b1b Move RINGTONE_PICKER to handle external storage.
To give RINGTONE_PICKER external storage access, move it from system
to MediaProvider.  Fix OOBE when getRingtoneUri() kicked requery().

Bug: 6346701
Change-Id: I837002eef0580b8cdd8920a27b068c745995a8a3
2012-04-25 14:56:13 -07:00
Jean-Michel Trivi
1b8f499a14 Allow multichannel configurations in android.media.AudioTrack
Compare the channel configuration against a mask of the public
 channel masks in AudioFormat for up to 5.1 with back channels,
 and allow combinations within this mask.

Change-Id: I84b72dfd88d4490f0c67bf10d13151a9eb06f6a8
2012-04-25 11:12:37 -07:00
Marco Nelissen
08f70fa5b8 Speed up playlist processing
When matching entries in playlists, only consider audio files.

b/6346786

Change-Id: Ia744d002c2821a81840303b9409593da48a08b73
2012-04-23 13:53:20 -07:00
Andreas Huber
74a78b0f6e Add the ability to query the amount of cached data to MediaExtractor.
Change-Id: I47ae60bc6fb8d88979c1f0d650b6ac528e811371
related-to-bug: 6364341
2012-04-20 11:57:26 -07:00
James Dong
f3dbb59f1d Merge "Update javadoc for timed text / multiple audio track APIs" 2012-04-19 14:17:43 -07:00
Andreas Huber
0d1ba15056 Merge "DRM errors signaled by the CryptoPlugin are now visible to MediaCodec clients" 2012-04-19 13:51:10 -07:00
James Dong
831f0a90ca Update javadoc for timed text / multiple audio track APIs
o Throw runtime exception when selectTrack, unselectTrack, getTrackInfo fails
o remove redundant code for selectTrack and unselectTrack methods

o related-to-bug: 6110705,5542712

Change-Id: I59f0ed638e93d0365eccab1e33c9d50354a9c1ba
2012-04-19 13:46:23 -07:00
Andreas Huber
bfc56f497d DRM errors signaled by the CryptoPlugin are now visible to MediaCodec clients
through a custom exception "MediaCodec.CryptoException".

Change-Id: I30215e9e13bab68abad23e27dcead7c1accd07f1
related-to-bug: 6365261
2012-04-19 13:42:14 -07:00
Jean-Michel Trivi
c9496495ba Merge "Unhide Visualizer scaling mode definitions and methods" 2012-04-19 10:52:25 -07:00
Jean-Michel Trivi
951794616f Unhide Visualizer scaling mode definitions and methods
Unhide Visualizer set/get methods, and associated constant
 definitions.

Change-Id: Iaafe5f7a2f1273f72c3f7f842b416b93614dfa65
2012-04-19 10:34:50 -07:00
Eric Laurent
6db653355b Merge "unhide API for synchronous audio capture." 2012-04-19 10:16:38 -07:00
Jean-Michel Trivi
5cef554cc8 Merge "Add support for scaling mode parameter in Visualizer effect" 2012-04-19 09:09:06 -07:00
Eric Laurent
ff2577da37 unhide API for synchronous audio capture.
unhide MediaSyncEvent class and AudioRecord.startRecording() method with synchronization
event allowing to start audio capture upon occurence of a specific event.
So far the only event defined is playback presentation complete but more events and synchronized
playback/capture methods could be defined in the future.

Change-Id: If05fc6cd125dd9afad451727f792a3fd9e916bef
2012-04-19 08:59:20 -07:00
Eric Laurent
8dfc10571a unhide audio pre processing API.
Unhide APIs for Noise Suppressor(NS), Acoustic Echo Canceler (AEC) and
Automatic Gain Control (AGC) audio pre processings.

Also unhide getAudioSessionId() method on AudioRecord.

Change-Id: I788f7a0724b152cc98c8167d9434e64c12bada95
2012-04-18 20:26:43 -07:00
Andreas Huber
91befdc0c4 Information required to decrypt buffers is now packaged into MediaCodec.CryptoInfo
New API on MediaExtractor to retrieve a CryptoInfo structure where applicable.

Change-Id: I18edfc9ac56a4544c8f17cba24401b96dacbff7d
related-to-bug: 6275919
2012-04-18 12:19:51 -07:00
James Dong
f7d3bdfc22 Merge "AddExternalSource(String path) needs to turn the path to fd if it is a file" 2012-04-17 18:36:48 -07:00
James Dong
c4c0284e45 AddExternalSource(String path) needs to turn the path to fd if it is a file
o related-to-bug: 5542712

Change-Id: Iea32012996ca9de4c86f144de916df64fcab3c52
2012-04-17 18:31:20 -07:00
Jean-Michel Trivi
e1123e7f36 Add support for scaling mode parameter in Visualizer effect
Add set/get methods to set how the Visualizer scales the captured
 data.

Change-Id: Ia1da00fd5474dd3484b59caf7d1d0a812d0347de
2012-04-17 14:44:23 -07:00
Andreas Huber
2952c5d03c MediaCrypto's constructor can throw RuntimeException.
Change-Id: I5718e9abab0d1465882580e826747d6a78bdefb5
related-to-bug: 6275919
2012-04-17 11:24:11 -07:00
Andreas Huber
07ea426e3a Unhide new media related java APIs.
Change-Id: If0b8201eaca74f51f3499b6ecdfb73088586ee24
2012-04-16 10:14:05 -07:00
James Dong
f3d9f5d097 Merge "Fix failure from setDataSource(String path) when path is a local file" 2012-04-12 12:08:31 -07:00
James Dong
e00b6f3a57 Fix failure from setDataSource(String path) when path is a local file
o the failure was because the mediaserver does not have read permission to sdcard
o related-to-bug: 6325960,6322913

Change-Id: I4feec01b8165c78563eee8aab69cb24df3244d03
2012-04-12 11:50:17 -07:00
James Dong
0041b5c561 Fix thumbnail generation failure
o Change the impl of MediaMetadataRetriever.setDataSource(String).
  It opens and passes an fd to the media framework
  rather than pass the file path directly to the media server. The change is needed since media
  server does not have read permission to sdcard
o Remove the unnecessary jni method

Change-Id: I5a2f47dde804523d264b588f855ba2575a99c179
2012-04-11 14:56:34 -07:00
Eric Laurent
855255d89f audio preprocessing: added static factory method
Added static methods to check availability and create audio preprocessing
effects.

Change-Id: I945e97fe41912ff8880befacaba162a08b5a1267
2012-04-10 12:34:07 -07:00
Eric Laurent
079f09c6ca Merge "Added support for USB audio devices" 2012-04-09 08:39:05 -07:00
Eric Laurent
59f482764e Added support for USB audio devices
Two types of USB audio devices are defined:
- USB audio device: the audio device in USB device mode while
the Android device is in USB host mode.
- USB audio accessory: the audio device in USB host mode while
the Android device is in USB device mode.

Renamed intents for analog and digital docks to avoid confusion:
 - ACTION_USB_ANLG_HEADSET_PLUG to ACTION_ANALOG_AUDIO_DOCK_PLUG
 - ACTION_USB_DGTL_HEADSET_PLUG to ACTION_DIGITAL_AUDIO_DOCK_PLUG

Factorized code in AudioService broadcast receiver.

Change-Id: I1b6d0257a9d68ecb9495c78c98bac8c67fec7891
2012-04-06 18:24:48 -07:00
Andreas Huber
9e6bcce17d New JAVA API to support submitting encrypted buffers of input data.
Change-Id: Ib0df9a9427b4580946179860495b26f743558597
related-to-bug: 6275919
2012-04-06 12:14:47 -07:00
Justin Koh
1c35d117f0 am db9b114b: Merge "Adds flag argument to setMasterMute." into ics-aah
* commit 'db9b114b2e1f9c2034c3cd6df00245b039d90c28':
  Adds flag argument to setMasterMute.
2012-04-05 10:43:06 -07:00
Justin Koh
0273af55cf Adds flag argument to setMasterMute.
Adds flag argument to setMasterMute. This allows third parties to edit it
without showing the UI, for example.

TESTED = runs on Tungsten.

Change-Id: Idfd99a2476e60059cd93c9dfe07d03a389c3f5f5
2012-04-04 18:40:36 -07:00
Justin Koh
75cf9e19a5 Fix the build.
Change-Id: Ibe818df8f360837688f12533cf0ac22ef89a8439
2012-04-04 15:27:37 -07:00
Justin Koh
5ac69a23e0 Merge "resolved conflicts for merge of bff6a514 to master" 2012-04-04 14:54:19 -07:00
Justin Koh
6a8096d7d5 resolved conflicts for merge of bff6a514 to master
Change-Id: I741d5ab8ed0ce25a27330ffb55ba210534d11c3d
2012-04-04 14:50:32 -07:00
Marco Nelissen
e313f721ad Store video width/height when scanning
b/5820120

Change-Id: If2faf554bbf49b341d2634915ba98c1efd70574e
2012-04-04 14:27:00 -07:00
Andreas Huber
8240d9239d New Crypto JAVA class to facilitate decryption via MediaCodec.
Change-Id: Ic4e395faa84f003793c2804f2badabab9e7f1034
related-to-bug: 6275919
2012-04-04 14:06:32 -07:00
Justin Koh
57978ed862 Persists the master mute volume setting.
Persists the master mute volume setting across reboots.

TESTED = runs on Tungsten.

Change-Id: I9628b9369ca528b22413f62a9e7d697bae61d8ac
2012-04-03 17:37:58 -07:00