// Sets the internal state for this stream renderer void MpStreamFeeder::setState(FeederState state) { if ((m_state != state) && isValidStateChange(m_state, state)) { m_state = state ; switch (m_state) { case UnrealizedState: break ; case RealizedState: fireEvent(FeederRealizedEvent) ; break ; case PrefetchingState: break ; case PrefetchedState: fireEvent(FeederPrefetchedEvent) ; break ; case RendereringState: fireEvent(FeederRenderingEvent) ; break ; case StoppedState: fireEvent(FeederStoppedEvent) ; break ; case FailedState: fireEvent(FeederFailedEvent) ; break ; } } }
// Sets the internal state for this resource void MpStreamPlayer::setState(PlayerState iState) { UtlBoolean bShouldFire = FALSE ; mSemStateGuard.acquire() ; if (isValidStateChange(mState, iState)) { bShouldFire = TRUE ; #ifdef MP_STREAM_DEBUG /* [ */ osPrintf("MpStreamPlayer::setState changed from %s to %s.\n\n", getEventString(mState), getEventString(iState)) ; #endif /* ] */ mState = iState ; } #ifdef MP_STREAM_DEBUG /* [ */ else if (mState != iState) { osPrintf("** WARNING MpStreamPlayer(%08X): invalid state change (%s to %s)\n", this, getEventString(mState), getEventString(iState)) ; } #endif /* MP_STREAM_DEBUG ] */ mSemStateGuard.release() ; if (bShouldFire) fireEvent(iState) ; mSemStateChange.release() ; }