void PV2WayMIO::ParseResponse(const PVAsyncInformationalEvent& aEvent, PVMFFormatType& aMimeString, int& aMedia_type) { PV2WayTrackInfoInterface* aTrackInfoInterface; aTrackInfoInterface = (PV2WayTrackInfoInterface *)aEvent.GetEventExtensionInterface(); if (aTrackInfoInterface) aTrackInfoInterface->GetFormatString(aMimeString); aMedia_type = aEvent.GetLocalBuffer()[0]; }
TPVChannelId GetIdFromLocalBuffer(PVAsyncInformationalEvent &aEvent) { TPVChannelId *channel = (TPVChannelId *) & aEvent.GetLocalBuffer()[4]; return *channel; }
void PlayerDriver::HandleInformationalEvent(const PVAsyncInformationalEvent& aEvent) { switch(aEvent.GetEventType()) { case PVMFInfoEndOfData: LOGV("PVMFInfoEndOfData"); mEndOfData = true; if (mIsLooping) { mDoLoop = true; Cancel(); RunIfNotReady(); } else { mPvPlayer->sendEvent(MEDIA_PLAYBACK_COMPLETE); } break; case PVMFInfoErrorHandlingComplete: LOGW("PVMFInfoErrorHandlingComplete"); RunIfNotReady(); break; case PVMFInfoBufferingStart: LOGV("PVMFInfoBufferingStart"); mPvPlayer->sendEvent(MEDIA_BUFFERING_UPDATE, 0); break; case PVMFInfoBufferingStatus: { uint8 *localBuf = aEvent.GetLocalBuffer(); if (localBuf != NULL) { uint32 bufPercent; oscl_memcpy(&bufPercent, localBuf, sizeof(uint32)); LOGV("PVMFInfoBufferingStatus(%u)", bufPercent); mPvPlayer->sendEvent(MEDIA_BUFFERING_UPDATE, bufPercent); } } break; case PVMFInfoDurationAvailable: LOGV("PVMFInfoDurationAvailable event ...."); { PVUuid infomsguuid = PVMFDurationInfoMessageInterfaceUUID; PVMFDurationInfoMessageInterface* eventMsg = NULL; PVInterface* infoExtInterface = aEvent.GetEventExtensionInterface(); if (infoExtInterface && infoExtInterface->queryInterface(infomsguuid, (PVInterface*&)eventMsg)) { PVUuid eventuuid; int32 infoCode; eventMsg->GetCodeUUID(infoCode, eventuuid); if (eventuuid == infomsguuid) { uint32 SourceDurationInMS = eventMsg->GetDuration(); LOGV(".... with duration = %u ms",SourceDurationInMS); } } } break; case PVMFInfoDataReady: LOGV("PVMFInfoDataReady"); if (mDataReadyReceived) break; mDataReadyReceived = true; // If this is a network stream, we are now ready to play. if (mDownloadContextData && mPrepareDone) { mPvPlayer->sendEvent(MEDIA_PREPARED); } break; case PVMFInfoVideoTrackFallingBehind: LOGW("Video track fell behind"); mPvPlayer->sendEvent(MEDIA_ERROR, PVMFInfoVideoTrackFallingBehind); break; case PVMFInfoPoorlyInterleavedContent: LOGW("Poorly interleaved content."); mPvPlayer->sendEvent(MEDIA_ERROR, PVMFInfoPoorlyInterleavedContent); break; case PVMFInfoContentTruncated: //LOGI("PVMFInfoContentTruncated\n"); break; LOGE("Content is truncated."); break; /* Certain events we don't really care about, but don't * want log spewage, so just no-op them here. */ case PVMFInfoPositionStatus: //LOGI("PVMFInfoPositionStatus\n"); break; case PVMFInfoBufferingComplete: //LOGI("PVMFInfoBufferingComplete\n"); break; case PVMFInfoContentLength: //LOGI("PVMFInfoContentLength: %d\n", (int)get_event_data(aEvent)); break; case PVMFInfoContentType: //LOGI("PVMFInfoContentType: %s\n", (char *)get_event_data(aEvent)); break; case PVMFInfoUnderflow: //LOGI("PVMFInfoUnderflow\n"); break; case PVMFInfoDataDiscarded: //LOGI("PVMFInfoDataDiscarded\n"); break; break; default: LOGV("HandleInformationalEvent: type=%d UNHANDLED", aEvent.GetEventType()); break; } }