summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/wifi-display/rtp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/wifi-display/rtp')
-rw-r--r--media/libstagefright/wifi-display/rtp/RTPAssembler.cpp5
-rw-r--r--media/libstagefright/wifi-display/rtp/RTPReceiver.cpp44
-rw-r--r--media/libstagefright/wifi-display/rtp/RTPReceiver.h2
-rw-r--r--media/libstagefright/wifi-display/rtp/RTPSender.cpp2
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;