summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayer.h
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-10-03 09:53:53 -0700
committerAndy Hung <hunga@google.com>2014-10-06 11:04:18 -0700
commit8d121d41f5355b78b687f44e8d4aae4de2aa0359 (patch)
treedfe376497a0dd934d8c7efeacc89d7ca19db4f38 /media/libmediaplayerservice/nuplayer/NuPlayer.h
parentc4da004d4baef8cc4a631058549216c8d2383824 (diff)
downloadframeworks_av-8d121d41f5355b78b687f44e8d4aae4de2aa0359.zip
frameworks_av-8d121d41f5355b78b687f44e8d4aae4de2aa0359.tar.gz
frameworks_av-8d121d41f5355b78b687f44e8d4aae4de2aa0359.tar.bz2
NuPlayer: wait for renderer flush before decoder shutdown
Bug: 17679341 Change-Id: Ie3883686891e7ee6fb45ceb01af1eb60b559d3a0
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.h')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index 8157733..1b9a756 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -164,6 +164,9 @@ private:
// notion of time has changed.
bool mTimeDiscontinuityPending;
+ // Status of flush responses from the decoder and renderer.
+ bool mFlushComplete[2][2];
+
// Used by feedDecoderInputData to aggregate small buffers into
// one large buffer.
sp<ABuffer> mPendingAudioAccessUnit;
@@ -187,6 +190,13 @@ private:
return audio ? mAudioDecoder : mVideoDecoder;
}
+ inline void clearFlushComplete() {
+ mFlushComplete[0][0] = false;
+ mFlushComplete[0][1] = false;
+ mFlushComplete[1][0] = false;
+ mFlushComplete[1][1] = false;
+ }
+
void openAudioSink(const sp<AMessage> &format, bool offloadOnly);
void closeAudioSink();
@@ -201,6 +211,7 @@ private:
void notifyListener(int msg, int ext1, int ext2, const Parcel *in = NULL);
+ void handleFlushComplete(bool audio, bool isDecoder);
void finishFlushIfPossible();
bool audioDecoderStillNeeded();
@@ -209,8 +220,6 @@ private:
bool audio, bool needShutdown, const sp<AMessage> &newFormat = NULL);
void updateDecoderFormatWithoutFlush(bool audio, const sp<AMessage> &format);
- static bool IsFlushingState(FlushStatus state, bool *needShutdown = NULL);
-
void postScanSources();
void schedulePollDuration();