Loading cmds/stagefright/sf2.cpp +8 −14 Original line number Diff line number Diff line Loading @@ -211,28 +211,28 @@ protected: int32_t what; CHECK(msg->findInt32("what", &what)); if (what == ACodec::kWhatFillThisBuffer) { if (what == CodecBase::kWhatFillThisBuffer) { onFillThisBuffer(msg); } else if (what == ACodec::kWhatDrainThisBuffer) { } else if (what == CodecBase::kWhatDrainThisBuffer) { if ((mNumOutputBuffersReceived++ % 16) == 0) { printf("."); fflush(stdout); } onDrainThisBuffer(msg); } else if (what == ACodec::kWhatEOS || what == ACodec::kWhatError) { printf((what == ACodec::kWhatEOS) ? "$\n" : "E\n"); } else if (what == CodecBase::kWhatEOS || what == CodecBase::kWhatError) { printf((what == CodecBase::kWhatEOS) ? "$\n" : "E\n"); printStatistics(); (new AMessage(kWhatStop, id()))->post(); } else if (what == ACodec::kWhatFlushCompleted) { } else if (what == CodecBase::kWhatFlushCompleted) { mSeekState = SEEK_FLUSH_COMPLETED; mCodec->signalResume(); (new AMessage(kWhatSeek, id()))->post(5000000ll); } else if (what == ACodec::kWhatOutputFormatChanged) { } else if (what == ACodec::kWhatShutdownCompleted) { } else if (what == CodecBase::kWhatOutputFormatChanged) { } else if (what == CodecBase::kWhatShutdownCompleted) { mDecodeLooper->unregisterHandler(mCodec->id()); if (mDecodeLooper != looper()) { Loading @@ -240,12 +240,6 @@ protected: } looper()->stop(); } else if (what == ACodec::kWhatError) { ALOGE("something went wrong, codec reported an error."); printf("E\n"); (new AMessage(kWhatStop, id()))->post(); } break; } Loading include/media/stagefright/ACodec.h +0 −15 Original line number Diff line number Diff line Loading @@ -34,21 +34,6 @@ struct ABuffer; struct MemoryDealer; struct ACodec : public AHierarchicalStateMachine, public CodecBase { enum { kWhatFillThisBuffer = CodecBase::kWhatFillThisBuffer, kWhatDrainThisBuffer = CodecBase::kWhatDrainThisBuffer, kWhatEOS = CodecBase::kWhatEOS, kWhatShutdownCompleted = CodecBase::kWhatShutdownCompleted, kWhatFlushCompleted = CodecBase::kWhatFlushCompleted, kWhatOutputFormatChanged = CodecBase::kWhatOutputFormatChanged, kWhatError = CodecBase::kWhatError, kWhatComponentAllocated = CodecBase::kWhatComponentAllocated, kWhatComponentConfigured = CodecBase::kWhatComponentConfigured, kWhatInputSurfaceCreated = CodecBase::kWhatInputSurfaceCreated, kWhatSignaledInputEOS = CodecBase::kWhatSignaledInputEOS, kWhatBuffersAllocated = CodecBase::kWhatBuffersAllocated, }; ACodec(); virtual void setNotificationMessage(const sp<AMessage> &msg); Loading media/libstagefright/ACodec.cpp +16 −16 Original line number Diff line number Diff line Loading @@ -547,7 +547,7 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { } sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", ACodec::kWhatBuffersAllocated); notify->setInt32("what", CodecBase::kWhatBuffersAllocated); notify->setInt32("portIndex", portIndex); Loading Loading @@ -3005,7 +3005,7 @@ void ACodec::sendFormatChange(const sp<AMessage> &reply) { void ACodec::signalError(OMX_ERRORTYPE error, status_t internalError) { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", ACodec::kWhatError); notify->setInt32("what", CodecBase::kWhatError); notify->setInt32("omx-error", error); notify->setInt32("err", internalError); notify->post(); Loading Loading @@ -3398,7 +3398,7 @@ void ACodec::BaseState::postFillThisBuffer(BufferInfo *info) { CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_US); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFillThisBuffer); notify->setInt32("what", CodecBase::kWhatFillThisBuffer); notify->setInt32("buffer-id", info->mBufferID); info->mData->meta()->clear(); Loading Loading @@ -3693,7 +3693,7 @@ bool ACodec::BaseState::onOMXFillBufferDone( info->mData->meta()->setInt64("timeUs", timeUs); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatDrainThisBuffer); notify->setInt32("what", CodecBase::kWhatDrainThisBuffer); notify->setInt32("buffer-id", info->mBufferID); notify->setBuffer("buffer", info->mData); notify->setInt32("flags", flags); Loading @@ -3710,7 +3710,7 @@ bool ACodec::BaseState::onOMXFillBufferDone( ALOGV("[%s] saw output EOS", mCodec->mComponentName.c_str()); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatEOS); notify->setInt32("what", CodecBase::kWhatEOS); notify->setInt32("err", mCodec->mInputEOSResult); notify->post(); Loading Loading @@ -3891,7 +3891,7 @@ bool ACodec::UninitializedState::onMessageReceived(const sp<AMessage> &msg) { "cannot keep component allocated on shutdown in Uninitialized state"); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatShutdownCompleted); notify->setInt32("what", CodecBase::kWhatShutdownCompleted); notify->post(); handled = true; Loading @@ -3901,7 +3901,7 @@ bool ACodec::UninitializedState::onMessageReceived(const sp<AMessage> &msg) { case ACodec::kWhatFlush: { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); handled = true; Loading Loading @@ -4023,7 +4023,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatComponentAllocated); notify->setInt32("what", CodecBase::kWhatComponentAllocated); notify->setString("componentName", mCodec->mComponentName.c_str()); notify->post(); } Loading Loading @@ -4073,7 +4073,7 @@ void ACodec::LoadedState::onShutdown(bool keepComponentAllocated) { if (mCodec->mExplicitShutdown) { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatShutdownCompleted); notify->setInt32("what", CodecBase::kWhatShutdownCompleted); notify->post(); mCodec->mExplicitShutdown = false; } Loading Loading @@ -4120,7 +4120,7 @@ bool ACodec::LoadedState::onMessageReceived(const sp<AMessage> &msg) { case ACodec::kWhatFlush: { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); handled = true; Loading Loading @@ -4169,7 +4169,7 @@ bool ACodec::LoadedState::onConfigureComponent( { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatComponentConfigured); notify->setInt32("what", CodecBase::kWhatComponentConfigured); notify->setMessage("input-format", mCodec->mInputFormat); notify->setMessage("output-format", mCodec->mOutputFormat); notify->post(); Loading @@ -4183,7 +4183,7 @@ void ACodec::LoadedState::onCreateInputSurface( ALOGV("onCreateInputSurface"); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatInputSurfaceCreated); notify->setInt32("what", CodecBase::kWhatInputSurfaceCreated); sp<IGraphicBufferProducer> bufferProducer; status_t err; Loading Loading @@ -4337,7 +4337,7 @@ bool ACodec::LoadedToIdleState::onMessageReceived(const sp<AMessage> &msg) { { // We haven't even started yet, so we're flushed alright... sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); return true; } Loading Loading @@ -4398,7 +4398,7 @@ bool ACodec::IdleToExecutingState::onMessageReceived(const sp<AMessage> &msg) { { // We haven't even started yet, so we're flushed alright... sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); return true; Loading Loading @@ -4701,7 +4701,7 @@ status_t ACodec::setParameters(const sp<AMessage> ¶ms) { void ACodec::onSignalEndOfInputStream() { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", ACodec::kWhatSignaledInputEOS); notify->setInt32("what", CodecBase::kWhatSignaledInputEOS); status_t err = mOMX->signalEndOfInputStream(mNode); if (err != OK) { Loading Loading @@ -5131,7 +5131,7 @@ void ACodec::FlushingState::changeStateIfWeOwnAllBuffers() { mCodec->waitUntilAllPossibleNativeWindowBuffersAreReturnedToUs(); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); mCodec->mPortEOS[kPortIndexInput] = Loading Loading
cmds/stagefright/sf2.cpp +8 −14 Original line number Diff line number Diff line Loading @@ -211,28 +211,28 @@ protected: int32_t what; CHECK(msg->findInt32("what", &what)); if (what == ACodec::kWhatFillThisBuffer) { if (what == CodecBase::kWhatFillThisBuffer) { onFillThisBuffer(msg); } else if (what == ACodec::kWhatDrainThisBuffer) { } else if (what == CodecBase::kWhatDrainThisBuffer) { if ((mNumOutputBuffersReceived++ % 16) == 0) { printf("."); fflush(stdout); } onDrainThisBuffer(msg); } else if (what == ACodec::kWhatEOS || what == ACodec::kWhatError) { printf((what == ACodec::kWhatEOS) ? "$\n" : "E\n"); } else if (what == CodecBase::kWhatEOS || what == CodecBase::kWhatError) { printf((what == CodecBase::kWhatEOS) ? "$\n" : "E\n"); printStatistics(); (new AMessage(kWhatStop, id()))->post(); } else if (what == ACodec::kWhatFlushCompleted) { } else if (what == CodecBase::kWhatFlushCompleted) { mSeekState = SEEK_FLUSH_COMPLETED; mCodec->signalResume(); (new AMessage(kWhatSeek, id()))->post(5000000ll); } else if (what == ACodec::kWhatOutputFormatChanged) { } else if (what == ACodec::kWhatShutdownCompleted) { } else if (what == CodecBase::kWhatOutputFormatChanged) { } else if (what == CodecBase::kWhatShutdownCompleted) { mDecodeLooper->unregisterHandler(mCodec->id()); if (mDecodeLooper != looper()) { Loading @@ -240,12 +240,6 @@ protected: } looper()->stop(); } else if (what == ACodec::kWhatError) { ALOGE("something went wrong, codec reported an error."); printf("E\n"); (new AMessage(kWhatStop, id()))->post(); } break; } Loading
include/media/stagefright/ACodec.h +0 −15 Original line number Diff line number Diff line Loading @@ -34,21 +34,6 @@ struct ABuffer; struct MemoryDealer; struct ACodec : public AHierarchicalStateMachine, public CodecBase { enum { kWhatFillThisBuffer = CodecBase::kWhatFillThisBuffer, kWhatDrainThisBuffer = CodecBase::kWhatDrainThisBuffer, kWhatEOS = CodecBase::kWhatEOS, kWhatShutdownCompleted = CodecBase::kWhatShutdownCompleted, kWhatFlushCompleted = CodecBase::kWhatFlushCompleted, kWhatOutputFormatChanged = CodecBase::kWhatOutputFormatChanged, kWhatError = CodecBase::kWhatError, kWhatComponentAllocated = CodecBase::kWhatComponentAllocated, kWhatComponentConfigured = CodecBase::kWhatComponentConfigured, kWhatInputSurfaceCreated = CodecBase::kWhatInputSurfaceCreated, kWhatSignaledInputEOS = CodecBase::kWhatSignaledInputEOS, kWhatBuffersAllocated = CodecBase::kWhatBuffersAllocated, }; ACodec(); virtual void setNotificationMessage(const sp<AMessage> &msg); Loading
media/libstagefright/ACodec.cpp +16 −16 Original line number Diff line number Diff line Loading @@ -547,7 +547,7 @@ status_t ACodec::allocateBuffersOnPort(OMX_U32 portIndex) { } sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", ACodec::kWhatBuffersAllocated); notify->setInt32("what", CodecBase::kWhatBuffersAllocated); notify->setInt32("portIndex", portIndex); Loading Loading @@ -3005,7 +3005,7 @@ void ACodec::sendFormatChange(const sp<AMessage> &reply) { void ACodec::signalError(OMX_ERRORTYPE error, status_t internalError) { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", ACodec::kWhatError); notify->setInt32("what", CodecBase::kWhatError); notify->setInt32("omx-error", error); notify->setInt32("err", internalError); notify->post(); Loading Loading @@ -3398,7 +3398,7 @@ void ACodec::BaseState::postFillThisBuffer(BufferInfo *info) { CHECK_EQ((int)info->mStatus, (int)BufferInfo::OWNED_BY_US); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFillThisBuffer); notify->setInt32("what", CodecBase::kWhatFillThisBuffer); notify->setInt32("buffer-id", info->mBufferID); info->mData->meta()->clear(); Loading Loading @@ -3693,7 +3693,7 @@ bool ACodec::BaseState::onOMXFillBufferDone( info->mData->meta()->setInt64("timeUs", timeUs); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatDrainThisBuffer); notify->setInt32("what", CodecBase::kWhatDrainThisBuffer); notify->setInt32("buffer-id", info->mBufferID); notify->setBuffer("buffer", info->mData); notify->setInt32("flags", flags); Loading @@ -3710,7 +3710,7 @@ bool ACodec::BaseState::onOMXFillBufferDone( ALOGV("[%s] saw output EOS", mCodec->mComponentName.c_str()); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatEOS); notify->setInt32("what", CodecBase::kWhatEOS); notify->setInt32("err", mCodec->mInputEOSResult); notify->post(); Loading Loading @@ -3891,7 +3891,7 @@ bool ACodec::UninitializedState::onMessageReceived(const sp<AMessage> &msg) { "cannot keep component allocated on shutdown in Uninitialized state"); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatShutdownCompleted); notify->setInt32("what", CodecBase::kWhatShutdownCompleted); notify->post(); handled = true; Loading @@ -3901,7 +3901,7 @@ bool ACodec::UninitializedState::onMessageReceived(const sp<AMessage> &msg) { case ACodec::kWhatFlush: { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); handled = true; Loading Loading @@ -4023,7 +4023,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatComponentAllocated); notify->setInt32("what", CodecBase::kWhatComponentAllocated); notify->setString("componentName", mCodec->mComponentName.c_str()); notify->post(); } Loading Loading @@ -4073,7 +4073,7 @@ void ACodec::LoadedState::onShutdown(bool keepComponentAllocated) { if (mCodec->mExplicitShutdown) { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatShutdownCompleted); notify->setInt32("what", CodecBase::kWhatShutdownCompleted); notify->post(); mCodec->mExplicitShutdown = false; } Loading Loading @@ -4120,7 +4120,7 @@ bool ACodec::LoadedState::onMessageReceived(const sp<AMessage> &msg) { case ACodec::kWhatFlush: { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); handled = true; Loading Loading @@ -4169,7 +4169,7 @@ bool ACodec::LoadedState::onConfigureComponent( { sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatComponentConfigured); notify->setInt32("what", CodecBase::kWhatComponentConfigured); notify->setMessage("input-format", mCodec->mInputFormat); notify->setMessage("output-format", mCodec->mOutputFormat); notify->post(); Loading @@ -4183,7 +4183,7 @@ void ACodec::LoadedState::onCreateInputSurface( ALOGV("onCreateInputSurface"); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatInputSurfaceCreated); notify->setInt32("what", CodecBase::kWhatInputSurfaceCreated); sp<IGraphicBufferProducer> bufferProducer; status_t err; Loading Loading @@ -4337,7 +4337,7 @@ bool ACodec::LoadedToIdleState::onMessageReceived(const sp<AMessage> &msg) { { // We haven't even started yet, so we're flushed alright... sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); return true; } Loading Loading @@ -4398,7 +4398,7 @@ bool ACodec::IdleToExecutingState::onMessageReceived(const sp<AMessage> &msg) { { // We haven't even started yet, so we're flushed alright... sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); return true; Loading Loading @@ -4701,7 +4701,7 @@ status_t ACodec::setParameters(const sp<AMessage> ¶ms) { void ACodec::onSignalEndOfInputStream() { sp<AMessage> notify = mNotify->dup(); notify->setInt32("what", ACodec::kWhatSignaledInputEOS); notify->setInt32("what", CodecBase::kWhatSignaledInputEOS); status_t err = mOMX->signalEndOfInputStream(mNode); if (err != OK) { Loading Loading @@ -5131,7 +5131,7 @@ void ACodec::FlushingState::changeStateIfWeOwnAllBuffers() { mCodec->waitUntilAllPossibleNativeWindowBuffersAreReturnedToUs(); sp<AMessage> notify = mCodec->mNotify->dup(); notify->setInt32("what", ACodec::kWhatFlushCompleted); notify->setInt32("what", CodecBase::kWhatFlushCompleted); notify->post(); mCodec->mPortEOS[kPortIndexInput] = Loading