Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -1732,6 +1732,13 @@ void NuPlayer::performSetSurface(const sp<NativeWindowWrapper> &wrapper) { // XXX - ignore error from setVideoScalingMode for now setVideoScalingMode(mVideoScalingMode); if (mDriver != NULL) { sp<NuPlayerDriver> driver = mDriver.promote(); if (driver != NULL) { driver->notifySetSurfaceComplete(); } } } void NuPlayer::onSourceNotify(const sp<AMessage> &msg) { Loading media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ NuPlayerDriver::NuPlayerDriver() : mState(STATE_IDLE), mIsAsyncPrepare(false), mAsyncResult(UNKNOWN_ERROR), mSetSurfaceInProgress(false), mDurationUs(-1), mPositionUs(-1), mNotifyTimeRealUs(-1), Loading Loading @@ -136,6 +137,10 @@ status_t NuPlayerDriver::setVideoSurfaceTexture( const sp<IGraphicBufferProducer> &bufferProducer) { Mutex::Autolock autoLock(mLock); if (mSetSurfaceInProgress) { return INVALID_OPERATION; } switch (mState) { case STATE_SET_DATASOURCE_PENDING: case STATE_RESET_IN_PROGRESS: Loading @@ -145,8 +150,14 @@ status_t NuPlayerDriver::setVideoSurfaceTexture( break; } mSetSurfaceInProgress = true; mPlayer->setVideoSurfaceTextureAsync(bufferProducer); while (mSetSurfaceInProgress) { mCondition.wait(mLock); } return OK; } Loading Loading @@ -533,6 +544,15 @@ void NuPlayerDriver::notifyResetComplete() { mCondition.broadcast(); } void NuPlayerDriver::notifySetSurfaceComplete() { Mutex::Autolock autoLock(mLock); CHECK(mSetSurfaceInProgress); mSetSurfaceInProgress = false; mCondition.broadcast(); } void NuPlayerDriver::notifyDuration(int64_t durationUs) { Mutex::Autolock autoLock(mLock); mDurationUs = durationUs; Loading media/libmediaplayerservice/nuplayer/NuPlayerDriver.h +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ struct NuPlayerDriver : public MediaPlayerInterface { void notifySetDataSourceCompleted(status_t err); void notifyPrepareCompleted(status_t err); void notifyResetComplete(); void notifySetSurfaceComplete(); void notifyDuration(int64_t durationUs); void notifyPosition(int64_t positionUs); void notifySeekComplete(); Loading Loading @@ -102,6 +103,7 @@ private: // The following are protected through "mLock" // >>> bool mSetSurfaceInProgress; int64_t mDurationUs; int64_t mPositionUs; int64_t mNotifyTimeRealUs; Loading Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -1732,6 +1732,13 @@ void NuPlayer::performSetSurface(const sp<NativeWindowWrapper> &wrapper) { // XXX - ignore error from setVideoScalingMode for now setVideoScalingMode(mVideoScalingMode); if (mDriver != NULL) { sp<NuPlayerDriver> driver = mDriver.promote(); if (driver != NULL) { driver->notifySetSurfaceComplete(); } } } void NuPlayer::onSourceNotify(const sp<AMessage> &msg) { Loading
media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ NuPlayerDriver::NuPlayerDriver() : mState(STATE_IDLE), mIsAsyncPrepare(false), mAsyncResult(UNKNOWN_ERROR), mSetSurfaceInProgress(false), mDurationUs(-1), mPositionUs(-1), mNotifyTimeRealUs(-1), Loading Loading @@ -136,6 +137,10 @@ status_t NuPlayerDriver::setVideoSurfaceTexture( const sp<IGraphicBufferProducer> &bufferProducer) { Mutex::Autolock autoLock(mLock); if (mSetSurfaceInProgress) { return INVALID_OPERATION; } switch (mState) { case STATE_SET_DATASOURCE_PENDING: case STATE_RESET_IN_PROGRESS: Loading @@ -145,8 +150,14 @@ status_t NuPlayerDriver::setVideoSurfaceTexture( break; } mSetSurfaceInProgress = true; mPlayer->setVideoSurfaceTextureAsync(bufferProducer); while (mSetSurfaceInProgress) { mCondition.wait(mLock); } return OK; } Loading Loading @@ -533,6 +544,15 @@ void NuPlayerDriver::notifyResetComplete() { mCondition.broadcast(); } void NuPlayerDriver::notifySetSurfaceComplete() { Mutex::Autolock autoLock(mLock); CHECK(mSetSurfaceInProgress); mSetSurfaceInProgress = false; mCondition.broadcast(); } void NuPlayerDriver::notifyDuration(int64_t durationUs) { Mutex::Autolock autoLock(mLock); mDurationUs = durationUs; Loading
media/libmediaplayerservice/nuplayer/NuPlayerDriver.h +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ struct NuPlayerDriver : public MediaPlayerInterface { void notifySetDataSourceCompleted(status_t err); void notifyPrepareCompleted(status_t err); void notifyResetComplete(); void notifySetSurfaceComplete(); void notifyDuration(int64_t durationUs); void notifyPosition(int64_t positionUs); void notifySeekComplete(); Loading Loading @@ -102,6 +103,7 @@ private: // The following are protected through "mLock" // >>> bool mSetSurfaceInProgress; int64_t mDurationUs; int64_t mPositionUs; int64_t mNotifyTimeRealUs; Loading