Loading media/libstagefright/ACodec.cpp +40 −0 Original line number Diff line number Diff line Loading @@ -5556,6 +5556,11 @@ bool ACodec::BaseState::onMessageReceived(const sp<AMessage> &msg) { break; } case kWhatCheckIfStuck: { ALOGV("No-op by default"); break; } default: return false; } Loading Loading @@ -7873,6 +7878,18 @@ bool ACodec::OutputPortSettingsChangedState::onMessageReceived( break; } case kWhatCheckIfStuck: { int32_t generation = 0; CHECK(msg->findInt32("generation", &generation)); if (generation == mCodec->mStateGeneration) { mCodec->signalError(OMX_ErrorUndefined, TIMED_OUT); } handled = true; break; } default: handled = BaseState::onMessageReceived(msg); break; Loading @@ -7884,6 +7901,11 @@ bool ACodec::OutputPortSettingsChangedState::onMessageReceived( void ACodec::OutputPortSettingsChangedState::stateEntered() { ALOGV("[%s] Now handling output port settings change", mCodec->mComponentName.c_str()); // If we haven't transitioned after 3 seconds, we're probably stuck. sp<AMessage> msg = new AMessage(ACodec::kWhatCheckIfStuck, mCodec); msg->setInt32("generation", mCodec->mStateGeneration); msg->post(3000000); } bool ACodec::OutputPortSettingsChangedState::onOMXFrameRendered( Loading Loading @@ -8146,6 +8168,11 @@ void ACodec::FlushingState::stateEntered() { ALOGV("[%s] Now Flushing", mCodec->mComponentName.c_str()); mFlushComplete[kPortIndexInput] = mFlushComplete[kPortIndexOutput] = false; // If we haven't transitioned after 3 seconds, we're probably stuck. sp<AMessage> msg = new AMessage(ACodec::kWhatCheckIfStuck, mCodec); msg->setInt32("generation", mCodec->mStateGeneration); msg->post(3000000); } bool ACodec::FlushingState::onMessageReceived(const sp<AMessage> &msg) { Loading @@ -8160,6 +8187,7 @@ bool ACodec::FlushingState::onMessageReceived(const sp<AMessage> &msg) { msg->setInt32("generation", mCodec->mStateGeneration); msg->post(3000000); } handled = true; break; } Loading @@ -8180,6 +8208,18 @@ bool ACodec::FlushingState::onMessageReceived(const sp<AMessage> &msg) { break; } case kWhatCheckIfStuck: { int32_t generation = 0; CHECK(msg->findInt32("generation", &generation)); if (generation == mCodec->mStateGeneration) { mCodec->signalError(OMX_ErrorUndefined, TIMED_OUT); } handled = true; break; } default: handled = BaseState::onMessageReceived(msg); break; Loading media/libstagefright/include/media/stagefright/ACodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ private: kWhatOMXDied = 'OMXd', kWhatReleaseCodecInstance = 'relC', kWhatForceStateTransition = 'fstt', kWhatCheckIfStuck = 'Cstk', }; enum { Loading Loading
media/libstagefright/ACodec.cpp +40 −0 Original line number Diff line number Diff line Loading @@ -5556,6 +5556,11 @@ bool ACodec::BaseState::onMessageReceived(const sp<AMessage> &msg) { break; } case kWhatCheckIfStuck: { ALOGV("No-op by default"); break; } default: return false; } Loading Loading @@ -7873,6 +7878,18 @@ bool ACodec::OutputPortSettingsChangedState::onMessageReceived( break; } case kWhatCheckIfStuck: { int32_t generation = 0; CHECK(msg->findInt32("generation", &generation)); if (generation == mCodec->mStateGeneration) { mCodec->signalError(OMX_ErrorUndefined, TIMED_OUT); } handled = true; break; } default: handled = BaseState::onMessageReceived(msg); break; Loading @@ -7884,6 +7901,11 @@ bool ACodec::OutputPortSettingsChangedState::onMessageReceived( void ACodec::OutputPortSettingsChangedState::stateEntered() { ALOGV("[%s] Now handling output port settings change", mCodec->mComponentName.c_str()); // If we haven't transitioned after 3 seconds, we're probably stuck. sp<AMessage> msg = new AMessage(ACodec::kWhatCheckIfStuck, mCodec); msg->setInt32("generation", mCodec->mStateGeneration); msg->post(3000000); } bool ACodec::OutputPortSettingsChangedState::onOMXFrameRendered( Loading Loading @@ -8146,6 +8168,11 @@ void ACodec::FlushingState::stateEntered() { ALOGV("[%s] Now Flushing", mCodec->mComponentName.c_str()); mFlushComplete[kPortIndexInput] = mFlushComplete[kPortIndexOutput] = false; // If we haven't transitioned after 3 seconds, we're probably stuck. sp<AMessage> msg = new AMessage(ACodec::kWhatCheckIfStuck, mCodec); msg->setInt32("generation", mCodec->mStateGeneration); msg->post(3000000); } bool ACodec::FlushingState::onMessageReceived(const sp<AMessage> &msg) { Loading @@ -8160,6 +8187,7 @@ bool ACodec::FlushingState::onMessageReceived(const sp<AMessage> &msg) { msg->setInt32("generation", mCodec->mStateGeneration); msg->post(3000000); } handled = true; break; } Loading @@ -8180,6 +8208,18 @@ bool ACodec::FlushingState::onMessageReceived(const sp<AMessage> &msg) { break; } case kWhatCheckIfStuck: { int32_t generation = 0; CHECK(msg->findInt32("generation", &generation)); if (generation == mCodec->mStateGeneration) { mCodec->signalError(OMX_ErrorUndefined, TIMED_OUT); } handled = true; break; } default: handled = BaseState::onMessageReceived(msg); break; Loading
media/libstagefright/include/media/stagefright/ACodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,7 @@ private: kWhatOMXDied = 'OMXd', kWhatReleaseCodecInstance = 'relC', kWhatForceStateTransition = 'fstt', kWhatCheckIfStuck = 'Cstk', }; enum { Loading