summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-09-15 12:25:04 -0700
committerAndreas Huber <andih@google.com>2011-09-16 10:44:02 -0700
commit078cfcf7cce9185ec7559910d08b0bc02bfc88a3 (patch)
treed4fb458318a3f0b3982b05e0c79a2cfc447dd732 /media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
parent5dc2812abddde309234edc786a541d251c4f820a (diff)
downloadframeworks_av-078cfcf7cce9185ec7559910d08b0bc02bfc88a3.zip
frameworks_av-078cfcf7cce9185ec7559910d08b0bc02bfc88a3.tar.gz
frameworks_av-078cfcf7cce9185ec7559910d08b0bc02bfc88a3.tar.bz2
Various improvements to nuplayer playback
- Drastically cut down the number of times we supply the AudioSink with data by estimating the time until the sink would run out of data and then scheduling a refill in advance of that. - Use a dedicated looper for video decoders since they are currently taking too long to return from OMX_FillThisBuffer (bug 5325201) - Revise thread priorities for the OMX dispatcher and software codecs, instead of running them at ANDROID_PRIORITY_AUDIO, they now only run at ANDROID_PRIORITY_FOREGROUND - Since threads created by pthread_create inherit all of the parent threads attributes including thread priority, briefly reset thread priority to ANDROID_PRIORITY_FOREGROUND before instantiating OMX components and then restore it. Change-Id: If9332a3a20dad5485333d68c11de0d2d5d3fffc3
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
index 3a641a2..44c5d44 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
@@ -45,9 +45,9 @@ struct NuPlayer::Renderer : public AHandler {
void resume();
enum {
- kWhatEOS,
- kWhatFlushComplete,
- kWhatPosition,
+ kWhatEOS = 'eos ',
+ kWhatFlushComplete = 'fluC',
+ kWhatPosition = 'posi',
};
protected:
@@ -57,14 +57,14 @@ protected:
private:
enum {
- kWhatDrainAudioQueue,
- kWhatDrainVideoQueue,
- kWhatQueueBuffer,
- kWhatQueueEOS,
- kWhatFlush,
- kWhatAudioSinkChanged,
- kWhatPause,
- kWhatResume,
+ kWhatDrainAudioQueue = 'draA',
+ kWhatDrainVideoQueue = 'draV',
+ kWhatQueueBuffer = 'queB',
+ kWhatQueueEOS = 'qEOS',
+ kWhatFlush = 'flus',
+ kWhatAudioSinkChanged = 'auSC',
+ kWhatPause = 'paus',
+ kWhatResume = 'resm',
};
struct QueueEntry {
@@ -102,8 +102,8 @@ private:
int64_t mLastPositionUpdateUs;
- void onDrainAudioQueue();
- void postDrainAudioQueue();
+ bool onDrainAudioQueue();
+ void postDrainAudioQueue(int64_t delayUs = 0);
void onDrainVideoQueue();
void postDrainVideoQueue();