diff options
author | Lajos Molnar <lajos@google.com> | 2015-07-10 19:17:45 -0700 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2015-07-13 16:33:59 -0700 |
commit | a81c6229638a4db56752dd77a6610e0f0971e877 (patch) | |
tree | b43408970894d5a5979ed0087ab1ee213144ac7c /media/libmediaplayerservice/nuplayer/NuPlayer.cpp | |
parent | 4b33e0838fdb1b5e545449add02005916b512c99 (diff) | |
download | frameworks_av-a81c6229638a4db56752dd77a6610e0f0971e877.zip frameworks_av-a81c6229638a4db56752dd77a6610e0f0971e877.tar.gz frameworks_av-a81c6229638a4db56752dd77a6610e0f0971e877.tar.bz2 |
nuplayer: use codec->setSurface when possible to avoid seeking
Bug: 22414719
Change-Id: I0442e12af960f86a0fc090b4a469c62ba638a1a0
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayer.cpp')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 4a1a34d..50a98d8 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -623,12 +623,19 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { case kWhatSetVideoSurface: { - ALOGV("kWhatSetVideoSurface"); sp<RefBase> obj; CHECK(msg->findObject("surface", &obj)); sp<Surface> surface = static_cast<Surface *>(obj.get()); - if (mSource == NULL || mSource->getFormat(false /* audio */) == NULL) { + + ALOGD("onSetVideoSurface(%p, %s video decoder)", + surface.get(), + (mSource != NULL && mSource->getFormat(false /* audio */) != NULL + && mVideoDecoder != NULL) ? "have" : "no"); + + if (mSource == NULL || mSource->getFormat(false /* audio */) == NULL + // NOTE: mVideoDecoder's mSurface is always non-null + || (mVideoDecoder != NULL && mVideoDecoder->setVideoSurface(surface) == OK)) { performSetSurface(surface); break; } |