5206 Commits

Author SHA1 Message Date
Andreas Huber
612e16191a Stop metadata retriever from dereferencing a NULL pointer if
the media extractor failed to initialize (malformed or unsupported content)

Change-Id: Icfad4e9eeb8d6713ad12eee7979ab30b696c06e0
related-to-bug: 5263840
2011-09-06 16:05:02 -07:00
Eric Laurent
b6738fc6a5 Merge "Issue 5247986: Battery drain due to audio wakelock" 2011-09-06 14:53:59 -07:00
Eric Laurent
b0808f9c43 Issue 5247986: Battery drain due to audio wakelock
The problem occurs when activating or deactivating A2DP connection
while SoudPool has a channel active. This can happen quite frequently now
that the UI sound effects are enabled by default.
If PCM data is remaining in the AudioTrack buffer when it is restroyed and
re-created on the new AudioFlinger output thread, this data is flushed.
As a consequence, no underrun or request for new data callback is sent to
SoundPool and the sound channel remains active for ever as the end of the
sample is never detected.

Change-Id: I13e0c11e4ce3f83bff7f58d347ca814b6a86712b
2011-09-06 14:37:20 -07:00
Dave Burke
f12abaf405 Merge "Handle setDataSource failures properly. #5261671" 2011-09-06 13:06:20 -07:00
Dave Burke
a28279be32 Handle setDataSource failures properly. #5261671
Change-Id: Iea0aa474d1939db23da9aabdfae2081e834f30d9
2011-09-06 20:39:47 +01:00
James Dong
351f44af54 Merge "Don't overwrite pending port setting change if there are more than one port setting change event." 2011-09-06 09:54:43 -07:00
Jamie Gennis
2e6f49cc81 Merge "MediaPlayer: remove the setTexture method" 2011-09-05 14:50:33 -07:00
Chih-Chung Chang
09bb20b5f6 Merge "Fix 5240036: Generate a reasonable bitrate for intermediate clips." 2011-09-04 19:36:20 -07:00
Pannag Sanketi
3814ff4b17 Fixing bug in SurfaceMediaSource_test
The test was making EGL calls once disconnected. Instead of calling
"disconnect" directly on the Surface, and EGL calls should be made to that
effect.

Change-Id: I21468ac8cbc2cb3145a49269e32a884736cd452e
2011-09-02 17:56:35 -07:00
Eric Laurent
dca56b9432 Fix issue 5252593: any app can restart the runtime
Replace null device address string by empty sting.

Change-Id: I285c35f3345334e6d2190493b1a8a5aca1a361a4
2011-09-02 15:59:50 -07:00
Jamie Gennis
83fb94d188 MediaPlayer: remove the setTexture method
This change removes the MediaPlayer#setTexture method.  It has been
replaced with MediaPlayer#setSurface.

Change-Id: Iaecbbac7629d7092883f270694c5c67391f4ed6c
2011-09-02 15:48:52 -07:00
Andreas Huber
69a5f6c3e0 Properly serialize access to FileSource::getSize by acquiring the mutex
Both ::getSize and ::read call into lseek64, if this happens simultaneously
from multiple threads the results are undefined if not properly serialized.

Change-Id: I737cafebd836f3d8eb702beac557b4731f69c6f6
related-to-bug: 5196490
2011-09-02 09:34:51 -07:00
Dave Burke
fc301b0bb5 Require INTERNET permission for network-based content.
Bug #1870981

Change-Id: Ia3ad166390c4d60cea19c3783895b078a2c4c15f
2011-09-02 11:26:59 +01:00
Chih-Chung Chang
8b1f350993 Fix 5240036: Generate a reasonable bitrate for intermediate clips.
Change-Id: I96bf9a7d0e2ce78fd19cce7bccbd4ac318748709
2011-09-02 18:19:54 +08:00
James Dong
bd9d03010d Don't overwrite pending port setting change if there are more than one port setting change event.
Change-Id: I3413f5235b191031252aa3785f5aaef00caef1ce
related-to-bug: 5122512
2011-09-01 19:39:18 -07:00
Jean-Michel Trivi
466ade5ad6 Fix bug 5045498 Unhide Remote Control Client API
The RemoteControlClient API enables media application to have
 information such as album art, current song, playback state
 be displayed on "remote control displays", as well as be
 controlled by "remote controls".
The new API consists in:
 - a new class, RemoteControlClient
 - new methods in AudioManager to register a RemoteControlClient
 - a new class, RemoteControlClient.MetadataEditor to edit and
  apply the information associated with a RemoteControlClient,
  and which will be displayed on a "remote control display"

Change-Id: I5616085e4ad58ce0bbc1a5953b0a5a28d32f8703
2011-09-01 16:13:50 -07:00
Andreas Huber
ae51008564 Merge "Guard the audio notifications with a separate lock to avoid deadlocks during reset." 2011-09-01 12:20:24 -07:00
Andreas Huber
67a041fa1f Guard the audio notifications with a separate lock to avoid deadlocks during reset.
Change-Id: I9a97372e1f777d1cbd6774cac2ed34b4b8cd9392
related-to-bug: 5179827
2011-09-01 11:39:11 -07:00
Andreas Huber
d38ecf8ce0 Signal an error when encountering a malformed .ts stream.
Change-Id: I3ab0215419214b652573945403eb45eb09d41aff
related-to-bug: 5114811
2011-09-01 11:04:43 -07:00
Jean-Michel Trivi
a6ec356d2f Merge "Fix 5243349 RemoteControlDisplay incorrectly updated" 2011-08-31 19:02:59 -07:00
Jean-Michel Trivi
b716f0b7b2 Fix 5243349 RemoteControlDisplay incorrectly updated
This fixes a case where the RCD would display transport control
 for a RemoteControlClient that didn't have audio focus.
This was happening because registering an RCD was directly calling
 the updateRemoteControlDisplay method, without first calling
 the checkUpdateRemoteControlDisplay method which verifies the
 conditions before updating the display. One of those conditions
 is that the audio focus stack shouldn't be empty.

To verify this fix, several functions were also rename to clearly
 indicate the lock order and verify we properly synchronize on
 the right objects. In doing so, a missing synchronization on
 audio focus was found.

Change-Id: If1baaac224ea676aeb83ac0aefcc53f87461c32e
2011-08-31 18:24:04 -07:00
Rajneesh Chowdury
270bcaa9d1 Merge "Fix for 5156702 Rotate video output for thumbnails and export" 2011-08-31 17:14:52 -07:00
Andreas Huber
9100473a7e Merge "I have one HLS stream that switches stream PIDs from one bandwidth to the next" 2011-08-31 16:44:49 -07:00
Andreas Huber
afbb70b48e Merge "Discontinuities are only signalled on streams that have been identified, i.e." 2011-08-31 16:44:43 -07:00
Andreas Huber
eeddb0e504 I have one HLS stream that switches stream PIDs from one bandwidth to the next
this change intends to support its very limited case and signals an error in
all other cases of unexpected PID changes that we cannot recover from.

Change-Id: Icbfdf9fe7461969e2a8781ed416f54d891dd789a
2011-08-31 16:29:05 -07:00
Andreas Huber
ea8c9b1bd9 Discontinuities are only signalled on streams that have been identified, i.e.
those that have a queue. This ensures that the player doesn't observe discontinuities
that don't match up across streams.

Also, make sure output buffers arriving from the decoder to be rendered are sent
back to the decoder if we started flushing.

Finally, don't parse TS packets for streams we don't support. And don't allocate
memory for them.

Change-Id: I708e0de4cba8110a62e4c8ceb1e5702430d5d2bb
2011-08-31 15:35:49 -07:00
Pannag Sanketi
d318b73e8e Merge "Update SurfaceMediaSource_test to not use pbuffer configs" 2011-08-31 15:09:26 -07:00
James Dong
e3fb1cb1b1 Merge "Fix a crash where the EOS was signalled but some output buffer were still pending." 2011-08-31 14:17:18 -07:00
Eino-Ville Talvala
b2c4f0bf11 Merge "Fix SurfaceMediaSource timestamp handling." 2011-08-31 13:41:06 -07:00
Eric Laurent
16b241a58f Merge "Change condition to enter silent mode." 2011-08-31 12:59:28 -07:00
Jean-Michel Trivi
528e382f48 Merge "Fix 5242200 only update RemoteControlDisplay when a client is present" 2011-08-31 12:03:50 -07:00
Jean-Michel Trivi
3387945766 Fix 5242200 only update RemoteControlDisplay when a client is present
A precondition for updateRemoteControlDisplay_syncRcs() is that
 mRCStack is not null. This condition was not verified when
 registering a RemoteControlDisplay.

Change-Id: I0b152410e57c590114b387e9ab83f0c4d15d060d
2011-08-31 11:52:16 -07:00
Gloria Wang
3727e3d80d Merge "Stop the AudioSource in reset() of AwesomePlayer if AudioSource is not NULL and AudioPlayer was not started. Fix for 5236419." 2011-08-31 10:37:48 -07:00
Gloria Wang
e28857c125 Stop the AudioSource in reset() of AwesomePlayer if AudioSource is not NULL
and AudioPlayer was not started.
Fix for 5236419.

Change-Id: I5eadd069118c3533a19b5d6f6dca2ce16d8505fb
2011-08-31 10:24:18 -07:00
Eric Laurent
3d4c06f907 Change condition to enter silent mode.
Previously, silent mode was entered if volume was already at 0 and
volume down key was pressed once.

The new volume management policy specifies that silent mode is entered when
volume is at last audible step and volume down key is pressed once.

Change-Id: Id3e75a99c522d8afe276868010b6e73495d23fde
2011-08-31 09:47:24 -07:00
Andreas Huber
49fb943db8 Merge "ATSParser now supports a mode in which PTS is considered to be absolute time" 2011-08-31 09:44:57 -07:00
Pannag Sanketi
e753750a82 Update SurfaceMediaSource_test to not use pbuffer configs
SurfaceMediaSource_test now does not use pbuffer configs
to create a surface. Always uses a window config.
Also, cleaned up the test a bit.

Change-Id: Idda40dcb8474249eccaa8d2dad20ee840d2dd484
2011-08-30 22:36:41 -07:00
Jean-Michel Trivi
5ad4b9fb96 RemoteControlClient metadata: add method for metadata of long type
Update to the RemoteControlClient.Editor API:
 - new method for setting metadata of type long
 - methods for setting metadata throw an exception if using
    the wrong key with the wrong method.

Note that this change will cause the Music2 application to
 throw an exception when it tries to set the duration as a string.

Change-Id: I17cff86467851a0aff313c07653e752ae6b6180f
2011-08-30 18:42:33 -07:00
James Dong
58c524ec03 Fix a crash where the EOS was signalled but some output buffer were still pending.
Change-Id: Ide111264501441b51bb10629ae2021accf9e1fb5
related-to-bug: 5234126
2011-08-30 17:06:10 -07:00
Andreas Huber
ebd266c034 ATSParser now supports a mode in which PTS is considered to be absolute time
i.e. PTS 0 <=> media time 0

Change-Id: If10a0f98c129b95e8430dc419664b1def92e547e
2011-08-30 16:06:28 -07:00
Jean-Michel Trivi
2261c7d645 Merge "Bug 5045498 Force display update when display registers" 2011-08-30 15:14:12 -07:00
Jean-Michel Trivi
958bba6862 Bug 5045498 Force display update when display registers
When an IRemoteControlDisplay registers, cause the
 RemoteControlClient to send all its information to the newly
 registered display.
The previous code was only sending a request for update: this
 request didn't here cause the client to send the data because
 a new client generation had not been synchronized among clients
 and displays.
This CL uses the same code path to force an update as when audio
 focus changes, or a new client registers, by calling the same
 method that is called in those cases,
 updateRemoteControlDisplay_syncRcs(flags).
Also in this CL: more method renames to indicate methods that
 are called synchronized on mRCStack.

Change-Id: I54102f45ba1cd4812d958ecd883bec7bc45ae88f
2011-08-30 14:48:31 -07:00
Jamie Gennis
8d102eb672 Merge changes I33f59705,Ia4c8c822,I2fb695ab,I2e587afc
* changes:
  MediaDump: use the MediaPlayer#setSurface method
  HTML5VideoView: switch to MediaPlayer#setSurface
  MediaPlayer: unhide the setSurface method
  Surface: unhide the SurfaceTexture ctor
2011-08-30 14:38:56 -07:00
Rajneesh Chowdury
c847b1a89d Fix for 5156702 Rotate video output for thumbnails and export
This is part of a multi project submit.
This is the Java and Jni changes.

Change-Id: I8851f5d865e657b7846bcded38e752f388f95895
2011-08-30 12:44:44 -07:00
Eric Laurent
0e35c78d25 Merge "226483: A2DP connected, but music out to speaker" 2011-08-30 10:51:54 -07:00
Eino-Ville Talvala
728e08bc3f Fix SurfaceMediaSource timestamp handling.
Was not basing timestamps on startTimeUs.
Now synchronizes properly with audio.

Bug: 4510826
Change-Id: I613db0aa91e51fc75d120e65540e742d8ab2ae43
2011-08-30 10:49:15 -07:00
Eric Laurent
05ce094164 226483: A2DP connected, but music out to speaker
When the A2DP headset is connected, there is a possible
race condition when the audio tracks are moved from
the mixer thread attached to the speaker output to the thread
attached to A2DP output.
As the request to clear the stream type to output mapping cache in
the client process is asynchronous, it is possible that the flag
indicating to the client audio track to re-create the IAudioTrack
on the new thread is processed before the cache is invalidated.
In this case, the track will be attached to the old thread and
music will continue playing over the device speaker instead of being
redirected to A2DP headset.

Change-Id: Ib2ce1eb5320eaff83287b93779061bf4e7a330df
2011-08-30 10:19:38 -07:00
Jean-Michel Trivi
c5d0fac081 Merge "Bug 5156756 Fix AAC ADTS header size computation" 2011-08-30 09:06:36 -07:00
Rajneesh Chowdury
90200ee4e2 Merge "5106773 Can't export a movie - Error returned from OMX API in ducati" 2011-08-29 20:43:11 -07:00
Rajneesh Chowdury
8f7bf02506 5106773 Can't export a movie - Error returned from OMX API in ducati
Video Editor engine wrongly set the profile in place of level.
So level was always 1 (default value for Profile)

Change-Id: I202f866d32e81869d9692174d59d9d777a772282
2011-08-29 20:16:22 -07:00