summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/MediaPlayerService.h
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>2013-05-14 13:18:21 +0100
committerEric Laurent <elaurent@google.com>2013-07-26 09:30:34 -0700
commitd89532e133b881c7e0dac089333ad7642fc510f1 (patch)
treeba12a120aaf59226926f7a585f8a0cbe2e25aba8 /media/libmediaplayerservice/MediaPlayerService.h
parentb1a270d1e926fb9a01b4265a7675ed0c2c8f4868 (diff)
downloadframeworks_av-d89532e133b881c7e0dac089333ad7642fc510f1.zip
frameworks_av-d89532e133b881c7e0dac089333ad7642fc510f1.tar.gz
frameworks_av-d89532e133b881c7e0dac089333ad7642fc510f1.tar.bz2
libmediaplayerservice: offload playback support
Main change is to how recycled tracks are used for gapless playback. If we are playing offloaded tracks that can't be recycled we don't open a new offloaded output until we have closed the previous one. This is because offloaded tracks are a limited resource so we don't want to spuriously create unnecessary instances. If the tracks cannot be recycled this means that the formats are incompatible and so the hardware most likely will also be unable to use the existing output channel for the new track. If we already have the maximum number of hardware offload channels open (which could be only one) then creation of the next output would fail if we attempted it while the previous output was still open. Change-Id: I4f5958074e7ffd2e17108157fee86329506730ea Signed-off-by: Eric Laurent <elaurent@google.com>
Diffstat (limited to 'media/libmediaplayerservice/MediaPlayerService.h')
-rw-r--r--media/libmediaplayerservice/MediaPlayerService.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h
index f7076cc..7d27944 100644
--- a/media/libmediaplayerservice/MediaPlayerService.h
+++ b/media/libmediaplayerservice/MediaPlayerService.h
@@ -94,7 +94,7 @@ class MediaPlayerService : public BnMediaPlayerService
audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
const audio_offload_info_t *offloadInfo = NULL);
- virtual void start();
+ virtual status_t start();
virtual ssize_t write(const void* buffer, size_t size);
virtual void stop();
virtual void flush();
@@ -112,11 +112,14 @@ class MediaPlayerService : public BnMediaPlayerService
void setNextOutput(const sp<AudioOutput>& nextOutput);
void switchToNextOutput();
virtual bool needsTrailingPadding() { return mNextOutput == NULL; }
+ virtual status_t setParameters(const String8& keyValuePairs);
+ virtual String8 getParameters(const String8& keys);
private:
static void setMinBufferCount();
static void CallbackWrapper(
int event, void *me, void *info);
+ void deleteRecycledTrack();
sp<AudioTrack> mTrack;
sp<AudioTrack> mRecycledTrack;
@@ -196,7 +199,7 @@ class MediaPlayerService : public BnMediaPlayerService
audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
const audio_offload_info_t *offloadInfo = NULL);
- virtual void start();
+ virtual status_t start();
virtual ssize_t write(const void* buffer, size_t size);
virtual void stop();
virtual void flush() {}