summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/ARTPAssembler.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-08-27 13:29:08 -0700
committerAndreas Huber <andih@google.com>2010-08-27 13:29:08 -0700
commiteeb97d91b97f1fc0b26815f098515e9c06d219b8 (patch)
tree4e3cb3f496efcdb8ed23796133c1bc2369822f3f /media/libstagefright/rtsp/ARTPAssembler.cpp
parentd6a40047412d0269f79e6c992115642f0c65ea96 (diff)
downloadframeworks_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.cpp27
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