Loading include/media/stagefright/ACodec.h +1 −1 Original line number Diff line number Diff line Loading @@ -278,7 +278,7 @@ private: void deferMessage(const sp<AMessage> &msg); void processDeferredMessages(); void sendFormatChange(); void sendFormatChange(const sp<AMessage> &reply); void signalError( OMX_ERRORTYPE error = OMX_ErrorUndefined, Loading media/libstagefright/ACodec.cpp +18 −13 Original line number Diff line number Diff line Loading @@ -2229,7 +2229,7 @@ void ACodec::processDeferredMessages() { } } void ACodec::sendFormatChange() { void ACodec::sendFormatChange(const sp<AMessage> &reply) { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatOutputFormatChanged); Loading Loading @@ -2294,14 +2294,12 @@ void ACodec::sendFormatChange() { rect.nTop + rect.nHeight - 1); if (mNativeWindow != NULL) { android_native_rect_t crop; crop.left = rect.nLeft; crop.top = rect.nTop; crop.right = rect.nLeft + rect.nWidth; crop.bottom = rect.nTop + rect.nHeight; CHECK_EQ(0, native_window_set_crop( mNativeWindow.get(), &crop)); reply->setRect( "crop", rect.nLeft, rect.nTop, rect.nLeft + rect.nWidth, rect.nTop + rect.nHeight); } } break; Loading Loading @@ -3057,8 +3055,11 @@ bool ACodec::BaseState::onOMXFillBufferDone( break; } sp<AMessage> reply = new AMessage(kWhatOutputBufferDrained, mCodec->id()); if (!mCodec->mSentFormat) { mCodec->sendFormatChange(); mCodec->sendFormatChange(reply); } info->mData->setRange(rangeOffset, rangeLength); Loading @@ -3081,9 +3082,6 @@ bool ACodec::BaseState::onOMXFillBufferDone( notify->setBuffer("buffer", info->mData); notify->setInt32("flags", flags); sp<AMessage> reply = new AMessage(kWhatOutputBufferDrained, mCodec->id()); reply->setPointer("buffer-id", info->mBufferID); notify->setMessage("reply", reply); Loading Loading @@ -3127,6 +3125,13 @@ void ACodec::BaseState::onOutputBufferDrained(const sp<AMessage> &msg) { mCodec->findBufferByID(kPortIndexOutput, bufferID, &index); CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_DOWNSTREAM); android_native_rect_t crop; if (msg->findRect("crop", &crop.left, &crop.top, &crop.right, &crop.bottom)) { CHECK_EQ(0, native_window_set_crop( mCodec->mNativeWindow.get(), &crop)); } int32_t render; if (mCodec->mNativeWindow != NULL && msg->findInt32("render", &render) && render != 0 Loading Loading
include/media/stagefright/ACodec.h +1 −1 Original line number Diff line number Diff line Loading @@ -278,7 +278,7 @@ private: void deferMessage(const sp<AMessage> &msg); void processDeferredMessages(); void sendFormatChange(); void sendFormatChange(const sp<AMessage> &reply); void signalError( OMX_ERRORTYPE error = OMX_ErrorUndefined, Loading
media/libstagefright/ACodec.cpp +18 −13 Original line number Diff line number Diff line Loading @@ -2229,7 +2229,7 @@ void ACodec::processDeferredMessages() { } } void ACodec::sendFormatChange() { void ACodec::sendFormatChange(const sp<AMessage> &reply) { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", kWhatOutputFormatChanged); Loading Loading @@ -2294,14 +2294,12 @@ void ACodec::sendFormatChange() { rect.nTop + rect.nHeight - 1); if (mNativeWindow != NULL) { android_native_rect_t crop; crop.left = rect.nLeft; crop.top = rect.nTop; crop.right = rect.nLeft + rect.nWidth; crop.bottom = rect.nTop + rect.nHeight; CHECK_EQ(0, native_window_set_crop( mNativeWindow.get(), &crop)); reply->setRect( "crop", rect.nLeft, rect.nTop, rect.nLeft + rect.nWidth, rect.nTop + rect.nHeight); } } break; Loading Loading @@ -3057,8 +3055,11 @@ bool ACodec::BaseState::onOMXFillBufferDone( break; } sp<AMessage> reply = new AMessage(kWhatOutputBufferDrained, mCodec->id()); if (!mCodec->mSentFormat) { mCodec->sendFormatChange(); mCodec->sendFormatChange(reply); } info->mData->setRange(rangeOffset, rangeLength); Loading @@ -3081,9 +3082,6 @@ bool ACodec::BaseState::onOMXFillBufferDone( notify->setBuffer("buffer", info->mData); notify->setInt32("flags", flags); sp<AMessage> reply = new AMessage(kWhatOutputBufferDrained, mCodec->id()); reply->setPointer("buffer-id", info->mBufferID); notify->setMessage("reply", reply); Loading Loading @@ -3127,6 +3125,13 @@ void ACodec::BaseState::onOutputBufferDrained(const sp<AMessage> &msg) { mCodec->findBufferByID(kPortIndexOutput, bufferID, &index); CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_DOWNSTREAM); android_native_rect_t crop; if (msg->findRect("crop", &crop.left, &crop.top, &crop.right, &crop.bottom)) { CHECK_EQ(0, native_window_set_crop( mCodec->mNativeWindow.get(), &crop)); } int32_t render; if (mCodec->mNativeWindow != NULL && msg->findInt32("render", &render) && render != 0 Loading