summaryrefslogtreecommitdiffstats
path: root/media/libmedia/mediaplayer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.1_r61' into HEADJessica Wagantall2016-08-021-3/+3
|\ | | | | | | | | | | Android 6.0.1 Release 61 (MOB30Z) Change-Id: Ic86e42d5fb8f81fe5c4f58d2e76852829c609760
| * Don't use sp<>&Marco Nelissen2016-06-231-3/+3
| | | | | | | | | | | | | | because they may end up pointing to NULL after a NULL check was performed. Bug: 28166152 Change-Id: Iab2ea30395b620628cc6f3d067dd4f6fcda824fe
* | stagefright: Squashed commit of pause/resume featuresSteve Kondik2015-11-071-3/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 2 APIs (suspend/resume) in MediaPlayer - API:suspend() will just pause the player and release all the decoders to replace release() which will release the whole player - API:resume() will just init the decoders again, then start() will be called to restart streaming playback - Add a check in AwesomePlayer::onVideoEvent() to make sure the first seek operation will always seek to the next i-frame Change-Id: Ie4c82906a2a056378119921a656128ebdc1007c4 audio: Add pause support for hardware omx component - ADSP doesn't enter sleep state after wma playback is paused and power suspended. - No support for NT session pause in case of hardware component. NT session need to be paused to put ADSP into power collapse. - Add support of pause in stagefright to ensure device enters suspend mode. Also add intermediate states to avoid concurrency issues between read and pause. Change-Id: I41b946b8c8805e6ee303646b63513b5b16514ef6 libstagefright: Drain input buffer on resume - Buffers returned from codec in paused state are not drained. When codec is resumed these buffers are not drained until the next flush, and may cause timed out issue. - Added change to drain input buffers for sw decoders when resuming. Change-Id: Ida2ab1d5dc3a1910accdd6fb89548262a912d8e7 CRs-Fixed: 569585, 574967 libstagefright: camcorder pause-resume implementation - Add pause resume feature in camcorder app. So that user can pause recording and resume later which results in a single recorded clip. Change-Id: Id19c45ae5bb85265aa4d5304b160ebf119d9575a libstagefright: support pause/resume for timelapse recording Modify the timestamp calculation mechanism in CameraSourceTimeLapse in order to support pause/resume. Change-Id: Icb02ea798b0b807ffb7ada2d1ef5b2414b74edfb
* | libmedia: Fix mismatched stateSteve Kondik2015-10-231-0/+4
|/ | | | | | * Seen during flaky network test Change-Id: I491529d6164e2312242c659bb3ca051e60da3612
* Explicitly disconnect in MediaPlayer::resetRobert Shih2015-07-231-0/+1
| | | | | | | | | | | | Even without calling disconnect in MediaPlayer::reset, MediaPlayerService::Client (which lives on the other side of a binder with MediaPlayer) would still perform a disconnect in its destructor. Object destruction across binder is not synchronous, but method calls are. This commit merely makes sure that the disconnect happens deterministically before reset returns. Bug: 22451733 Change-Id: Id9146a63a1872d68087a252aa614248b16d2556d
* mediaplayer: fix audio attributes override by stream typeEric Laurent2015-07-151-9/+14
| | | | | | | | Make sure that when audio attributes are set, the stream type is always derived from them. Bug: 22481669. Change-Id: Ia10c7017eb27e7753faf97a42dd4f44e15f2c986
* stagefright: support setting/getting playback/sync config in MediaSyncLajos Molnar2015-04-301-11/+43
| | | | | | | Bug: 18249558 Bug: 19666434 Bug: 20057497 Change-Id: I5868b17423d7c20cfaf4a399f3eb67bfba440605
* stagefright: initial timed id3 support in hlsRobert Shih2015-04-161-0/+3
| | | | Change-Id: I00a8a786b3f4b74742c34770edd94e937abe20a8
* Unhide the android.media.[Media]DataSource interface.Chris Watkins2015-04-151-0/+17
| | | | | | | | | | | | | | | | | | | | | This allows apps to implement MediaDataSource, which is modeled on stagefright's DataSource, to supply media data to the framework. This was already implemented for MediaExtractor, but it was renamed from DataSource. MediaExtractor, MediaPlayer and MediaMetadataRetriever each have a new overload: #setDataSource(android.media.MediaDataSource) Only NuPlayer supports this new data source. The change introduces: * IDataSource: The binder interface for DataSource. * JMediaDataSource: The native counterpart to the java interface. It implements IDataSource. * CallbackDataSource: A stagefright DataSource that wraps an IDataSource. Change-Id: Ib3c944b49cc8a792c8eb9c85e5015c07f298ebc1
* namespace does not need a closing semicolonGlenn Kasten2015-03-231-1/+1
| | | | Change-Id: Ie8f9d42fc061f6d558f23b98414e04eb3d14b376
* mediaplayer: support dynamic playback rateWei Jia2015-02-241-0/+19
| | | | | | Bug: 19196501 Change-Id: I856b1507d5fa2cedfb645706d2435683a7d3e050
* resolved conflicts for merge of 9391844d to masterMarco Nelissen2015-01-271-41/+0
|\ | | | | | | Change-Id: I348a71d1b3e3238bc3871a69454edc8247d03111
| * Remove MediaPlayerService::decode()Marco Nelissen2015-01-261-41/+0
| | | | | | | | | | | | | | and make SoundPool use MediaCodec for decoding files to PCM. Bug: 18239054 Change-Id: Ia144fc1bbb0d2787638ee972e2224339b4965310
* | Line length 100Glenn Kasten2014-12-301-4/+7
|/ | | | Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
* Cache audio attributes when player not availableJean-Michel Trivi2014-09-051-2/+19
| | | | | | | | | | | Cache the audio attributes stored in a Parcel in the client-side MediaPlayer object if they are set through setParameter() before the server-side MediaPlayer is available. Apply them when the player is prepared. Bug 17280746 Change-Id: I72f1a7fc4e2b076fae8cbdede77a2f74e98b2a03
* rename AudioSystem::newAudioSessionId()Eric Laurent2014-07-281-1/+1
| | | | | | | | | Rename AudioSystem::newAudioSessionId() to AudioSystem::newAudioUniqueId() as it can be used also for I/O handles. Bug: 12378680. Change-Id: I611ea3b5eb57a4b0774437f477ee87dc4ccc2cc2
* NuPlayer: save thread id in MediaPlayer::startChong Zhang2014-07-231-9/+18
| | | | | | | | so that when MediaPlayer::notify is called from within start, it doesn't try to lock itself again. Bug: 15323063 Change-Id: Idd77e892cd22538bbfe3e65c64c9dd2a216a0aee
* Support for audio attributes on audio output of media playerJean-Michel Trivi2014-07-011-0/+22
| | | | Change-Id: Iae4995c98e64add1ab9e6c8ae6501515032755f5
* libmedia: 64-bit compile warningsMark Salyzyn2014-06-201-6/+8
| | | | Change-Id: I600f062fa7148c01851023c1240c39939e648002
* Add MediaPlayer::getAudioStreamType.John Spurlock2014-03-191-0/+8
| | | | Change-Id: I9cd8a718d2873543609aa651fd85749478f4f89f
* Track pid for each sessionMarco Nelissen2014-02-111-4/+4
| | | | | | so they can be properly freed. Change-Id: I6f389035bc29e74e7c367c1c6d0252b180f666b3
* Remove no longer needed http proxy handling code, it's obsolete nowAndreas Huber2014-02-051-11/+0
| | | | | | | | since we started to use java's HTTPConnection instead of the native implementation. Also remove other remnants of the previous http implementation, such as accounting for the http user's uid. Change-Id: I60bfd31381ea40d2220db587ec5c433093b60034
* FINAL ATTEMPT: HTTP services are now provided from JAVA and made available ↵Andreas Huber2014-02-041-5/+11
| | | | | | to media code Change-Id: I9f74a86e70422187c9cf0ca1318a29019700192d
* Fix compile warning / incomplete initializationGlenn Kasten2013-12-191-1/+1
| | | | Change-Id: Ib4accf99be800988e081f96222e1ee73538221ec
* soundpool: allocate shared memory heap by clientEric Laurent2013-09-241-8/+16
| | | | | | | | | | | | | | | | | | | | | | | Current SoundPool implementation allocates the shared memory heap containing decoded PCM samples in mediaserver process. When mediaserver process crashes, the shared memory heaps allocated by AudioCache cannot be mapped anymore in the new instance of mediaserver. This causes a silent failure to end playback of new sounds because AudioFlinger believes the new AudioTracks are opened in streaming mode and not static mode: it sees a NULL shared memory pointer when the track is created. The fix consists in allocating the memory heap in the client process. Thus the heap is not lost when mediaserver restarts. The global memory usage is the same as this is shared memory. Also added a way to detect that a shared memory is passed when the track is created but cannot be mapped on mediaserver side. Also fix a crash in SoundPool when ALOGV is enabled. Bug: 10894793. Change-Id: Ice6c66ec3b2a409d75dc903a508b6c6fbfb2e8a7
* MediaPlayer: add listener for raw track dataChong Zhang2013-08-191-0/+3
| | | | | | Bug: 10326117 Change-Id: I2c0bdf8adc67b11f8dc633423bee66897548f181
* Reject unprepared MediaPlayersMarco Nelissen2013-08-051-0/+7
| | | | | | | Don't allow a MediaPlayer that has been reset() or release()d to be used as the argument to setNextMediaPlayer. Change-Id: I47da1460ec3742f5b2bd7b79e7998b290032d5a1
* am d5018116: Merge "Fix typo."Glenn Kasten2013-06-141-1/+1
|\ | | | | | | | | * commit 'd5018116252a3ecb491e2eaddad12180b85d1e78': Fix typo.
| * Fix typo.Masaki Muranaka2013-06-061-1/+1
| | | | | | | | Change-Id: Ia72ed2bef54751dc2d6c3379a58de95a0e9ebfdd
| * Add support for HLS playlists of type 'event'.Andreas Huber2012-11-271-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | related-to-bug: 6870049 Squashed commit of the following: commit eee2f3ba6bb7335f4e285632726db85645669929 Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 15:02:01 2012 -0800 Make everything a lot less verbose by default. Change-Id: I884d7a7901aa1e7d4ff590f065ca57a79d2af8b3 commit 6bbdb837ed5bd88008e45efb8faf595e4051ba26 Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 14:34:46 2012 -0800 HLS now properly signals media time changes at discontinuities including the start of playback (which may not necessarily be at time 0 if the playlist is of type 'event' and hasn't completed yet). Change-Id: I5ab747d024f9b8d0df72a4e06a12ebb29f62802e commit 1555589832b1878a144a976a643e1af4d61f877c Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 14:32:28 2012 -0800 As part of a time discontinuity, clients of IStreamListener can now signal the corresponding media time after the discontinuity, i.e. the first PTS timestamp following the discontinuity will be considered equivalent to the specified media time and media buffers timestamped accordingly. Change-Id: Id7db7679b7faa6efd6270620ff52e34e884f3e92 commit 5c24c605c073a11c426d025b1e7478fc1ad8365a Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 13:00:56 2012 -0800 NuPlayer sources now expose flags() and can announce that duration may change (increase) dynamically, in which case duration will be polled at 1 second intervals and communicated to the upper layers. Change-Id: I45102909b7a19eed0dda576747e3814d742a0eea commit ecb71de8e281e61971a2cd73e7161a97540bc357 Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 12:57:47 2012 -0800 Stop caching duration in MediaPlayer, duration could increase dynamically. Change-Id: I7bb2f16c0abe49debdf45c776d2266aa069d7791 commit 544aec5823e6d7a3e97e15b6b23546616bcd343e Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 08:46:28 2012 -0800 An attempt to add support for "event" style HLS playlists. Change-Id: I3dfb2e801ecaff8f5d8bdb3a4fca1b18aeeb2c60 Change-Id: I48cf7f65a654d33f2f49ded74f8be22aed9e3b98
* | Update HTTP proxy configuration for all media playback inside stagefright.Andreas Huber2013-05-311-0/+11
| | | | | | | | | | | | Change-Id: Ie0dd00045aba668d8b49da73224e7a7c9c04f69b related-to-bug: 8873723 (cherry picked from commit 2704965b8a1ff3b7450ff58ccecf86d8ec688c40)
* | Don't purge effects we're about to start usingMarco Nelissen2013-05-101-1/+1
| | | | | | | | | | | | | | | | | | By acquiring the new session id before releasing the old, we prevent purging existing effects with the new session id that aren't currently attached but will be once the player is switched to the new session id. b/8767565 Change-Id: I703881b69c5accd8832ac834246925a20ada4c21
* | Instead of returning an error, return an invalid duration (-1 ms)Andreas Huber2013-04-111-0/+7
| | | | | | | | | | | | | | | | if no duration information was available. This prevents us from entering ERROR state, effectively rendering the player instance useless. Change-Id: I602d2661ae8b8633360306c0ea9208fb11e2bf17 related-to-bug: 8596285
* | Refactoring: Rename SurfaceTextureClient to SurfaceMathias Agopian2013-02-151-1/+1
| | | | | | | | Change-Id: I4e8a8b20914cb64edc37abe68233fbc9f2b5d830
* | Merge "Remove unnecessary parameter"Glenn Kasten2012-12-211-3/+3
|\ \
| * | Remove unnecessary parameterGlenn Kasten2012-12-181-3/+3
| | | | | | | | | | | | | | | | | | Just get the parameter on server side Change-Id: I433a63104dbb257e0d862be2ab61847cb36d1c15
* | | Rename ISurfaceTexture and SurfaceTextureAndy McFadden2012-12-181-2/+2
|/ / | | | | | | | | | | | | | | | | | | The C++ class names don't match what the classes do, so rename ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to GLConsumer. Bug 7736700 Change-Id: I64520a55f8c09fe6215382ea361c539a9940cba5
* | Add support for HLS playlists of type 'event'.Andreas Huber2012-11-271-12/+24
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | related-to-bug: 6870049 Squashed commit of the following: commit eee2f3ba6bb7335f4e285632726db85645669929 Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 15:02:01 2012 -0800 Make everything a lot less verbose by default. Change-Id: I884d7a7901aa1e7d4ff590f065ca57a79d2af8b3 commit 6bbdb837ed5bd88008e45efb8faf595e4051ba26 Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 14:34:46 2012 -0800 HLS now properly signals media time changes at discontinuities including the start of playback (which may not necessarily be at time 0 if the playlist is of type 'event' and hasn't completed yet). Change-Id: I5ab747d024f9b8d0df72a4e06a12ebb29f62802e commit 1555589832b1878a144a976a643e1af4d61f877c Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 14:32:28 2012 -0800 As part of a time discontinuity, clients of IStreamListener can now signal the corresponding media time after the discontinuity, i.e. the first PTS timestamp following the discontinuity will be considered equivalent to the specified media time and media buffers timestamped accordingly. Change-Id: Id7db7679b7faa6efd6270620ff52e34e884f3e92 commit 5c24c605c073a11c426d025b1e7478fc1ad8365a Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 13:00:56 2012 -0800 NuPlayer sources now expose flags() and can announce that duration may change (increase) dynamically, in which case duration will be polled at 1 second intervals and communicated to the upper layers. Change-Id: I45102909b7a19eed0dda576747e3814d742a0eea commit ecb71de8e281e61971a2cd73e7161a97540bc357 Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 12:57:47 2012 -0800 Stop caching duration in MediaPlayer, duration could increase dynamically. Change-Id: I7bb2f16c0abe49debdf45c776d2266aa069d7791 commit 544aec5823e6d7a3e97e15b6b23546616bcd343e Author: Andreas Huber <andih@google.com> Date: Tue Nov 27 08:46:28 2012 -0800 An attempt to add support for "event" style HLS playlists. Change-Id: I3dfb2e801ecaff8f5d8bdb3a4fca1b18aeeb2c60 Change-Id: I48cf7f65a654d33f2f49ded74f8be22aed9e3b98
* Merge "Gapless playback, step 1."Marco Nelissen2012-03-131-0/+7
|\
| * Gapless playback, step 1.Marco Nelissen2012-03-131-0/+7
| | | | | | | | | | | | | | Currently able to play Ogg Vorbis, PCM WAV and other lossless files seamlessly by reusing the initial AudioTrack for subsequent players. Change-Id: Ie7cf6b9076bdf4f9211574456d192c02c04fecc7
* | Whitespace and indentationGlenn Kasten2012-03-131-7/+7
|/ | | | | | | | | | | | | | 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
* Switch the way we configure for MediaPlayer retransmission.John Grossman2012-03-011-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* fix libgui header locationMathias Agopian2012-02-271-2/+0
| | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* Update commentsGlenn Kasten2012-02-141-1/+1
| | | | | | We no longer put the filename at start of file. Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
* Fix incorrect includes of AudioTrack.hGlenn Kasten2012-01-181-1/+1
| | | | | | | Remove unnecessary includes of AudioTrack.h. Use forward declaration of class names in preference to #include when possible. Change-Id: I12982811fa75c2c7695d8bbfa595a7aaec047dc0
* Use audio_stream_type_t consistentlyGlenn Kasten2012-01-131-1/+1
| | | | | | | | | 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
* Merge "Use audio_format_t consistently"Glenn Kasten2012-01-121-2/+2
|\
| * Use audio_format_t consistentlyGlenn Kasten2012-01-051-2/+2
| | | | | | | | | | | | | | | | 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
* | Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block2012-01-081-18/+18
| | | | | | | | | | | | | | See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
* | Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGESteve Block2012-01-061-3/+3
|/ | | | | | | See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69