Loading media/libstagefright/MediaCodec.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -1482,9 +1482,9 @@ status_t MediaCodec::release() { return PostAndAwaitResponse(msg, &response); } status_t MediaCodec::releaseAsync() { status_t MediaCodec::releaseAsync(const sp<AMessage> ¬ify) { sp<AMessage> msg = new AMessage(kWhatRelease, this); msg->setInt32("async", 1); msg->setMessage("async", notify); sp<AMessage> response; return PostAndAwaitResponse(msg, &response); } Loading Loading @@ -2695,6 +2695,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { if (mReplyID != nullptr) { (new AMessage)->postReply(mReplyID); } if (mAsyncReleaseCompleteNotification != nullptr) { flushMediametrics(); mAsyncReleaseCompleteNotification->post(); mAsyncReleaseCompleteNotification.clear(); } break; } Loading Loading @@ -3081,8 +3086,8 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { break; } int32_t async = 0; if (msg->findInt32("async", &async) && async) { sp<AMessage> asyncNotify; if (msg->findMessage("async", &asyncNotify) && asyncNotify != nullptr) { if (mSurface != NULL) { if (!mReleaseSurface) { mReleaseSurface.reset(new ReleaseSurface); Loading Loading @@ -3114,10 +3119,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { pushBlankBuffersToNativeWindow(mSurface.get()); } if (async) { if (asyncNotify != nullptr) { mResourceManagerProxy->markClientForPendingRemoval(); (new AMessage)->postReply(mReplyID); mReplyID = 0; mAsyncReleaseCompleteNotification = asyncNotify; } break; Loading media/libstagefright/include/media/stagefright/MediaCodec.h +2 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ struct MediaCodec : public AHandler { // object. status_t release(); status_t releaseAsync(); status_t releaseAsync(const sp<AMessage> ¬ify); status_t flush(); Loading Loading @@ -383,6 +383,7 @@ private: sp<AMessage> mInputFormat; sp<AMessage> mCallback; sp<AMessage> mOnFrameRenderedNotification; sp<AMessage> mAsyncReleaseCompleteNotification; sp<ResourceManagerServiceProxy> mResourceManagerProxy; Loading Loading
media/libstagefright/MediaCodec.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -1482,9 +1482,9 @@ status_t MediaCodec::release() { return PostAndAwaitResponse(msg, &response); } status_t MediaCodec::releaseAsync() { status_t MediaCodec::releaseAsync(const sp<AMessage> ¬ify) { sp<AMessage> msg = new AMessage(kWhatRelease, this); msg->setInt32("async", 1); msg->setMessage("async", notify); sp<AMessage> response; return PostAndAwaitResponse(msg, &response); } Loading Loading @@ -2695,6 +2695,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { if (mReplyID != nullptr) { (new AMessage)->postReply(mReplyID); } if (mAsyncReleaseCompleteNotification != nullptr) { flushMediametrics(); mAsyncReleaseCompleteNotification->post(); mAsyncReleaseCompleteNotification.clear(); } break; } Loading Loading @@ -3081,8 +3086,8 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { break; } int32_t async = 0; if (msg->findInt32("async", &async) && async) { sp<AMessage> asyncNotify; if (msg->findMessage("async", &asyncNotify) && asyncNotify != nullptr) { if (mSurface != NULL) { if (!mReleaseSurface) { mReleaseSurface.reset(new ReleaseSurface); Loading Loading @@ -3114,10 +3119,11 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) { pushBlankBuffersToNativeWindow(mSurface.get()); } if (async) { if (asyncNotify != nullptr) { mResourceManagerProxy->markClientForPendingRemoval(); (new AMessage)->postReply(mReplyID); mReplyID = 0; mAsyncReleaseCompleteNotification = asyncNotify; } break; Loading
media/libstagefright/include/media/stagefright/MediaCodec.h +2 −1 Original line number Diff line number Diff line Loading @@ -139,7 +139,7 @@ struct MediaCodec : public AHandler { // object. status_t release(); status_t releaseAsync(); status_t releaseAsync(const sp<AMessage> ¬ify); status_t flush(); Loading Loading @@ -383,6 +383,7 @@ private: sp<AMessage> mInputFormat; sp<AMessage> mCallback; sp<AMessage> mOnFrameRenderedNotification; sp<AMessage> mAsyncReleaseCompleteNotification; sp<ResourceManagerServiceProxy> mResourceManagerProxy; Loading