diff options
author | Andreas Huber <andih@google.com> | 2010-08-10 11:18:36 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-08-10 11:38:18 -0700 |
commit | f8ca90452ff3e252f20de38f1c3eee524c808c3e (patch) | |
tree | f750ba5ede661ba693e727f9de8b88e4d0d6bb41 /media/libstagefright/rtsp/APacketSource.cpp | |
parent | def871da284aa51f129943a86d44ba9ee9d68d28 (diff) | |
download | frameworks_av-f8ca90452ff3e252f20de38f1c3eee524c808c3e.zip frameworks_av-f8ca90452ff3e252f20de38f1c3eee524c808c3e.tar.gz frameworks_av-f8ca90452ff3e252f20de38f1c3eee524c808c3e.tar.bz2 |
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.
Change-Id: Idc3df74b42000f7a6aa3eae090718dc9d9c4186f
Diffstat (limited to 'media/libstagefright/rtsp/APacketSource.cpp')
-rw-r--r-- | media/libstagefright/rtsp/APacketSource.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/media/libstagefright/rtsp/APacketSource.cpp b/media/libstagefright/rtsp/APacketSource.cpp index a577704..395cd28 100644 --- a/media/libstagefright/rtsp/APacketSource.cpp +++ b/media/libstagefright/rtsp/APacketSource.cpp @@ -356,24 +356,10 @@ status_t APacketSource::read( if (!mBuffers.empty()) { const sp<ABuffer> buffer = *mBuffers.begin(); - uint64_t ntpTime; - CHECK(buffer->meta()->findInt64( - "ntp-time", (int64_t *)&ntpTime)); - MediaBuffer *mediaBuffer = new MediaBuffer(buffer->size()); - mediaBuffer->meta_data()->setInt64(kKeyNTPTime, ntpTime); - - if (mFirstAccessUnit) { - mFirstAccessUnit = false; - mFirstAccessUnitNTP = ntpTime; - } - if (ntpTime > mFirstAccessUnitNTP) { - ntpTime -= mFirstAccessUnitNTP; - } else { - ntpTime = 0; - } - int64_t timeUs = (int64_t)(ntpTime * 1E6 / (1ll << 32)); + int64_t timeUs; + CHECK(buffer->meta()->findInt64("timeUs", &timeUs)); mediaBuffer->meta_data()->setInt64(kKeyTime, timeUs); @@ -390,10 +376,29 @@ status_t APacketSource::read( void APacketSource::queueAccessUnit(const sp<ABuffer> &buffer) { int32_t damaged; if (buffer->meta()->findInt32("damaged", &damaged) && damaged) { - // LOG(VERBOSE) << "discarding damaged AU"; + LOG(INFO) << "discarding damaged AU"; return; } + uint64_t ntpTime; + CHECK(buffer->meta()->findInt64( + "ntp-time", (int64_t *)&ntpTime)); + + if (mFirstAccessUnit) { + mFirstAccessUnit = false; + mFirstAccessUnitNTP = ntpTime; + } + + if (ntpTime > mFirstAccessUnitNTP) { + ntpTime -= mFirstAccessUnitNTP; + } else { + ntpTime = 0; + } + + int64_t timeUs = (int64_t)(ntpTime * 1E6 / (1ll << 32)); + + buffer->meta()->setInt64("timeUs", timeUs); + Mutex::Autolock autoLock(mLock); mBuffers.push_back(buffer); mCondition.signal(); |