2504 Commits

Author SHA1 Message Date
Eric Laurent
383c4b3e63 Merge "reorganize SoundPool and JetPlayer code." 2012-03-26 11:23:49 -07:00
Eric Laurent
f5e1812549 reorganize SoundPool and JetPlayer code.
Reorganize SoundPool and JetPlayer code to be ready for the
creation of libmedia_native.

Split SoundPool between libsoundpool (JNI) and libmedia(sound pool implementation).
Remove dependencies on nativehelper/jni.h from JetPlayer.

Change-Id: I130c6014173b714329929dd82c5dfb70b757a610
2012-03-26 10:54:41 -07:00
Glenn Kasten
4acee00352 Add TRACK_FAST for IAudioFlinger::createTrack
Currently not implemented by client or server

Change-Id: Ib11dda57db3eeb871bcc7b546e340078776875f5
2012-03-26 07:25:48 -07:00
Glenn Kasten
39581f9248 Merge "IAudioFlinger::createTrack and openRecord flags" 2012-03-26 07:16:37 -07:00
Colin Cross
8dd6574809 remove jni.h include from IOMX.h
jni.h is not used in IOMX.h and is not available in pdk builds,
remove it.

Change-Id: I9bc8fd70f617942712d9f684c6fc927bf18be753
2012-03-24 15:35:17 -07:00
James Dong
062ed957e0 Fixed missing return value from a method should have returned status_t
Change-Id: I83ad2735eaf8a8dfa5f8f29f30aec1311b3222de
2012-03-24 10:15:18 -07:00
Colin Cross
a982dc05d7 frameworks/base: move Zip* from libandroidfw to libutils
ZipUtils is needed by build/tools, move it from libandroidfw
(frameworks/base) to libutils (frameworks/native).

Change-Id: I2b4b7adcdf68eb25ee7cba5dd3b69eadf0523af3
2012-03-22 18:43:07 -07:00
Glenn Kasten
bf30911bf1 Merge "Remove enforceFrameCount" 2012-03-22 11:06:49 -07:00
Marco Nelissen
da9deca7ba Support gapless playback for mp3 and m4a
Gapless playback for appropriately tagged mp3 and m4a files.
Currently this is implemented in OMXCodec, which most players
use, but should be easy to support in other players as well by
using the SkipCutBuffer utility class.

Change-Id: I748c669adc1cfbe5ee9a7dea2fad945d48882551
2012-03-22 10:06:03 -07:00
Glenn Kasten
2333a27ee5 Remove enforceFrameCount
It was only used to decide whether to issue a warning.
The warning was issued the first time track was created but
not at re-creation.  Now it is a verbose message every time,
not a warning since it happens all the time with key clicks on A2DP.

Change-Id: I9d39f53c0a7eb84b666e55b1b76ff830cf8f37ba
2012-03-21 15:41:02 -07:00
Marco Nelissen
3e6792232a Merge "Add MetaData::dumpToLog" 2012-03-21 15:12:44 -07:00
Marco Nelissen
d0a524fb59 Add MetaData::dumpToLog
Utility method for dumping the content of a MetaData object to the log.

Change-Id: I2d91b991e1d9fed2215e8995a73c2b1854205074
2012-03-21 15:00:27 -07:00
Glenn Kasten
32d72b2f53 Merge "Whitespace" 2012-03-21 07:22:40 -07:00
Marco Nelissen
54fa725483 Merge "Parse mp3 encoder padding/delay" 2012-03-20 09:15:05 -07:00
Marco Nelissen
2ed77701f9 Parse mp3 encoder padding/delay
Get the mp3 encoder padding and delay from a XING frame or iTunSMPB tag.

Change-Id: Icde598c8857d7e7c187a718f478ee9799d6a1b8a
2012-03-20 08:46:11 -07:00
Glenn Kasten
f743e1f6ab Whitespace
Fix indentation, and add blank lines in key places for clarity

Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
2012-03-19 17:53:33 -07:00
Glenn Kasten
84569cc4e1 IAudioFlinger::createTrack and openRecord flags
createTrack and openRecord don't need the "old" flags parameter,
which was either audio_policy_output_t or audio_in_acoustics_t
shifted left by 16 bits.  But they do need "new" flags, which
are defined by the application use case.  Initially, the only
application use case flag is timed output, but others are planned.

For output, the audio_policy_output_t flags are passed to
AudioSystem::getOutput, which returns an audio_io_handle_t, and that
handle is then passed to createTrack. So createTrack doesn't need the
old flags parameter.

For input, the audio_in_acoustics_t flags are passed to
AudioSystem::getInput, which returns an audio_io_handle_t, and that
handle is then passed to openRecord. So openRecord doesn't need the
old flags parameter.

Change-Id: I18a9870911846cca69d420c19fe6a9face2fe8c4
2012-03-19 09:04:23 -07:00
Eric Laurent
b388138ff2 resolved conflicts for merge of 3fe7ee65 to ics-mr1-plus-aosp
Change-Id: Ia7e1cd869779e9f512e840b768f5b43992c8a122
2012-03-16 17:19:25 -07:00
Eric Laurent
0df689495a AudioTrack: relax check on minimum buffer size
Current AudioTrack implementation enforces that the requested audio
buffer size is at least corresponding the audio latency.
This requirement is too strong and leads to problems with current
stagefright and AudioSink implementations when playing over output
streams with long latency.

Ultimately, the AudioSink design should be changed to specify a minimum
buffer size in time or frames units but not in buffer count units.

Change-Id: I8ba603956f92ac49143a8249572665aa548f2f0f

Conflicts:

	media/libmedia/AudioTrack.cpp
2012-03-16 12:22:07 -07:00
Jeff Brown
543ec1c808 Merge "If an application calls System.exit() terminate it immediately." 2012-03-16 11:01:20 -07:00
Wu-cheng Li
8d3c318b2d Merge "Add a new camera open API that allows taking the ownership." 2012-03-15 21:23:24 -07:00
Jeff Brown
4280c4a93e If an application calls System.exit() terminate it immediately.
There is no graceful way to kill Android application processes.
They typically have many threads running doing various things
When System.exit() is called, those threads just keep going
while the cleanup actions run until the process finally.

Performing shutdown actions can easily cause more harm than good.
For example, closing the Binder driver's file descriptor may
cause other threads waiting on Binder to wake up and then crash
in nasty ways after receiving EBADF.

So when an Android application exits, skip the cleanup and just
call _exit() to end it all.

Bug: 6168809
Change-Id: I29790c064426a0bf7dae7cdf444eea3eef1d5275
2012-03-15 19:59:23 -07:00
Eino-Ville Talvala
4d2ece12a6 Merge "Move CameraParameters.h to frameworks/native." 2012-03-15 10:34:00 -07:00
Wu-cheng Li
a1c41e13b5 Add a new camera open API that allows taking the ownership.
The purpose is to let face unlock always get the camera
successfully. What happened was the camera applications may
have opened the camera in onResume under the lock screen.
This API lets face unlock take the camera from the camera
application. A new permission will be added, so other
applicatoins won't be able to take the camera from the face
unlock.

bug:5584464

Change-Id: Ib3d9dcbc2161815b68db42327dc01148453704c6
2012-03-15 14:50:48 +08:00
Eino-Ville Talvala
bf4431bd93 Move CameraParameters.h to frameworks/native.
CameraParameters.h is indirectly required to implement the Camera
HAL. Move it to frameworks/native.

Bug: 6171735
Change-Id: I1bf4db228333be16fc7caa3c51280a9495293011
2012-03-14 17:14:19 -07:00
Insun Kang
41f3f716b0 Defines MediaPlayer APIs to support multiple audio/video/timedtext
tracks.

o Newly introduced APIs are (MediaPlayer):
  getTrackInfo() / addExternalSource() / enableTrack() / disableTrack().

o Timed text tracks are supported only, for now.

o TODOs:
 - Define the audio/video behavior for enableTrack and disableTrack.
 - Refactoring AwesomePlayer / TimedTextDriver so that all types of
   track index can be managed in the correct order and be ready for
   supporting audio/video tracks.
   (MediaExtractor and MediaSource for text file might be necessary.)

Change-Id: Idb85e1b3f2ed49a64f377d05472dd6663ce94e07
2012-03-15 08:36:52 +09:00
Glenn Kasten
81fe4fbd6b Merge "AudioFlinger playback thread CPU measurement in Hz" 2012-03-14 16:28:38 -07:00
Glenn Kasten
f57e2bceb9 AudioFlinger playback thread CPU measurement in Hz
Log statistics on CPU usage in Hz in addition to wall clock time

Use CPU statistics for all playback threads, not just MIXER
(but they are disabled by default by a compile-time debug macro).

ThreadCpuUsage library:
 - Move statistics out of the library and leave that up to the caller
 - Add API to determine a CPU's frequency

Change-Id: Ia1011123146e641fcf210ef26e78ae2b4d3b64ad
2012-03-14 16:03:01 -07:00
Glenn Kasten
6940484150 Merge "Use correct syntax for #include <> """ 2012-03-14 13:54:21 -07:00
Glenn Kasten
c81d31c3f8 Use correct syntax for #include <> ""
Change-Id: I943137108668ae66f8eba18dafe069a7951bcd8f
2012-03-13 16:14:19 -07:00
Jeff Brown
9dc348d756 Merge "Fix spurious ANRs in native activities." 2012-03-13 15:15:48 -07:00
Jeff Brown
2b6c32ca41 Fix spurious ANRs in native activities.
Some native activities experienced ANRs when the input consumer
deferred an input event due to client-side batching.  If the
input channel was fully emptied then the client had no way of
knowing that it should wake up to handle the deferred input event.

This patch also fixes some lock issues in the native activity
input queue implementation.  In at least one error case, it
was possible for a function to exit without releasing the lock.

Bug: 6051176
Change-Id: I4d9d843237e69b9834f8d8b360031b677fcab8c3
2012-03-13 15:00:09 -07:00
Marco Nelissen
1c1d1e7ed7 Merge "Gapless playback, step 1." 2012-03-13 13:23:07 -07:00
Marco Nelissen
84b8320545 Gapless playback, step 1.
Currently able to play Ogg Vorbis, PCM WAV and other lossless files seamlessly
by reusing the initial AudioTrack for subsequent players.

Change-Id: Ie7cf6b9076bdf4f9211574456d192c02c04fecc7
2012-03-13 13:13:14 -07:00
James Dong
7cd59760be Merge "Switched to use the header files in /frameworks/native and deleted the duplicate header files in /frameworks/base" 2012-03-13 12:44:54 -07:00
Glenn Kasten
18db49a462 Whitespace and indentation
Fix indentation to be multiple of 4.
Make it easier to search:
  sp< not sp < to
  "switch (...)" instead of "switch(...)" (also "if" and "while")
Remove redundant blank line at start or EOF.
Remove whitespace at end of line.
Remove extra blank lines where they don't add value.

Use git diff -b or -w to verify.

Change-Id: I966b7ba852faa5474be6907fb212f5e267c2874e
2012-03-13 11:09:47 -07:00
James Dong
e1dea48f92 Switched to use the header files in /frameworks/native
and deleted the duplicate header files in /frameworks/base

o related-to-bug: 6044887

Change-Id: I17e0692d9a9b5c8796ded36677c833ca8ab36795
2012-03-12 21:28:57 -07:00
Glenn Kasten
db9c21e754 Merge "Remove virtual from methods that don't need it" 2012-03-12 15:05:21 -07:00
Glenn Kasten
28b269f341 Use audio_policy_output_flags_t consistently
This affects:
 - IAudioFlinger::openOutput
 - AudioTrack::AudioTrack
 - AudioTrack::set
 - apps that call these

Change-Id: I26fb281bac6cb87593d17697bc9cb37a835af205
2012-03-09 15:32:22 -08:00
Glenn Kasten
df0d3ab4d0 Merge "Use AudioRecord::record_flags consistently" 2012-03-09 15:23:45 -08:00
Glenn Kasten
8d8557ad57 Remove virtual from methods that don't need it
Change-Id: I30e17e61aae25b036436c0e270313c80c43e5f06
2012-03-09 12:48:18 -08:00
Glenn Kasten
f60a5d7162 Use AudioRecord::record_flags consistently
Change-Id: I6f369a2b99eb515603bc7d5629a07db2b96783fe
2012-03-08 18:11:55 -08:00
Eric Laurent
d10a5992f9 Merge "audio policy: use audio_devices_t when appropriate" 2012-03-08 17:45:44 -08:00
Eric Laurent
c9ab9f5c2c audio policy: use audio_devices_t when appropriate
Change-Id: I1b3a5879e81c789fb53d356af3d3a1ee2dca955f
2012-03-08 15:57:09 -08:00
Mathias Agopian
8c79817dc6 remove files that moved to frameworks/native
Change-Id: I140d291e520097b1148930f736823650e08488f7
2012-03-07 19:36:08 -08:00
Glenn Kasten
ffed04ac3c IAudioFlingerClient::ioConfigChanged param2 const
The 3rd parameter (param2) to AudioFlingerClient::ioConfigChanged
is used as an input.  So changed it from void * to const void *.
It is then cast to const OutputDescriptor *
or const audio_stream_type_t * depending on the event.

Change-Id: Ieec0d284f139b74b3389b5ef69c7935a8e5650ee
2012-03-06 16:43:19 -08:00
Eric Laurent
54682583ba Merge "AudioTrack: relax check on minimum buffer size" 2012-03-06 10:52:18 -08:00
James Dong
b7fdddab0d Merge "Remove unused code - MediaSourceSplitter" 2012-03-06 10:23:58 -08:00
James Dong
5fe7057960 Remove unused code - MediaSourceSplitter
Change-Id: Icf37832a1c234501ee3ff91ff13eece2242425ae
2012-03-05 19:30:08 -08:00
Eric Laurent
bd6b74ce46 AudioTrack: relax check on minimum buffer size
Current AudioTrack implementation enforces that the requested audio
buffer size is at least corresponding the audio latency.
This requirement is too strong and leads to problems with current
stagefright and AudioSink implementations when playing over output
streams with long latency.

Ultimately, the AudioSink design should be changed to specify a minimum
buffer size in time or frames units but not in buffer count units.

Change-Id: I8ba603956f92ac49143a8249572665aa548f2f0f
2012-03-05 17:18:36 -08:00