diff options
author | Lajos Molnar <lajos@google.com> | 2015-02-10 15:57:08 -0800 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2015-02-10 15:57:08 -0800 |
commit | 49c9a53d098091791b0e6e2d97ce6bf0d562d17e (patch) | |
tree | 54d465b8b2e933cda923baa0d7e8e1e857b67878 /media/libmediaplayerservice | |
parent | c9f122d8f32ba6928ac9087448025fa3bed1553d (diff) | |
parent | 157defdde7013062bbd04f7e873b6856adce14ca (diff) | |
download | frameworks_av-49c9a53d098091791b0e6e2d97ce6bf0d562d17e.zip frameworks_av-49c9a53d098091791b0e6e2d97ce6bf0d562d17e.tar.gz frameworks_av-49c9a53d098091791b0e6e2d97ce6bf0d562d17e.tar.bz2 |
resolved conflicts for merge of 157defdd to master
Change-Id: I14fd8063fa052f16868b8053a211190092131317
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp | 7 | ||||
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp index 83fc9e9..7f8680d 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp @@ -26,6 +26,7 @@ #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/foundation/AMessage.h> #include <media/stagefright/foundation/AUtils.h> +#include <media/stagefright/foundation/AWakeLock.h> #include <media/stagefright/MediaErrors.h> #include <media/stagefright/MetaData.h> #include <media/stagefright/Utils.h> @@ -85,7 +86,8 @@ NuPlayer::Renderer::Renderer( mCurrentOffloadInfo(AUDIO_INFO_INITIALIZER), mCurrentPcmInfo(AUDIO_PCMINFO_INITIALIZER), mTotalBuffersQueued(0), - mLastAudioBufferDrained(0) { + mLastAudioBufferDrained(0), + mWakeLock(new AWakeLock()) { mMediaClock = new MediaClock; } @@ -412,6 +414,7 @@ void NuPlayer::Renderer::onMessageReceived(const sp<AMessage> &msg) { } ALOGV("Audio Offload tear down due to pause timeout."); onAudioOffloadTearDown(kDueToTimeout); + mWakeLock->release(); break; } @@ -1299,6 +1302,7 @@ void NuPlayer::Renderer::onAudioOffloadTearDown(AudioOffloadTearDownReason reaso void NuPlayer::Renderer::startAudioOffloadPauseTimeout() { if (offloadingAudio()) { + mWakeLock->acquire(); sp<AMessage> msg = new AMessage(kWhatAudioOffloadPauseTimeout, id()); msg->setInt32("drainGeneration", mAudioOffloadPauseTimeoutGeneration); msg->post(kOffloadPauseMaxUs); @@ -1307,6 +1311,7 @@ void NuPlayer::Renderer::startAudioOffloadPauseTimeout() { void NuPlayer::Renderer::cancelAudioOffloadPauseTimeout() { if (offloadingAudio()) { + mWakeLock->release(true); ++mAudioOffloadPauseTimeoutGeneration; } } diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h index b35c86a..faf3b3f 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h @@ -23,6 +23,7 @@ namespace android { struct ABuffer; +class AWakeLock; struct MediaClock; struct VideoFrameScheduler; @@ -176,6 +177,15 @@ private: int32_t mTotalBuffersQueued; int32_t mLastAudioBufferDrained; + sp<AWakeLock> mWakeLock; + + status_t getCurrentPositionOnLooper(int64_t *mediaUs); + status_t getCurrentPositionOnLooper( + int64_t *mediaUs, int64_t nowUs, bool allowPastQueuedVideo = false); + bool getCurrentPositionIfPaused_l(int64_t *mediaUs); + status_t getCurrentPositionFromAnchor( + int64_t *mediaUs, int64_t nowUs, bool allowPastQueuedVideo = false); + size_t fillAudioBuffer(void *buffer, size_t size); bool onDrainAudioQueue(); |