From 8c563ed9ca8a863a66965330b5d14bb4b4ab59d4 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 7 Oct 2010 18:23:03 -0700 Subject: Added getter for session Id to AudioSink Added a method to expose the audio session id at AudioSink interface so that the AudioPlayer in stagefright can retrieve it. Also: - Fixed audio effect send level not being initialized in mediaplayer. - Fixed compilation error when LOGV is enabled in mediaplayer JNI Change-Id: I4bb55454fd63d646e0e677692d737c4843fb05fb --- include/media/MediaPlayerInterface.h | 1 + media/libmedia/mediaplayer.cpp | 1 + media/libmediaplayerservice/MediaPlayerService.cpp | 10 ++++++++++ media/libmediaplayerservice/MediaPlayerService.h | 2 ++ 4 files changed, 14 insertions(+) diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 3662983..0521709 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -76,6 +76,7 @@ public: virtual uint32_t latency() const = 0; virtual float msecsPerFrame() const = 0; virtual status_t getPosition(uint32_t *position) = 0; + virtual int getSessionId() = 0; // If no callback is specified, use the "write" API below to submit // audio data. diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index c6b2efb..cc41e66 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -56,6 +56,7 @@ MediaPlayer::MediaPlayer() mVideoWidth = mVideoHeight = 0; mLockThreadId = 0; mAudioSessionId = AudioSystem::newAudioSessionId(); + mSendLevel = 0; } MediaPlayer::~MediaPlayer() diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index d975cb9..c43e9bb 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -1546,6 +1546,11 @@ void MediaPlayerService::AudioOutput::CallbackWrapper( } +int MediaPlayerService::AudioOutput::getSessionId() +{ + return mSessionId; +} + #undef LOG_TAG #define LOG_TAG "AudioCache" MediaPlayerService::AudioCache::AudioCache(const char* name) : @@ -1733,4 +1738,9 @@ void MediaPlayerService::AudioCache::notify(void* cookie, int msg, int ext1, int p->mSignal.signal(); } +int MediaPlayerService::AudioCache::getSessionId() +{ + return 0; +} + } // namespace android diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h index a967ee2..4492e20 100644 --- a/media/libmediaplayerservice/MediaPlayerService.h +++ b/media/libmediaplayerservice/MediaPlayerService.h @@ -77,6 +77,7 @@ class MediaPlayerService : public BnMediaPlayerService virtual uint32_t latency() const; virtual float msecsPerFrame() const; virtual status_t getPosition(uint32_t *position); + virtual int getSessionId(); virtual status_t open( uint32_t sampleRate, int channelCount, @@ -133,6 +134,7 @@ class MediaPlayerService : public BnMediaPlayerService virtual uint32_t latency() const; virtual float msecsPerFrame() const; virtual status_t getPosition(uint32_t *position); + virtual int getSessionId(); virtual status_t open( uint32_t sampleRate, int channelCount, int format, -- cgit v1.1