summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2014-09-09 20:08:39 -0700
committerPhil Burk <philburk@google.com>2014-09-12 17:45:49 -0700
commitc5cc2e21602182c7ab4df1d7eba40f18037c1818 (patch)
treea04d95cc239e6599713c18686a6bb0ad97d06a3d /media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h
parent3b54aba0883bdc5924290f44db8beb70da70ea26 (diff)
downloadframeworks_av-c5cc2e21602182c7ab4df1d7eba40f18037c1818.zip
frameworks_av-c5cc2e21602182c7ab4df1d7eba40f18037c1818.tar.gz
frameworks_av-c5cc2e21602182c7ab4df1d7eba40f18037c1818.tar.bz2
mediaplayer: optimize buffer queue management
Various changes for power consumption including: Restrict the number of messages in flight. Buffer more frames in the GenericSource so reads occur in a burst. Bug: 15094301 Change-Id: I783481fd91f3fdd445b95e88ab82178f649f1a38 Signed-off-by: Phil Burk <philburk@google.com>
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h
index 8590856..fb20257 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h
@@ -55,19 +55,26 @@ private:
sp<AMessage> mNotify;
sp<ALooper> mDecoderLooper;
- void requestABuffer();
+ /** Returns true if a buffer was requested.
+ * Returns false if at EOS or cache already full.
+ */
+ bool requestABuffer();
bool isStaleReply(const sp<AMessage> &msg);
void onConfigure(const sp<AMessage> &format);
void onFlush();
void onInputBufferFilled(const sp<AMessage> &msg);
void onBufferConsumed(int32_t size);
+ void requestMaxBuffers();
void onShutdown();
int32_t mBufferGeneration;
- bool mReachedEOS;
- int32_t mPendingBuffers;
- int32_t mCachedBytes;
+ bool mReachedEOS;
+ // TODO mPendingBuffersToFill and mPendingBuffersToDrain are only for
+ // debugging. They can be removed when the power investigation is done.
+ size_t mPendingBuffersToFill;
+ size_t mPendingBuffersToDrain;
+ size_t mCachedBytes;
AString mComponentName;
DISALLOW_EVIL_CONSTRUCTORS(DecoderPassThrough);