From 22612345ae97648d5b6db43cc1aa30aad77f7bba Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 14 Nov 2013 17:28:47 -0800 Subject: AwesomePlayer: correct stream type for offload canOffloadStream() function in stagefright utils forces the stream type to AUDIO_STREAM_MUSIC when querying the audio policy manager if a particular track is offloadable or not. This causes MP3 ringtones to be offloaded which is not a validated use case. The fix consists in using the actual stream type read from the AudioSink. Bug: 11410937. Change-Id: I44b8e033a8e785a79cdc291b142f80b5580bdc4d --- include/media/MediaPlayerInterface.h | 1 + include/media/stagefright/Utils.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 3b151ef..cc244f0 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -99,6 +99,7 @@ public: virtual status_t getPosition(uint32_t *position) const = 0; virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0; virtual int getSessionId() const = 0; + virtual audio_stream_type_t getAudioStreamType() const = 0; // If no callback is specified, use the "write" API below to submit // audio data. diff --git a/include/media/stagefright/Utils.h b/include/media/stagefright/Utils.h index c24f612..bbad271 100644 --- a/include/media/stagefright/Utils.h +++ b/include/media/stagefright/Utils.h @@ -57,7 +57,8 @@ status_t mapMimeToAudioFormat(audio_format_t& format, const char* mime); status_t sendMetaDataToHal(sp& sink, const sp& meta); // Check whether the stream defined by meta can be offloaded to hardware -bool canOffloadStream(const sp& meta, bool hasVideo, bool isStreaming); +bool canOffloadStream(const sp& meta, bool hasVideo, + bool isStreaming, audio_stream_type_t streamType); } // namespace android -- cgit v1.1