summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/ARTPConnection.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-08-10 12:59:27 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-08-10 12:59:27 -0700
commit18f0174ff4eef46f121e77a0dc1d7a8271621f48 (patch)
tree8b26b96602be5cf3aa59097317b9e63c1ab4d49a /media/libstagefright/rtsp/ARTPConnection.cpp
parent605f402796afa9c88e2f91284e98d1f59a0726aa (diff)
parentf88f84414ae7baead03497f1d650ad8ea2f87688 (diff)
downloadframeworks_base-18f0174ff4eef46f121e77a0dc1d7a8271621f48.zip
frameworks_base-18f0174ff4eef46f121e77a0dc1d7a8271621f48.tar.gz
frameworks_base-18f0174ff4eef46f121e77a0dc1d7a8271621f48.tar.bz2
Merge "We're now going to ignore timestamps completely in gtalk video conferencing, playing video as soon as it comes in. We also make up fake timestamps in the rtp code, ignoring rtcp SR information to enable early startup." into gingerbread
Diffstat (limited to 'media/libstagefright/rtsp/ARTPConnection.cpp')
-rw-r--r--media/libstagefright/rtsp/ARTPConnection.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/media/libstagefright/rtsp/ARTPConnection.cpp b/media/libstagefright/rtsp/ARTPConnection.cpp
index 5bd306b..469af3e 100644
--- a/media/libstagefright/rtsp/ARTPConnection.cpp
+++ b/media/libstagefright/rtsp/ARTPConnection.cpp
@@ -28,8 +28,6 @@
#include <arpa/inet.h>
#include <sys/socket.h>
-#define IGNORE_RTCP_TIME 0
-
namespace android {
static const size_t kMaxUDPSize = 1500;
@@ -61,8 +59,9 @@ struct ARTPConnection::StreamInfo {
struct sockaddr_in mRemoteRTCPAddr;
};
-ARTPConnection::ARTPConnection()
- : mPollEventPending(false),
+ARTPConnection::ARTPConnection(uint32_t flags)
+ : mFlags(flags),
+ mPollEventPending(false),
mLastReceiverReportTimeUs(-1) {
}
@@ -280,7 +279,10 @@ void ARTPConnection::onPollStreams() {
sp<ARTPSource> source = s->mSources.valueAt(i);
source->addReceiverReport(buffer);
- source->addFIR(buffer);
+
+ if (mFlags & kRegularlyRequestFIR) {
+ source->addFIR(buffer);
+ }
}
if (buffer->size() > 0) {
@@ -405,13 +407,11 @@ status_t ARTPConnection::parseRTP(StreamInfo *s, const sp<ABuffer> &buffer) {
buffer->setInt32Data(u16at(&data[2]));
buffer->setRange(payloadOffset, size - payloadOffset);
-#if IGNORE_RTCP_TIME
- if (!source->timeEstablished()) {
+ if ((mFlags & kFakeTimestamps) && !source->timeEstablished()) {
source->timeUpdate(rtpTime, 0);
- source->timeUpdate(rtpTime + 20, 0x100000000ll);
+ source->timeUpdate(rtpTime + 90000, 0x100000000ll);
CHECK(source->timeEstablished());
}
-#endif
source->processRTPPacket(buffer);
@@ -533,9 +533,9 @@ status_t ARTPConnection::parseSR(
sp<ARTPSource> source = findSource(s, id);
-#if !IGNORE_RTCP_TIME
- source->timeUpdate(rtpTime, ntpTime);
-#endif
+ if ((mFlags & kFakeTimestamps) == 0) {
+ source->timeUpdate(rtpTime, ntpTime);
+ }
return 0;
}