Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac428aa5 authored by Wei Jia's avatar Wei Jia
Browse files

NuPlayer: add seek operation when change video texture surface.

Bug: 17278770

Change-Id: I9fd5207e1eccb91e64644d2d1da4183d4bf7ac2c
parent e4478feb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ private:
NuPlayer::NuPlayer()
    : mUIDValid(false),
      mSourceFlags(0),
      mCurrentPositionUs(0),
      mVideoIsAVC(false),
      mOffloadAudio(false),
      mCurrentOffloadInfo(AUDIO_INFO_INITIALIZER),
@@ -540,6 +541,8 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
                        static_cast<NativeWindowWrapper *>(obj.get())));

            if (obj != NULL) {
                mDeferredActions.push_back(new SeekAction(mCurrentPositionUs));

                // If there is a new surface texture, instantiate decoders
                // again if possible.
                mDeferredActions.push_back(
@@ -860,6 +863,7 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
            } else if (what == Renderer::kWhatPosition) {
                int64_t positionUs;
                CHECK(msg->findInt64("positionUs", &positionUs));
                mCurrentPositionUs = positionUs;

                CHECK(msg->findInt64("videoLateByUs", &mVideoLateByUs));

+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ private:
    sp<Source> mSource;
    uint32_t mSourceFlags;
    sp<NativeWindowWrapper> mNativeWindow;
    int64_t mCurrentPositionUs;
    sp<MediaPlayerBase::AudioSink> mAudioSink;
    sp<Decoder> mVideoDecoder;
    bool mVideoIsAVC;