diff options
author | Andreas Huber <andih@google.com> | 2010-08-27 13:29:08 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-08-27 13:29:08 -0700 |
commit | eeb97d91b97f1fc0b26815f098515e9c06d219b8 (patch) | |
tree | 4e3cb3f496efcdb8ed23796133c1bc2369822f3f /media/libstagefright/rtsp/ARTPAssembler.cpp | |
parent | d6a40047412d0269f79e6c992115642f0c65ea96 (diff) | |
download | frameworks_base-eeb97d91b97f1fc0b26815f098515e9c06d219b8.zip frameworks_base-eeb97d91b97f1fc0b26815f098515e9c06d219b8.tar.gz frameworks_base-eeb97d91b97f1fc0b26815f098515e9c06d219b8.tar.bz2 |
Better support for rtsp (normal play-)time display. Better seek support, timeout if no packets arrive for too long.
Change-Id: Id491541a6ae501604cda815f8e961a3bfe26db7d
related-to-bug: 2556656
Diffstat (limited to 'media/libstagefright/rtsp/ARTPAssembler.cpp')
-rw-r--r-- | media/libstagefright/rtsp/ARTPAssembler.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/media/libstagefright/rtsp/ARTPAssembler.cpp b/media/libstagefright/rtsp/ARTPAssembler.cpp index 24225b8..9ba2b37 100644 --- a/media/libstagefright/rtsp/ARTPAssembler.cpp +++ b/media/libstagefright/rtsp/ARTPAssembler.cpp @@ -35,18 +35,6 @@ ARTPAssembler::ARTPAssembler() : mFirstFailureTimeUs(-1) { } -void ARTPAssembler::PropagateTimes( - const sp<ABuffer> &from, const sp<ABuffer> &to) { - uint32_t rtpTime; - CHECK(from->meta()->findInt32("rtp-time", (int32_t *)&rtpTime)); - - uint64_t ntpTime = 0; - CHECK(from->meta()->findInt64("ntp-time", (int64_t *)&ntpTime)); - - to->meta()->setInt32("rtp-time", rtpTime); - to->meta()->setInt64("ntp-time", ntpTime); -} - void ARTPAssembler::onPacketReceived(const sp<ARTPSource> &source) { AssemblyStatus status; for (;;) { @@ -75,4 +63,19 @@ void ARTPAssembler::onPacketReceived(const sp<ARTPSource> &source) { } } +// static +void ARTPAssembler::CopyTimes(const sp<ABuffer> &to, const sp<ABuffer> &from) { + uint64_t ntpTime; + CHECK(from->meta()->findInt64("ntp-time", (int64_t *)&ntpTime)); + + uint32_t rtpTime; + CHECK(from->meta()->findInt32("rtp-time", (int32_t *)&rtpTime)); + + to->meta()->setInt64("ntp-time", ntpTime); + to->meta()->setInt32("rtp-time", rtpTime); + + // Copy the seq number. + to->setInt32Data(from->int32Data()); +} + } // namespace android |