Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +17 −11 Original line number Diff line number Diff line Loading @@ -2838,28 +2838,34 @@ void NuPlayer::sendTimedTextData(const sp<ABuffer> &buffer) { } void NuPlayer::sendIMSRxNotice(const sp<AMessage> &msg) { int32_t notice, payloadType, feedbackType, id, bitrate; int32_t payloadType; CHECK(msg->findInt32("IMS-Rx-notice", ¬ice)); CHECK(msg->findInt32("payload-type", &payloadType)); CHECK(msg->findInt32("feedback-type", &feedbackType)); CHECK(msg->findInt32("sender", &id)); Parcel in; in.writeInt32(payloadType); in.writeInt32(feedbackType); in.writeInt32(id); switch (payloadType) { case 205: // TSFB case NuPlayer::RTPSource::RTCP_TSFB: // RTCP TSFB case NuPlayer::RTPSource::RTCP_PSFB: // RTCP PSFB { int32_t feedbackType, id; CHECK(msg->findInt32("feedback-type", &feedbackType)); CHECK(msg->findInt32("sender", &id)); in.writeInt32(feedbackType); in.writeInt32(id); if (payloadType == NuPlayer::RTPSource::RTCP_TSFB) { int32_t bitrate; CHECK(msg->findInt32("bit-rate", &bitrate)); in.writeInt32(bitrate); } break; } case 206: // PSFB case NuPlayer::RTPSource::RTP_CVO: { // nothing to do yet int32_t cvo; CHECK(msg->findInt32("cvo", &cvo)); in.writeInt32(cvo); break; } default: Loading media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +19 −1 Original line number Diff line number Diff line Loading @@ -1050,7 +1050,7 @@ bool NuPlayer::Decoder::onInputBufferFetched(const sp<AMessage> &msg) { uint32_t flags = 0; CHECK(buffer->meta()->findInt64("timeUs", &timeUs)); int32_t eos, csd; int32_t eos, csd, cvo; // we do not expect SYNCFRAME for decoder if (buffer->meta()->findInt32("eos", &eos) && eos) { flags |= MediaCodec::BUFFER_FLAG_EOS; Loading @@ -1058,6 +1058,24 @@ bool NuPlayer::Decoder::onInputBufferFetched(const sp<AMessage> &msg) { flags |= MediaCodec::BUFFER_FLAG_CODECCONFIG; } if (buffer->meta()->findInt32("cvo", (int32_t*)&cvo)) { ALOGV("[%s] cvo(%d) found at %lld us", mComponentName.c_str(), cvo, (long long)timeUs); switch (cvo) { case 0: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_0); break; case 1: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_90); break; case 2: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_180); break; case 3: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_270); break; } } // Modular DRM MediaBufferBase *mediaBuf = NULL; NuPlayerDrm::CryptoInfo *cryptInfo = NULL; Loading media/libmediaplayerservice/nuplayer/RTPSource.cpp +28 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,8 @@ NuPlayer::RTPSource::RTPSource( mInPreparationPhase(true), mRTPConn(new ARTPConnection), mEOSTimeoutAudio(0), mEOSTimeoutVideo(0) { mEOSTimeoutVideo(0), mLastCVOUpdated(-1) { ALOGD("RTPSource initialized with rtpParams=%s", rtpParams.string()); } Loading Loading @@ -92,7 +93,7 @@ void NuPlayer::RTPSource::prepareAsync() { AString sdp; ASessionDescription::SDPStringFactory(sdp, info->mLocalIp, info->mIsAudio, info->mLocalPort, info->mPayloadType, info->mAS, info->mCodecName, NULL, info->mWidth, info->mHeight); NULL, info->mWidth, info->mHeight, info->mCVOExtMap); ALOGD("RTPSource SDP =>\n%s", sdp.c_str()); sp<ASessionDescription> desc = new ASessionDescription; Loading Loading @@ -273,7 +274,29 @@ status_t NuPlayer::RTPSource::dequeueAccessUnit( setEOSTimeout(audio, 0); return source->dequeueAccessUnit(accessUnit); finalResult = source->dequeueAccessUnit(accessUnit); if (finalResult != OK) { return finalResult; } int32_t cvo; if ((*accessUnit) != NULL && (*accessUnit)->meta()->findInt32("cvo", &cvo)) { if (cvo != mLastCVOUpdated) { sp<AMessage> msg = new AMessage(); msg->setInt32("payload-type", NuPlayer::RTPSource::RTP_CVO); msg->setInt32("cvo", cvo); sp<AMessage> notify = dupNotify(); notify->setInt32("what", kWhatIMSRxNotice); notify->setMessage("message", msg); notify->post(); ALOGV("notify cvo updated (%d)->(%d) to upper layer", mLastCVOUpdated, cvo); mLastCVOUpdated = cvo; } } return finalResult; } sp<AnotherPacketSource> NuPlayer::RTPSource::getSource(bool audio) { Loading Loading @@ -666,6 +689,8 @@ status_t NuPlayer::RTPSource::setParameter(const String8 &key, const String8 &va } else if (key == "rtp-param-time-scale") { } else if (key == "rtp-param-self-id") { info->mSelfID = atoi(value); } else if (key == "rtp-param-ext-cvo-extmap") { info->mCVOExtMap = atoi(value); } return OK; Loading media/libmediaplayerservice/nuplayer/RTPSource.h +9 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,12 @@ struct NuPlayer::RTPSource : public NuPlayer::Source { const sp<AMessage> ¬ify, const String8& rtpParams); enum { RTCP_TSFB = 205, RTCP_PSFB = 206, RTP_CVO = 300, }; virtual status_t getBufferingSettings( BufferingSettings* buffering /* nonnull */) override; virtual status_t setBufferingSettings(const BufferingSettings& buffering) override; Loading Loading @@ -116,6 +122,8 @@ private: /* Unique ID indicates itself */ uint32_t mSelfID; /* extmap:<value> for CVO will be set to here */ int32_t mCVOExtMap; /* a copy of TrackInfo in RTSPSource */ sp<AnotherPacketSource> mSource; Loading Loading @@ -168,6 +176,7 @@ private: int64_t mMediaAnchorUs; int64_t mLastMediaTimeUs; int64_t mNumAccessUnitsReceived; int32_t mLastCVOUpdated; bool mReceivedFirstRTCPPacket; bool mReceivedFirstRTPPacket; bool mPausing; Loading media/libstagefright/ACodec.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -6164,6 +6164,13 @@ void ACodec::BaseState::onInputBufferFilled(const sp<AMessage> &msg) { return; } int32_t cvo; if (mCodec->mNativeWindow != NULL && buffer != NULL && buffer->meta()->findInt32("cvo", &cvo)) { ALOGV("cvo(%d) found in buffer #%u", cvo, bufferID); setNativeWindowRotation(mCodec->mNativeWindow.get(), cvo); } info->mStatus = BufferInfo::OWNED_BY_US; info->mData = buffer; Loading Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +17 −11 Original line number Diff line number Diff line Loading @@ -2838,28 +2838,34 @@ void NuPlayer::sendTimedTextData(const sp<ABuffer> &buffer) { } void NuPlayer::sendIMSRxNotice(const sp<AMessage> &msg) { int32_t notice, payloadType, feedbackType, id, bitrate; int32_t payloadType; CHECK(msg->findInt32("IMS-Rx-notice", ¬ice)); CHECK(msg->findInt32("payload-type", &payloadType)); CHECK(msg->findInt32("feedback-type", &feedbackType)); CHECK(msg->findInt32("sender", &id)); Parcel in; in.writeInt32(payloadType); in.writeInt32(feedbackType); in.writeInt32(id); switch (payloadType) { case 205: // TSFB case NuPlayer::RTPSource::RTCP_TSFB: // RTCP TSFB case NuPlayer::RTPSource::RTCP_PSFB: // RTCP PSFB { int32_t feedbackType, id; CHECK(msg->findInt32("feedback-type", &feedbackType)); CHECK(msg->findInt32("sender", &id)); in.writeInt32(feedbackType); in.writeInt32(id); if (payloadType == NuPlayer::RTPSource::RTCP_TSFB) { int32_t bitrate; CHECK(msg->findInt32("bit-rate", &bitrate)); in.writeInt32(bitrate); } break; } case 206: // PSFB case NuPlayer::RTPSource::RTP_CVO: { // nothing to do yet int32_t cvo; CHECK(msg->findInt32("cvo", &cvo)); in.writeInt32(cvo); break; } default: Loading
media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +19 −1 Original line number Diff line number Diff line Loading @@ -1050,7 +1050,7 @@ bool NuPlayer::Decoder::onInputBufferFetched(const sp<AMessage> &msg) { uint32_t flags = 0; CHECK(buffer->meta()->findInt64("timeUs", &timeUs)); int32_t eos, csd; int32_t eos, csd, cvo; // we do not expect SYNCFRAME for decoder if (buffer->meta()->findInt32("eos", &eos) && eos) { flags |= MediaCodec::BUFFER_FLAG_EOS; Loading @@ -1058,6 +1058,24 @@ bool NuPlayer::Decoder::onInputBufferFetched(const sp<AMessage> &msg) { flags |= MediaCodec::BUFFER_FLAG_CODECCONFIG; } if (buffer->meta()->findInt32("cvo", (int32_t*)&cvo)) { ALOGV("[%s] cvo(%d) found at %lld us", mComponentName.c_str(), cvo, (long long)timeUs); switch (cvo) { case 0: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_0); break; case 1: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_90); break; case 2: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_180); break; case 3: codecBuffer->meta()->setInt32("cvo", MediaCodec::CVO_DEGREE_270); break; } } // Modular DRM MediaBufferBase *mediaBuf = NULL; NuPlayerDrm::CryptoInfo *cryptInfo = NULL; Loading
media/libmediaplayerservice/nuplayer/RTPSource.cpp +28 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,8 @@ NuPlayer::RTPSource::RTPSource( mInPreparationPhase(true), mRTPConn(new ARTPConnection), mEOSTimeoutAudio(0), mEOSTimeoutVideo(0) { mEOSTimeoutVideo(0), mLastCVOUpdated(-1) { ALOGD("RTPSource initialized with rtpParams=%s", rtpParams.string()); } Loading Loading @@ -92,7 +93,7 @@ void NuPlayer::RTPSource::prepareAsync() { AString sdp; ASessionDescription::SDPStringFactory(sdp, info->mLocalIp, info->mIsAudio, info->mLocalPort, info->mPayloadType, info->mAS, info->mCodecName, NULL, info->mWidth, info->mHeight); NULL, info->mWidth, info->mHeight, info->mCVOExtMap); ALOGD("RTPSource SDP =>\n%s", sdp.c_str()); sp<ASessionDescription> desc = new ASessionDescription; Loading Loading @@ -273,7 +274,29 @@ status_t NuPlayer::RTPSource::dequeueAccessUnit( setEOSTimeout(audio, 0); return source->dequeueAccessUnit(accessUnit); finalResult = source->dequeueAccessUnit(accessUnit); if (finalResult != OK) { return finalResult; } int32_t cvo; if ((*accessUnit) != NULL && (*accessUnit)->meta()->findInt32("cvo", &cvo)) { if (cvo != mLastCVOUpdated) { sp<AMessage> msg = new AMessage(); msg->setInt32("payload-type", NuPlayer::RTPSource::RTP_CVO); msg->setInt32("cvo", cvo); sp<AMessage> notify = dupNotify(); notify->setInt32("what", kWhatIMSRxNotice); notify->setMessage("message", msg); notify->post(); ALOGV("notify cvo updated (%d)->(%d) to upper layer", mLastCVOUpdated, cvo); mLastCVOUpdated = cvo; } } return finalResult; } sp<AnotherPacketSource> NuPlayer::RTPSource::getSource(bool audio) { Loading Loading @@ -666,6 +689,8 @@ status_t NuPlayer::RTPSource::setParameter(const String8 &key, const String8 &va } else if (key == "rtp-param-time-scale") { } else if (key == "rtp-param-self-id") { info->mSelfID = atoi(value); } else if (key == "rtp-param-ext-cvo-extmap") { info->mCVOExtMap = atoi(value); } return OK; Loading
media/libmediaplayerservice/nuplayer/RTPSource.h +9 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,12 @@ struct NuPlayer::RTPSource : public NuPlayer::Source { const sp<AMessage> ¬ify, const String8& rtpParams); enum { RTCP_TSFB = 205, RTCP_PSFB = 206, RTP_CVO = 300, }; virtual status_t getBufferingSettings( BufferingSettings* buffering /* nonnull */) override; virtual status_t setBufferingSettings(const BufferingSettings& buffering) override; Loading Loading @@ -116,6 +122,8 @@ private: /* Unique ID indicates itself */ uint32_t mSelfID; /* extmap:<value> for CVO will be set to here */ int32_t mCVOExtMap; /* a copy of TrackInfo in RTSPSource */ sp<AnotherPacketSource> mSource; Loading Loading @@ -168,6 +176,7 @@ private: int64_t mMediaAnchorUs; int64_t mLastMediaTimeUs; int64_t mNumAccessUnitsReceived; int32_t mLastCVOUpdated; bool mReceivedFirstRTCPPacket; bool mReceivedFirstRTPPacket; bool mPausing; Loading
media/libstagefright/ACodec.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -6164,6 +6164,13 @@ void ACodec::BaseState::onInputBufferFilled(const sp<AMessage> &msg) { return; } int32_t cvo; if (mCodec->mNativeWindow != NULL && buffer != NULL && buffer->meta()->findInt32("cvo", &cvo)) { ALOGV("cvo(%d) found in buffer #%u", cvo, bufferID); setNativeWindowRotation(mCodec->mNativeWindow.get(), cvo); } info->mStatus = BufferInfo::OWNED_BY_US; info->mData = buffer; Loading