summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/DataSource.cpp
diff options
context:
space:
mode:
authorChris Watkins <watk@google.com>2015-04-07 10:01:15 -0700
committerChris Watkins <watk@google.com>2015-04-20 10:14:19 -0700
commitda7e453e1d1c77959822cf9602ddfed1c50be445 (patch)
tree2fed02646af0da50bcfc5deb5c86167c06ddfdd2 /media/libstagefright/DataSource.cpp
parentee4e1b1a63758941460ae79a064249d3a5189443 (diff)
downloadframeworks_av-da7e453e1d1c77959822cf9602ddfed1c50be445.zip
frameworks_av-da7e453e1d1c77959822cf9602ddfed1c50be445.tar.gz
frameworks_av-da7e453e1d1c77959822cf9602ddfed1c50be445.tar.bz2
stagefright: add a 2kb cache for CallbackDataSource.
Without a cache the mediaserver does a lot of small reads which result in round trips through binder and jni to the app MediaDataSource. On a Nexus 5 I measured time to first frame from MediaPlayer for 1) 1350kbps h264, and 2) 20480kbps vp8. Without a cache, MediaDataSource was ~250ms slower than an fd. With a 2kb cache it's 30ms slower for (1) and 70ms slower for (2). Change-Id: If1e811db7b853c4f79430603318d4744ac30acb9
Diffstat (limited to 'media/libstagefright/DataSource.cpp')
-rw-r--r--media/libstagefright/DataSource.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/DataSource.cpp b/media/libstagefright/DataSource.cpp
index 6a89154..75ef288 100644
--- a/media/libstagefright/DataSource.cpp
+++ b/media/libstagefright/DataSource.cpp
@@ -283,7 +283,7 @@ sp<DataSource> DataSource::CreateMediaHTTP(const sp<IMediaHTTPService> &httpServ
}
sp<DataSource> DataSource::CreateFromIDataSource(const sp<IDataSource> &source) {
- return new CallbackDataSource(source);
+ return new TinyCacheSource(new CallbackDataSource(source));
}
String8 DataSource::getMIMEType() const {