summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorosamu fujita <osamu.x.fujita@sonymobile.com>2015-10-06 14:20:02 +0900
committerSteve Kondik <steve@cyngn.com>2015-12-01 15:27:23 -0800
commite19236dec2d616ecd39ccecb65f29e9c1310a682 (patch)
tree215517483c4c5c83d73f23b941a2a0b686ea47ae
parentb6cc3eb5672abecbe257e82554cf3c7df6c6db91 (diff)
downloadframeworks_av-e19236dec2d616ecd39ccecb65f29e9c1310a682.zip
frameworks_av-e19236dec2d616ecd39ccecb65f29e9c1310a682.tar.gz
frameworks_av-e19236dec2d616ecd39ccecb65f29e9c1310a682.tar.bz2
Tuning the number of packets for one read in StreamingSource
Read performance in StreamingSource became worse from LMR1 because the design was changed to asynchronous from synchronous. As a result, the generation of access unit does not make it in time for some multiplexed contents, and this causes frame drop. This patch improves read performance by increasing the number of packets for one read. Change-Id: I14955da5a9c5415e35905cc95f1471e0811a4991
-rw-r--r--media/libmediaplayerservice/nuplayer/StreamingSource.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
index 0246b59..d4c88de 100644
--- a/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/StreamingSource.cpp
@@ -32,6 +32,8 @@
namespace android {
+const int32_t kNumListenerQueuePackets = 80;
+
NuPlayer::StreamingSource::StreamingSource(
const sp<AMessage> &notify,
const sp<IStreamSource> &source)
@@ -84,7 +86,7 @@ status_t NuPlayer::StreamingSource::feedMoreTSData() {
}
void NuPlayer::StreamingSource::onReadBuffer() {
- for (int32_t i = 0; i < 50; ++i) {
+ for (int32_t i = 0; i < kNumListenerQueuePackets; ++i) {
char buffer[188];
sp<AMessage> extra;
ssize_t n = mStreamListener->read(buffer, sizeof(buffer), &extra);