summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AwesomePlayer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* stagefright: set PTS for SoftwareRendererLajos Molnar2014-05-071-3/+6
| | | | Change-Id: I08661a9eae09f919149aa5a58aa514d848de50a1
* am 63249d6e: am bc4bf532: am b2314088: Merge "AwesomePlayer: use PTS for ↵Lajos Molnar2014-05-021-7/+10
|\ | | | | | | | | | | | | queueBuffer" * commit '63249d6ea560b2f29d3ee255951f527b01ecbac5': AwesomePlayer: use PTS for queueBuffer
| * AwesomePlayer: use PTS for queueBufferLajos Molnar2014-05-011-7/+10
| | | | | | | | Change-Id: I1c14ad4784c799c46cf06a14b0f00c5e4d01f718
* | am 113f2122: am 5fa3f7af: am b52675e9: Merge "Smooth out AwesomePlayer"Lajos Molnar2014-05-021-4/+22
|\ \ | |/ | | | | | | * commit '113f2122662856f2482836f1b4c585a050888afa': Smooth out AwesomePlayer
| * Smooth out AwesomePlayerLajos Molnar2014-05-011-4/+22
| | | | | | | | | | | | Use clock estimator to smooth out audio time stamps. Change-Id: Iec1ff30c011069d06ff8051fc4839d00895463d6
* | am 9e0922ba: am 6e76fda3: am f9782266: Merge "AwesomePlayer: improve ↵Lajos Molnar2014-05-021-3/+7
|\ \ | |/ | | | | | | | | | | scheduling of video event to hit PTS" * commit '9e0922ba7dda72fc94d2af2872cfc630ad599c91': AwesomePlayer: improve scheduling of video event to hit PTS
| * AwesomePlayer: improve scheduling of video event to hit PTSLajos Molnar2014-05-011-3/+7
| | | | | | | | Change-Id: I7b19911acbde9b592b757b952d4ad63cd8efebed
| * warnings be gone.Andreas Huber2014-04-111-2/+3
| | | | | | | | | | | | | | | | (cherry picked from commit 84333e0475bc911adc16417f4ca327c975cf6c36) Modified by Mark Salyzyn <salyzyn@google.com> to keep merge conflicts or errors downstream to a minimum. Change-Id: Ic3b272f9cbf3155001aabd2f79728f1bc31de613
* | AwesomePlayer: fixed division by zero in onBufferingUpdateRobert Shih2014-04-251-6/+4
| | | | | | | | | | Bug: 13911283 Change-Id: I968a274634a86f5c46f75dc533024dad44afc36b
* | stagefright: log uri protocols, and opt-in to log full uriLajos Molnar2014-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | Added property media.stagefright.log-uri. Set it to true or 1 to log uris by AwesomePlayer. Added utility function to get uri debug string based on incognito and log opt-in status. Change-Id: I5ccc23079ddfb120dd9703a3ed651a162ed5acec Related-Bug: 6994761
* | Fix race condition in AwesomePlayerMarco Nelissen2014-02-281-2/+4
| | | | | | | | | | | | | | | | | | | | | | This fixes a race condition that could cause two threads to attempt to connect to a server at the same time, resulting in multiple requests and/or aborted connections. In some cases, it could cause other operations on MediaPlayer to block until network access was complete. b/13187722 Change-Id: Ibf78acff15dbfbf6c443a4c60623e8eac967d955
* | warnings be gone.Andreas Huber2014-02-111-2/+3
| | | | | | | | Change-Id: Ie3bae3f037730e316d7fca12e7a3527973f752ef
* | resolved conflicts for merge of 566be7c3 to masterNarayan Kamath2014-02-111-14/+15
|\ \ | |/ | | | | Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
| * Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | Contains the necessary changes to make frameworks/av build and work on a 64-bit machine. Signed-off-by: Craig Barber <craig.barber@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com> Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
* | FINAL ATTEMPT: HTTP services are now provided from JAVA and made available ↵Andreas Huber2014-02-041-15/+26
|/ | | | | | to media code Change-Id: I9f74a86e70422187c9cf0ca1318a29019700192d
* Avoid jumps to faulty position after seeksRoger1 Jonsson2013-12-181-1/+4
| | | | | | | | | | | | | | | | | When seeking multiple times it is possible that some seeks are discarded in AwesomePlayer, which causes unwanted jumps to faulty positions. The reason is that a seek flag is reset twice in AwesomePlayer. At first when the video seek is completed and then again when the audio seek is completed. If a new seek is made after the previous video seek completed but before the previous audio seek completed, the new seek position is discarded by the previous audio seek completion. This fix makes sure that the seek flag is reset only when video has completed the seek. Change-Id: I8f8741d4cb8682345f1d1855bbad57c05f4e3c8d
* AwesomePlayer: correct stream type for offloadEric Laurent2013-11-141-1/+7
| | | | | | | | | | | | canOffloadStream() function in stagefright utils forces the stream type to AUDIO_STREAM_MUSIC when querying the audio policy manager if a particular track is offloadable or not. This causes MP3 ringtones to be offloaded which is not a validated use case. The fix consists in using the actual stream type read from the AudioSink. Bug: 11410937. Change-Id: I44b8e033a8e785a79cdc291b142f80b5580bdc4d
* Merge "AwesomePlayer: Improve performance on high-fps clips" into klp-devLajos Molnar2013-11-131-1/+36
|\
| * AwesomePlayer: Improve performance on high-fps clipsLajos Molnar2013-11-121-1/+36
| | | | | | | | | | | | | | | | | | | | - Immediately retry rendering next frame after frame skip. - Schedule next videoEvent based on the timestamp of the next frame. Change-Id: Ia106382c4c225321b682c1f7c2d126d7eab7d56d Signed-off-by: Lajos Molnar <lajos@google.com> Bug: 11159147
* | am 27ae268a: am 00cb884f: Merge "StageFright: Removes hacks for Nvidia MPEG2 ↵Adam Hampson2013-11-131-2/+1
|\ \ | |/ |/| | | | | | | | | decoder" into jb-mr2-dev * commit '27ae268af29b25d85f83aa34e92ac8b7f6c87c6f': StageFright: Removes hacks for Nvidia MPEG2 decoder
| * am 00cb884f: Merge "StageFright: Removes hacks for Nvidia MPEG2 decoder" ↵Adam Hampson2013-11-131-2/+1
| |\ | | | | | | | | | | | | | | | | | | into jb-mr2-dev * commit '00cb884fc870aba4052c8d187a45e4aec50a6b43': StageFright: Removes hacks for Nvidia MPEG2 decoder
| | * StageFright: Removes hacks for Nvidia MPEG2 decoderSuresh Choudhary2013-08-091-2/+1
| | | | | | | | | | | | | | | | | | | | | Removes the NVIDIA MPEG2 decoder specific hacks in legacy code as Nvidia HW MPEG2 decoder is enabled and tested now. Change-Id: Ifc67e1119d9741551336753f85f9cfdfd3fc8600
* | | AwesomePlayer: ensure STARTED message works after resetLajos Molnar2013-10-281-0/+5
| | | | | | | | | | | | | | | | | | Change-Id: I06217c07c0b68476cb296fd6151f6a0d8d4e02d0 Signed-off-by: Lajos Molnar <lajos@google.com> Bug: 11412881
* | | Make sure we get to discover that the cache is sufficiently full againAndreas Huber2013-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | by posting buffering events while in the CACHE_UNDERRUN state. Change-Id: Ic60c8d57f0ae502aa2b6eec7160dc4224b989604 related-to-bug: 11262689
* | | AwesomePlayer: fix concurrent pause and teardownEric Laurent2013-10-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a race condition if a pause request was received while we were executing a teardown event. Although we hold a mutex while processing the teardown event, there is a step of the prepare sequence where we release the mutex if streaming. In this case, the pause request is executed but ignored because the player state is still preparing. At the end of the teardown event processing we restore previous playback state and resume. The fix consists in clearing the saved teardown playback state when a pause request is received while processing a teardown event. Bug: 11225491. Change-Id: If0e61855ce5a336322f1ba8e5559bdc190beeb76
* | | AwesomePlayer: do not send events when paused.Eric Laurent2013-10-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When streaming audio and paused, AwesomePlayer should stop sending BufferingEvents as they will keep a wake lock for no reason. TimedEventQueue should always acquire the wakelock with mediaserver identity so that it is released with the same identity by the event handler thread. Bug: 11104408. Change-Id: Ied0e03acd6ad2f5a4c0ec82d5c2aa4e1c6da772c
* | | MediaTimeProvider support fixesLajos Molnar2013-09-301-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add MEDIA_SKIPPED event when resuming at a different time than seeked to. Send MEDIA_STARTED/PAUSED events only when playing (vs. when doing seek previews) Change-Id: I243ebf054303755ea8863229c3211694f2c204a7 Signed-off-by: Lajos Molnar <lajos@google.com> Bug: 10954008
* | | Merge "Prevent onPrepared callback from being called twice" into klp-devMarco Nelissen2013-09-281-17/+19
|\ \ \
| * | | Prevent onPrepared callback from being called twiceMarco Nelissen2013-09-271-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | b/10891995 Change-Id: If6845c832d114629282f0b03f904a37c3325208e
* | | | fix playback position after switching to offloadEric Laurent2013-09-271-0/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After switching from offloaded track to PCM track while paused (e.g. when connecting A2DP), playback restarts from the beginning of the song when resuming. Save current position before recreating an AudioPlayer in AwesomePlayer::play_l() and seek to the saved position before starting playback. Also fix a problem where the position is not reported properly by AudioPlayer if a seek is pending and queried just after start and before the first buffer is read from the MediaSource. Bug: 8174034. Change-Id: I254e65418ff903a9bf2e2111b89a00e2e54876c5
* | | Set PREPARING flag after setDataSource_l()Chong Zhang2013-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise the reset_l() inside setDataSource_l() will get stuck waiting for the PREPARING to be cleared. Bug: 10426788 Change-Id: I7ccdf7abcea71cf150544c7cd3f4781e3a946b97
* | | Add MEDIA_STARTED/PAUSED/STOPPED events to media playersLajos Molnar2013-08-151-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for the MediaTimeProvider java interface, so it does not continually poll for current media time. Note: NuPlayer and AwesomePlayer do not correctly handle stop (pause instead), so for those we will signal PAUSED. Signed-off-by: Lajos Molnar <lajos@google.com> Change-Id: I3c61e1bda475f131323f475c18a42e3ec66c9ae1 Bug: 10326117
* | | Merge "Fix typo in AwesomePlayer"Andreas Huber2013-07-291-1/+1
|\ \ \
| * | | Fix typo in AwesomePlayerSungsoo Lim2013-07-101-1/+1
| | | | | | | | | | | | | | | | Change-Id: I32113e382a3033c9a1b038dc06e4ccddc2a97d7f
* | | | stagefright: offload playback supportRichard Fitzgerald2013-07-261-42/+202
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Offloading of compressed audio decoding to audio DSP is implemented for audio only, non streamed content. when the datasource is AudioPlayer: - Create an offloaded sink when playing a compressed source - Send metadata to audio HAL - Return sink start error to AwesomePlayer so that a new player for PCM audio can be created in case of problem. - Forward stream end and tear down callback events to AwesomePlayer - Stop the sink and wait for stream end callback when EOS is reached. - Pause and restart the sink if needed before flushing when seeking (otherwise flush is a no op). - For current media time, directly query the render position from the sink and offset by the start position (seek to time) AwesomePlayer: - When initializing the audio decoder, check with audio policy manager if offloading is supported. If yes, create the software decoder in case a reconfiguration is needed but connect the audio track directly to the AudioPlayer. - In case of error when starting the AudioPlayer, reconnect the software decoder (OMXSource) and recreate a PCM AudioPlayer. - Handle AudioPlayer tear down event by detroying and recreating the AudioPlayer to allow transitions between situations were offloading is supported or not. - Force tear down of offloaded AudioPlayer when paused for a certain time: This will close the sink and allow the DSP to power down. Utils: - Added helper methods: - send meta data to audio ia sink setParameters - query audio policy manager if offloading is supported for a given audio content Change-Id: I115842ce424f947b966d45e253a74d3fd5df9aae Signed-off-by: Eric Laurent <elaurent@google.com>
* | | am 046d9c8d: am 06197925: am 267363ee: Merge "Prevent Media Server crash ↵Jean-Baptiste Queru2013-07-081-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | while the AwesomePlayer getBitrate return true with mBitrate equals to zero." * commit '046d9c8dad97118535778cf93efc662ceb5fec8d': Prevent Media Server crash while the AwesomePlayer getBitrate return true with mBitrate equals to zero.
| * | am 267363ee: Merge "Prevent Media Server crash while the AwesomePlayer ↵Jean-Baptiste Queru2013-07-081-1/+1
| |\ \ | | |/ | |/| | | | | | | | | | | | | getBitrate return true with mBitrate equals to zero." * commit '267363ee2836ff9bc18d7fdd93aaedf19de546ad': Prevent Media Server crash while the AwesomePlayer getBitrate return true with mBitrate equals to zero.
| | * Prevent Media Server crash while the AwesomePlayer getBitrate return true ↵hovanchen2013-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with mBitrate equals to zero. [Cause] - getBitrate(int64_t *bitrate) will return true if mBitrate = 0. - Then, in getCachedDuration_l(int64_t *durationUs, bool *eos), we might execute the following function when getBitrate(&bitrate) = true and bitrate = 0. *durationUs = cachedDataRemaining * 8000000ll / bitrate; - Mediaserver will be crashed when divided by zero. - The mediaserver crash often occur when DLNA IOP tests on Golden DMS with AAC_ADTS_320 audio. [Solution] - Prevent the divide function executing when bitrate is zero. Change-Id: I4439d92cee5faec95df2109e9186c33b3fff6c66
| * | Refactoring: Rename SurfaceTextureClient to SurfaceMathias Agopian2013-02-151-2/+2
| | | | | | | | | | | | Change-Id: I4e8a8b20914cb64edc37abe68233fbc9f2b5d830
| * | Return error code if setting scaling mode failsMarco Nelissen2013-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The return code from native_window_set_scaling_mode() was ignored. Looking at the code review comments that introduced this code, it seems like the intention was to return the error code in that case. Change-Id: I9592cc378f0a0b960d37178aa0525fc17e8734ba
| * | Rename ISurfaceTexture and SurfaceTextureAndy McFadden2012-12-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Don't attempt to seek audio and video separately.Andreas Huber2012-10-231-9/+17
| | | | | | | | | | | | | | | | | | | | | The widevine extractor doesn't deal too well with that... Change-Id: Iadfeede4fe0c086af788c5639782854e4fbb98ff related-to-bug: 7262386
| * | Added some extra failure logging messagesJames Dong2012-10-171-0/+1
| | | | | | | | | | | | | | | | | | o related-to-bug: 7282066 Change-Id: I0896551a45aab61fb571fef19061397ff84321d9
| * | [WVDRM] Fix for stuttering on low bandwidthJeff Tinker2012-10-011-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reintroduces the play/pause rebuffering logic we eliminated in JB zero day to fix double spins and slow startup - but activates that logic only based on a comparison of the current bandwidth measurement and the lowest bitrate track in the movie. Needs to be submitted with related changes in /vendor/widevine bug: 7230071 Change-Id: If4f5ecda36c4858ce8bf5c4abb722f90a329ecdb
| * | Add getError and setError to propagate error code from WVMMediaExtractor up ↵Edwin Wong2012-09-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to player. The two virtual functions provides a path for the player(AwesomePlayer) to retrieve the last error from WVMMediaExtractor container. Change-Id: Iee8d4a3eccf82af95eb3d4d465f069daced4aa1a related-to-bug: 7073630
* | | libstagefright: Check for duration > 0 to avoid divide-by-zero exceptionAjay Dudani2013-05-281-1/+1
| | | | | | | | | | | | Change-Id: I58ccacbf7ede892dff9626715162ea7b1f2ddbc6
* | | Refactoring: Rename SurfaceTextureClient to SurfaceMathias Agopian2013-02-151-2/+2
| | | | | | | | | | | | Change-Id: I4e8a8b20914cb64edc37abe68233fbc9f2b5d830
* | | Return error code if setting scaling mode failsMarco Nelissen2013-02-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The return code from native_window_set_scaling_mode() was ignored. Looking at the code review comments that introduced this code, it seems like the intention was to return the error code in that case. Change-Id: I9592cc378f0a0b960d37178aa0525fc17e8734ba
* | | Rename ISurfaceTexture and SurfaceTextureAndy McFadden2012-12-181-4/+4
| |/ |/| | | | | | | | | | | | | | | | | 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
* | Don't attempt to seek audio and video separately.Andreas Huber2012-10-231-9/+17
| | | | | | | | | | | | | | The widevine extractor doesn't deal too well with that... Change-Id: Iadfeede4fe0c086af788c5639782854e4fbb98ff related-to-bug: 7262386