void GonkDecoderManager::onMessageReceived(const sp<AMessage> &aMessage) { switch (aMessage->what()) { case kNotifyProcessInput: { int32_t eos = 0; ProcessInput(aMessage->findInt32("input-eos", &eos) && eos); break; } case kNotifyProcessFlush: { ProcessFlush(); break; } case kNotifyDecoderActivity: { int32_t eos = 0; ProcessToDo(aMessage->findInt32("input-eos", &eos) && eos); break; } #ifdef DEBUG case kNotifyFindLooperId: { mTaskLooperId = androidGetThreadId(); MOZ_ASSERT(mTaskLooperId); break; } #endif default: { TRESPASS(); break; } } }
bool GonkDecoderManager::OnTaskLooper() { return androidGetThreadId() == mTaskLooperId; }
bool isCurrentThread() const { return mThreadId == androidGetThreadId(); }
virtual status_t readyToRun() { mThreadId = androidGetThreadId(); return Thread::readyToRun(); }