Merge "Added getter for session Id to AudioSink" into gingerbread

This commit is contained in:
Eric Laurent
2010-10-08 08:28:08 -07:00
committed by Android (Google) Code Review
5 changed files with 15 additions and 1 deletions

View File

@ -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.

View File

@ -727,7 +727,7 @@ android_media_MediaPlayer_setAuxEffectSendLevel(JNIEnv *env, jobject thiz, jfloa
}
static void android_media_MediaPlayer_attachAuxEffect(JNIEnv *env, jobject thiz, jint effectId) {
LOGV("attachAuxEffect(): %d", sessionId);
LOGV("attachAuxEffect(): %d", effectId);
sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
if (mp == NULL ) {
jniThrowException(env, "java/lang/IllegalStateException", NULL);

View File

@ -56,6 +56,7 @@ MediaPlayer::MediaPlayer()
mVideoWidth = mVideoHeight = 0;
mLockThreadId = 0;
mAudioSessionId = AudioSystem::newAudioSessionId();
mSendLevel = 0;
}
MediaPlayer::~MediaPlayer()

View File

@ -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

View File

@ -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,