Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +14 −54 Original line number Diff line number Diff line Loading @@ -964,11 +964,13 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { } void NuPlayer::finishFlushIfPossible() { if (mFlushingAudio != FLUSHED && mFlushingAudio != SHUT_DOWN) { if (mFlushingAudio != NONE && mFlushingAudio != FLUSHED && mFlushingAudio != SHUT_DOWN) { return; } if (mFlushingVideo != FLUSHED && mFlushingVideo != SHUT_DOWN) { if (mFlushingVideo != NONE && mFlushingVideo != FLUSHED && mFlushingVideo != SHUT_DOWN) { return; } Loading @@ -979,11 +981,11 @@ void NuPlayer::finishFlushIfPossible() { mTimeDiscontinuityPending = false; } if (mAudioDecoder != NULL) { if (mAudioDecoder != NULL && mFlushingAudio == FLUSHED) { mAudioDecoder->signalResume(); } if (mVideoDecoder != NULL) { if (mVideoDecoder != NULL && mFlushingVideo == FLUSHED) { mVideoDecoder->signalResume(); } Loading Loading @@ -1221,8 +1223,8 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) { sp<AMessage> reply; CHECK(msg->findMessage("reply", &reply)); if ((audio && IsFlushingState(mFlushingAudio)) || (!audio && IsFlushingState(mFlushingVideo))) { if ((audio && mFlushingAudio != NONE) || (!audio && mFlushingVideo != NONE)) { reply->setInt32("err", INFO_DISCONTINUITY); reply->post(); return OK; Loading Loading @@ -1302,15 +1304,6 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) { } } else { // This stream is unaffected by the discontinuity if (audio) { mFlushingAudio = FLUSHED; } else { mFlushingVideo = FLUSHED; } finishFlushIfPossible(); return -EWOULDBLOCK; } } Loading Loading @@ -1361,7 +1354,8 @@ void NuPlayer::renderBuffer(bool audio, const sp<AMessage> &msg) { sp<AMessage> reply; CHECK(msg->findMessage("reply", &reply)); if (IsFlushingState(audio ? mFlushingAudio : mFlushingVideo)) { if ((audio && mFlushingAudio != NONE) || (!audio && mFlushingVideo != NONE)) { // We're currently attempting to flush the decoder, in order // to complete this, the decoder wants all its buffers back, // so we don't want any output buffers it sent us (from before Loading Loading @@ -1506,27 +1500,13 @@ void NuPlayer::flushDecoder(bool audio, bool needShutdown) { needShutdown ? FLUSHING_DECODER_SHUTDOWN : FLUSHING_DECODER; if (audio) { CHECK(mFlushingAudio == NONE || mFlushingAudio == AWAITING_DISCONTINUITY); ALOGE_IF(mFlushingAudio != NONE, "audio flushDecoder() is called in state %d", mFlushingAudio); mFlushingAudio = newStatus; if (mFlushingVideo == NONE) { mFlushingVideo = (mVideoDecoder != NULL) ? AWAITING_DISCONTINUITY : FLUSHED; } } else { CHECK(mFlushingVideo == NONE || mFlushingVideo == AWAITING_DISCONTINUITY); ALOGE_IF(mFlushingVideo != NONE, "video flushDecoder() is called in state %d", mFlushingVideo); mFlushingVideo = newStatus; if (mFlushingAudio == NONE) { mFlushingAudio = (mAudioDecoder != NULL) ? AWAITING_DISCONTINUITY : FLUSHED; } } } Loading Loading @@ -1616,18 +1596,6 @@ void NuPlayer::processDeferredActions() { // an intermediate state, i.e. one more more decoders are currently // flushing or shutting down. if (mRenderer != NULL) { // There's an edge case where the renderer owns all output // buffers and is paused, therefore the decoder will not read // more input data and will never encounter the matching // discontinuity. To avoid this, we resume the renderer. if (mFlushingAudio == AWAITING_DISCONTINUITY || mFlushingVideo == AWAITING_DISCONTINUITY) { mRenderer->resume(); } } if (mFlushingAudio != NONE || mFlushingVideo != NONE) { // We're currently flushing, postpone the reset until that's // completed. Loading Loading @@ -1692,14 +1660,6 @@ void NuPlayer::performDecoderShutdown(bool audio, bool video) { mTimeDiscontinuityPending = true; if (mFlushingAudio == NONE && (!audio || mAudioDecoder == NULL)) { mFlushingAudio = FLUSHED; } if (mFlushingVideo == NONE && (!video || mVideoDecoder == NULL)) { mFlushingVideo = FLUSHED; } if (audio && mAudioDecoder != NULL) { flushDecoder(true /* audio */, true /* needShutdown */); } Loading media/libmediaplayerservice/nuplayer/NuPlayer.h +0 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,6 @@ private: enum FlushStatus { NONE, AWAITING_DISCONTINUITY, FLUSHING_DECODER, FLUSHING_DECODER_SHUTDOWN, SHUTTING_DOWN_DECODER, Loading Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +14 −54 Original line number Diff line number Diff line Loading @@ -964,11 +964,13 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { } void NuPlayer::finishFlushIfPossible() { if (mFlushingAudio != FLUSHED && mFlushingAudio != SHUT_DOWN) { if (mFlushingAudio != NONE && mFlushingAudio != FLUSHED && mFlushingAudio != SHUT_DOWN) { return; } if (mFlushingVideo != FLUSHED && mFlushingVideo != SHUT_DOWN) { if (mFlushingVideo != NONE && mFlushingVideo != FLUSHED && mFlushingVideo != SHUT_DOWN) { return; } Loading @@ -979,11 +981,11 @@ void NuPlayer::finishFlushIfPossible() { mTimeDiscontinuityPending = false; } if (mAudioDecoder != NULL) { if (mAudioDecoder != NULL && mFlushingAudio == FLUSHED) { mAudioDecoder->signalResume(); } if (mVideoDecoder != NULL) { if (mVideoDecoder != NULL && mFlushingVideo == FLUSHED) { mVideoDecoder->signalResume(); } Loading Loading @@ -1221,8 +1223,8 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) { sp<AMessage> reply; CHECK(msg->findMessage("reply", &reply)); if ((audio && IsFlushingState(mFlushingAudio)) || (!audio && IsFlushingState(mFlushingVideo))) { if ((audio && mFlushingAudio != NONE) || (!audio && mFlushingVideo != NONE)) { reply->setInt32("err", INFO_DISCONTINUITY); reply->post(); return OK; Loading Loading @@ -1302,15 +1304,6 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) { } } else { // This stream is unaffected by the discontinuity if (audio) { mFlushingAudio = FLUSHED; } else { mFlushingVideo = FLUSHED; } finishFlushIfPossible(); return -EWOULDBLOCK; } } Loading Loading @@ -1361,7 +1354,8 @@ void NuPlayer::renderBuffer(bool audio, const sp<AMessage> &msg) { sp<AMessage> reply; CHECK(msg->findMessage("reply", &reply)); if (IsFlushingState(audio ? mFlushingAudio : mFlushingVideo)) { if ((audio && mFlushingAudio != NONE) || (!audio && mFlushingVideo != NONE)) { // We're currently attempting to flush the decoder, in order // to complete this, the decoder wants all its buffers back, // so we don't want any output buffers it sent us (from before Loading Loading @@ -1506,27 +1500,13 @@ void NuPlayer::flushDecoder(bool audio, bool needShutdown) { needShutdown ? FLUSHING_DECODER_SHUTDOWN : FLUSHING_DECODER; if (audio) { CHECK(mFlushingAudio == NONE || mFlushingAudio == AWAITING_DISCONTINUITY); ALOGE_IF(mFlushingAudio != NONE, "audio flushDecoder() is called in state %d", mFlushingAudio); mFlushingAudio = newStatus; if (mFlushingVideo == NONE) { mFlushingVideo = (mVideoDecoder != NULL) ? AWAITING_DISCONTINUITY : FLUSHED; } } else { CHECK(mFlushingVideo == NONE || mFlushingVideo == AWAITING_DISCONTINUITY); ALOGE_IF(mFlushingVideo != NONE, "video flushDecoder() is called in state %d", mFlushingVideo); mFlushingVideo = newStatus; if (mFlushingAudio == NONE) { mFlushingAudio = (mAudioDecoder != NULL) ? AWAITING_DISCONTINUITY : FLUSHED; } } } Loading Loading @@ -1616,18 +1596,6 @@ void NuPlayer::processDeferredActions() { // an intermediate state, i.e. one more more decoders are currently // flushing or shutting down. if (mRenderer != NULL) { // There's an edge case where the renderer owns all output // buffers and is paused, therefore the decoder will not read // more input data and will never encounter the matching // discontinuity. To avoid this, we resume the renderer. if (mFlushingAudio == AWAITING_DISCONTINUITY || mFlushingVideo == AWAITING_DISCONTINUITY) { mRenderer->resume(); } } if (mFlushingAudio != NONE || mFlushingVideo != NONE) { // We're currently flushing, postpone the reset until that's // completed. Loading Loading @@ -1692,14 +1660,6 @@ void NuPlayer::performDecoderShutdown(bool audio, bool video) { mTimeDiscontinuityPending = true; if (mFlushingAudio == NONE && (!audio || mAudioDecoder == NULL)) { mFlushingAudio = FLUSHED; } if (mFlushingVideo == NONE && (!video || mVideoDecoder == NULL)) { mFlushingVideo = FLUSHED; } if (audio && mAudioDecoder != NULL) { flushDecoder(true /* audio */, true /* needShutdown */); } Loading
media/libmediaplayerservice/nuplayer/NuPlayer.h +0 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,6 @@ private: enum FlushStatus { NONE, AWAITING_DISCONTINUITY, FLUSHING_DECODER, FLUSHING_DECODER_SHUTDOWN, SHUTTING_DOWN_DECODER, Loading