381 Commits

Author SHA1 Message Date
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
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
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
Eric Laurent
d1f0023ddf Merge "MediaPlayerService: fix AudioSink latency" 2012-03-06 10:53:39 -08:00
Eric Laurent
380b705924 MediaPlayerService: fix AudioSink latency
The AudioSink latency is currently cached when the associated AudioTrack
is created. However, the AudioTrack latency can change if the AudioTrack is moved
from one output stream to another.
The AudioPlayer must also periodically update its view of the latency
as it is needed to compensate the real audio time used for A/V sync.

This fixes an A/V sync problem seen when switching A2DP on and off while
playing a video.

Change-Id: I28b24049ca114e1af3e24791dcc900f463536ba4
2012-03-05 17:27:11 -08:00
Jean-Michel Trivi
4ed260feda Add channel mask in AudioSink
Add support for specifying a channel mask when opening an AudioSink.
  This parameter does not replace the channel count parameter in order
  to not have to duplicate the logic to derive a mask from the
  channel count everywhere an AudioSink is used without a known mask.

A mask of 0 (CHANNEL_MASK_USE_CHANNEL_ORDER) means a mask will
  be automatically derived from the number of channels.

Update existing AudioSink implementations to use the channel mask,
  and users of AudioSink to specify the mask if available, and
  CHANNEL_MASK_USE_CHANNEL_ORDER otherwise.

Change-Id: Ifa9bd259874816dbc25ead2b03ea52e873cff474
2012-03-02 17:26:49 -08:00
John Grossman
720aa28279 Switch the way we configure for MediaPlayer retransmission.
This is a cherry-pick of I6ab07d89b2eeb0650e634b8c3b7a0b36aba4e7dd
with merge conflicts addressed by hand and additional changes made in
response to code review feedback.

Move in the direction of a more publishable API for configuring a
media player for retransmission.  It used to be that we used a custom
invoke and a modified URL (prefixed with aahTX://).  There are many
issues with this technique and it was never meant to stand the test of
time.

This CL gets rid of all that.  A new (but currently hidden) method was
introduced to the java level MediaPlayer API, called
setRetransmitTarget(InetSocketAddress), which allows an app writer to
set the retransmit target.  For now, this method needs to be called
before a call to setDataSource (which is pretty unusual for the
MediaPlayer API) because this mid level code uses this as a cue to
instantiate an aahTX player instead of relying on the data source to
select a player.  When retranmit functionality becomes part of the
existing android player implemenation, this
set-retrans-before-set-data-source behavior can go away, along with
the aahTX player itself.

Change-Id: I3b46c5227bbf69acb2f3cc4f93cfccad9777be98
Signed-off-by: John Grossman <johngro@google.com>
2012-03-01 14:41:35 -08:00
Mathias Agopian
8335f1cccc fix libgui header location
Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
2012-02-27 13:03:08 -08:00
Andreas Huber
5c850396b3 Add new APIs AMessage::(set|find)Buffer to make it safer to pass
ABuffer objects through messages.

Change-Id: I9f8b4e4c4767d0d70a0105e0c0813b754379b49d
2012-02-22 16:20:59 -08:00
Andreas Huber
0ae6b481e4 Merge "Implementation of a java media codec interface and associated tools." 2012-02-22 15:13:44 -08:00
Andreas Huber
88572f7a3e Implementation of a java media codec interface and associated tools.
Change-Id: I13e54062d4de584355c5d82bb027a68aeaf2923b
2012-02-22 15:06:06 -08:00
James Dong
a4d205d02c Allow to record time lapse videos without using setProfile()
o also added a check on whether capture rate was set before starting time lapse video recording.

o related-to-bug: 6045507

Change-Id: I8e1fdc8e8931e2684ab3822dc6260db44658e87d
2012-02-22 10:20:46 -08:00
John Grossman
d72031cee3 Upintegreate AAH TX and RX players from ICS_AAH
Upintegrate the android at home TX and RX players developed in the
ICS_AAH branch.

Change-Id: I8247d3702e30d8b0e215b31a92675d8ab28dccbb
Signed-off-by: John Grossman <johngro@google.com>
2012-02-16 13:45:12 -08:00
Jean-Michel Trivi
e901a5c29b Playback rate on MediaPlayer
Add support for modifying the playback rate of a MediaPlayer
 by altering the sample rate of its AudioTrack.
The playback rate is expressed in permille, where 1000 is the
 playback at normal speed.

Change-Id: I981d060ab32f7bae7a767e82c60c88ae635dceed
2012-02-13 12:39:54 -08:00
James Dong
8e9d67a135 Move away from MediaDebug and use ADebug instead
Change-Id: I963a3b6f79a7292891973cbeeaf3378b38629f08
2012-02-10 11:43:09 -08:00
Glenn Kasten
a6dafea172 Fix incorrect includes of AudioTrack.h
Remove unnecessary includes of AudioTrack.h.
Use forward declaration of class names in preference to #include when possible.

Change-Id: I12982811fa75c2c7695d8bbfa595a7aaec047dc0
2012-01-18 16:06:47 -08:00
Glenn Kasten
bc1d77b6cb Use audio_stream_type_t consistently
At native level it was a mixture of audio_stream_type_t, int, uint32_t,
and uint8_t.  Java is still int.  Also fixed a couple of hard-coded -1
instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0
instead of AUDIO_STREAM_VOICE_CALL.

Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
2012-01-13 10:20:14 -08:00
Glenn Kasten
1c66547ba2 Merge "Use audio_format_t consistently" 2012-01-12 10:30:28 -08:00
Steve Block
ec193dec4d Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGE
See https://android-git.corp.google.com/g/157519

Bug: 5449033
Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
2012-01-09 21:36:22 +00:00
Steve Block
3762c31172 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-08 13:19:13 +00:00
Steve Block
8564c8da81 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2012-01-06 10:07:54 +00:00
Glenn Kasten
1c5a89d4af Use audio_format_t consistently
Was int, uint32_t, uint16_t, and uint8_t with 2-bit bitfield.
Also replace 0 by AUDIO_FORMAT_DEFAULT and replace 1 by
AUDIO_FORMAT_PCM_16_BIT.

Change-Id: Ia8804f53f1725669e368857d5bb2044917e17975
2012-01-05 13:34:54 -08:00
Steve Block
6215d3ff4b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Steve Block
5baa3a62a9 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Glenn Kasten
d9a723bc92 Merge "Fix build error when verbose logging is enabled" 2011-12-15 10:46:14 -08:00
Glenn Kasten
16dabac224 Fix build error when verbose logging is enabled
Change-Id: I30f4e5d35d1b24dce2e6152a13fd0fb61414a3e2
2011-12-15 08:34:59 -08:00
Owen Lin
130f62ab01 Fix the build. (Change LOGV to ALOGV)
Change-Id: I14104540cfbd2bcdd7af1534db20554b88c4c0ce
2011-12-12 16:17:34 +08:00
Andreas Huber
1f7817e146 am ebfce84f: am 68f592a8: Merge "Don\'t perform RTSP seeks right away but queue them for 200ms" into ics-mr1
* commit 'ebfce84f7fd3e25fa08c36b155db91df90a59b3d':
  Don't perform RTSP seeks right away but queue them for 200ms
2011-12-09 18:09:21 -08:00
Andreas Huber
61a8b5301b am aa82c39b: am 0ba9380a: Merge "Fix Bitreader "putBits" implementation, make sure we emulate timestamps" into ics-mr1
* commit 'aa82c39bdb4ad9c1fdcb09f3bea11be5197d3ce6':
  Fix Bitreader "putBits" implementation, make sure we emulate timestamps
2011-12-09 18:09:19 -08:00
Andreas Huber
68f592a821 Merge "Don't perform RTSP seeks right away but queue them for 200ms" into ics-mr1 2011-12-08 13:33:16 -08:00
Andreas Huber
21902a8a48 Don't perform RTSP seeks right away but queue them for 200ms
and only execute the last one.

Change-Id: I9ab342396ec9c9c03624a4b0306d1e180ceca000
related-to-bug: 5732960
2011-12-08 13:04:50 -08:00
Andreas Huber
f6ae711450 Fix Bitreader "putBits" implementation, make sure we emulate timestamps
if we don't receive npt time mapping from the rtsp server (i.e. live stream)

Change-Id: I5147d665bd90c9a303ad6ffdafbf770f930f917c
related-to-bug: 5660357
2011-12-08 12:27:47 -08:00
Andreas Huber
db85b54395 resolved conflicts for merge of 3d630e86 to master
Change-Id: I9eb7b7c1668b5f0de85ec8b1e9257cf1ec4d8b9e
2011-11-30 09:53:40 -08:00
Andreas Huber
848bffd8fa am 074133b2: am 351143fb: Merge "Updated (internal) API for IStreamSource to signal discontinuities" into ics-mr1
* commit '074133b260f8d12e484e93b9aa5a33a4983b7349':
  Updated (internal) API for IStreamSource to signal discontinuities
2011-11-29 16:33:02 -08:00
Andreas Huber
a3f887bd30 resolved conflicts for merge of 998a929a to master
Change-Id: Id5cfbcf20e5ec28782cc88075040cf9edebfdfe8
2011-11-29 15:14:44 -08:00
Andreas Huber
564fee3666 Merge "Make sure we can properly shutdown even if" into ics-mr1 2011-11-29 14:09:10 -08:00
Andreas Huber
351143fb0e Merge "Updated (internal) API for IStreamSource to signal discontinuities" into ics-mr1 2011-11-29 14:08:45 -08:00
Andreas Huber
a10613fea8 Updated (internal) API for IStreamSource to signal discontinuities
Change-Id: Idd4b9d8e7cec16b3e3c91c70e75144d42be30f96
related-to-bug: 5553055
2011-11-29 11:59:10 -08:00
Andreas Huber
66a051af37 Finer granularity discontinuity support.
No clients can signal a format change on either audio or video track (or both)
and a time discontinuity (timestamps changed) independantly.

Change-Id: I3e6cf4e7c260e85759879d61a9b517f68431c22f
related-to-bug: 5553055
2011-11-28 16:45:13 -08:00
Andreas Huber
551aeac336 Make sure we can properly shutdown even if
a) one of the two decoders has a pending discontinuity
b) the renderer holds on to all output buffers for that decoder
c) the renderer is paused

if all three conditions are met the decoder won't ask for more input data
and therefore never see the discontinuity.

To avoid this we briefly resume the renderer just before shutting down.

Change-Id: I9e08af2a1eb4298d1cd00497d6aa33f4ad184e9a
related-to-bug: 5655016
2011-11-28 16:27:35 -08:00
Glenn Kasten
376c393039 MidiFile uses C++ Thread not createThreadEtc
This permits leveraging future improvements to Thread.

Change-Id: I323b709e935c47fa3c6041cb8b82fda994e78b56
2011-11-16 15:43:31 -08:00
Glenn Kasten
714211068e am bb1b7d5c: am 19998120: Merge "Bug 5478024 drop after decode if can\'t drop before" into ics-mr0
* commit 'bb1b7d5cb3c5502484269bfd0cdcd0d5a6d6bfad':
  Bug 5478024 drop after decode if can't drop before
2011-11-09 21:19:00 +00:00
Glenn Kasten
f2c2b1c484 am 19998120: Merge "Bug 5478024 drop after decode if can\'t drop before" into ics-mr0
* commit '19998120f53caceb620f138c6eea182f1e693660':
  Bug 5478024 drop after decode if can't drop before
2011-11-09 16:41:19 +00:00
Glenn Kasten
bb1b7d5cb3 am 19998120: Merge "Bug 5478024 drop after decode if can\'t drop before" into ics-mr0
* commit '19998120f53caceb620f138c6eea182f1e693660':
  Bug 5478024 drop after decode if can't drop before
2011-11-09 14:35:18 +00:00
Andreas Huber
ea427b0c87 resolved conflicts for merge of 26f70db9 to master
Change-Id: Ib1536b1a4c9eeff80e0726b3e61cee12057cd120
2011-11-08 10:40:20 -08:00
Andreas Huber
26f70db99f Merge "Remove surface legacy APIs and code." into ics-mr1 2011-11-08 08:48:31 -08:00
Glenn Kasten
f330986fa8 Bug 5478024 drop after decode if can't drop before
Change-Id: Iaa64553be1a710da5d42be4e3a1e1d6dc873e371
2011-11-04 18:05:35 -07:00
Andreas Huber
efa4015ae3 DO NOT MERGE Poll input data with a small timeout and don't consume a full core.
Change-Id: I3c288698920fe6ead0df24a52330483609821a41
related-to-bug: 5549263
2011-11-03 18:15:43 -07:00
Andreas Huber
57f2887c33 am e395f645: Poll input data with a small timeout and don\'t consume a full core.
* commit 'e395f645aa4c30a4fad8beb3da6f8fad72338617':
  Poll input data with a small timeout and don't consume a full core.
2011-11-03 18:12:39 +00:00