diff options
author | Andreas Huber <andih@google.com> | 2013-03-12 11:01:43 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2013-03-12 13:44:58 -0700 |
commit | d5e56231a598b180a1d898bb7dc61b75580e59a4 (patch) | |
tree | 7bb3e14a2c8212813d6e33cb3c7a8da2470d58f5 /media/libstagefright/wifi-display/rtp | |
parent | e6800cea0678dbc0bf697b44c3e4548b0253085c (diff) | |
download | frameworks_av-d5e56231a598b180a1d898bb7dc61b75580e59a4.zip frameworks_av-d5e56231a598b180a1d898bb7dc61b75580e59a4.tar.gz frameworks_av-d5e56231a598b180a1d898bb7dc61b75580e59a4.tar.bz2 |
Squashed commit of the following:
commit f4edf442741886cdbe071e2d15f6e6247269f7c5
Author: Andreas Huber <andih@google.com>
Date: Tue Mar 12 09:09:18 2013 -0700
Pass additional flags to the sink, use TCP by default in wolfiecast mode.
Change-Id: I41e11a2375d4199656e45c4f149d8441d0016092
commit 6302602ed280a38287f507159abfb40a1da38c5a
Author: Andreas Huber <andih@google.com>
Date: Tue Mar 12 08:51:58 2013 -0700
tweaks
Change-Id: Ie29e422d7258be522f4bb1f6c5afcf74c937e547
commit a38a860e4979ba563cadbaafa21b084439449d26
Author: Andreas Huber <andih@google.com>
Date: Mon Mar 11 16:57:43 2013 -0700
Report average lateness all the way from NuPlayerRenderer...
Change-Id: I2e7700703ae656515e44b9c25610d26c75778111
commit a7d49b11675ea88be4029dd8451d1649db94571d
Author: Andreas Huber <andih@google.com>
Date: Mon Mar 11 14:54:19 2013 -0700
Make TimeSyncer smarter, enable TunnelRenderer
Change-Id: I27377a60cd8feb01589da456967fddd34532c20e
commit 0f214c8ef68179f7b61512c37040939554013151
Author: Andreas Huber <andih@google.com>
Date: Thu Mar 7 15:57:56 2013 -0800
convert source timestamps to sink timestamps, report lateness.
Change-Id: I051a60fbbceca2f7b508ae3dac6e01e402bae39e
commit 04a4f8e16bad09157b5615a5fa45310438955832
Author: Andreas Huber <andih@google.com>
Date: Thu Mar 7 09:00:28 2013 -0800
Sync time between sink and source.
Change-Id: Ie8b4d75c957aa48310e7c81d1279761b9f821efe
commit aebe20e6184e3636a99082f8ece08e708015cb8d
Author: Andreas Huber <andih@google.com>
Date: Wed Mar 6 09:03:12 2013 -0800
play with back pressure
Change-Id: I51eb69257e6a79e76f5f9c75ff99d8adbd083947
Change-Id: Ifdf57228667fed7fc71c5090a2c3f7cea1037c5c
Diffstat (limited to 'media/libstagefright/wifi-display/rtp')
4 files changed, 49 insertions, 4 deletions
diff --git a/media/libstagefright/wifi-display/rtp/RTPAssembler.cpp b/media/libstagefright/wifi-display/rtp/RTPAssembler.cpp index d0ab60d..5f189e7 100644 --- a/media/libstagefright/wifi-display/rtp/RTPAssembler.cpp +++ b/media/libstagefright/wifi-display/rtp/RTPAssembler.cpp @@ -53,6 +53,11 @@ void RTPReceiver::TSAssembler::signalDiscontinuity() { } status_t RTPReceiver::TSAssembler::processPacket(const sp<ABuffer> &packet) { + int32_t rtpTime; + CHECK(packet->meta()->findInt32("rtp-time", &rtpTime)); + + packet->meta()->setInt64("timeUs", (rtpTime * 100ll) / 9); + postAccessUnit(packet, mSawDiscontinuity); if (mSawDiscontinuity) { diff --git a/media/libstagefright/wifi-display/rtp/RTPReceiver.cpp b/media/libstagefright/wifi-display/rtp/RTPReceiver.cpp index 29482af..8711b08 100644 --- a/media/libstagefright/wifi-display/rtp/RTPReceiver.cpp +++ b/media/libstagefright/wifi-display/rtp/RTPReceiver.cpp @@ -221,10 +221,12 @@ void RTPReceiver::Source::dequeueMore() { mNumDeclaredLostPrior = mNumDeclaredLost; - ALOGI("lost %lld packets (%.2f %%), declared %d lost\n", - lostInterval, - 100.0f * lostInterval / expectedInterval, - declaredLostInterval); + if (declaredLostInterval > 0) { + ALOGI("lost %lld packets (%.2f %%), declared %d lost\n", + lostInterval, + 100.0f * lostInterval / expectedInterval, + declaredLostInterval); + } } mNextReportTimeUs = nowUs + kReportIntervalUs; @@ -530,6 +532,40 @@ status_t RTPReceiver::connect( return OK; } +status_t RTPReceiver::notifyLateness(int64_t latenessUs) { + sp<ABuffer> buf = new ABuffer(20); + + uint8_t *ptr = buf->data(); + ptr[0] = 0x80 | 0; + ptr[1] = 204; // APP + ptr[2] = 0; + + CHECK((buf->size() % 4) == 0u); + ptr[3] = (buf->size() / 4) - 1; + + ptr[4] = kSourceID >> 24; // SSRC + ptr[5] = (kSourceID >> 16) & 0xff; + ptr[6] = (kSourceID >> 8) & 0xff; + ptr[7] = kSourceID & 0xff; + ptr[8] = 'l'; + ptr[9] = 'a'; + ptr[10] = 't'; + ptr[11] = 'e'; + + ptr[12] = latenessUs >> 56; + ptr[13] = (latenessUs >> 48) & 0xff; + ptr[14] = (latenessUs >> 40) & 0xff; + ptr[15] = (latenessUs >> 32) & 0xff; + ptr[16] = (latenessUs >> 24) & 0xff; + ptr[17] = (latenessUs >> 16) & 0xff; + ptr[18] = (latenessUs >> 8) & 0xff; + ptr[19] = latenessUs & 0xff; + + mNetSession->sendRequest(mRTCPSessionID, buf->data(), buf->size()); + + return OK; +} + void RTPReceiver::onMessageReceived(const sp<AMessage> &msg) { switch (msg->what()) { case kWhatRTPNotify: diff --git a/media/libstagefright/wifi-display/rtp/RTPReceiver.h b/media/libstagefright/wifi-display/rtp/RTPReceiver.h index 2ae864a..ec4671d 100644 --- a/media/libstagefright/wifi-display/rtp/RTPReceiver.h +++ b/media/libstagefright/wifi-display/rtp/RTPReceiver.h @@ -53,6 +53,8 @@ struct RTPReceiver : public RTPBase, public AHandler { int32_t remoteRTPPort, int32_t remoteRTCPPort); + status_t notifyLateness(int64_t latenessUs); + protected: virtual ~RTPReceiver(); virtual void onMessageReceived(const sp<AMessage> &msg); diff --git a/media/libstagefright/wifi-display/rtp/RTPSender.cpp b/media/libstagefright/wifi-display/rtp/RTPSender.cpp index 85c5933..b60853d 100644 --- a/media/libstagefright/wifi-display/rtp/RTPSender.cpp +++ b/media/libstagefright/wifi-display/rtp/RTPSender.cpp @@ -577,6 +577,8 @@ status_t RTPSender::onRTCPData(const sp<ABuffer> &buffer) { case 202: // SDES case 203: + break; + case 204: // APP break; |