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

Commit d3db0bfa authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "NuPlayer: add seek operation when change video texture surface." into lmp-dev

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


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

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


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


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