diff options
author | Chia-chi Yeh <chiachi@android.com> | 2010-11-30 13:10:31 +0800 |
---|---|---|
committer | Chia-chi Yeh <chiachi@android.com> | 2010-12-01 11:35:51 +0800 |
commit | 53aa6ef70d8692277f9403f94d43918ad9712dd0 (patch) | |
tree | 838ec2bb2c5154da687cb01a6cfa1e6449ab8e0c /voip/jni | |
parent | 1318af1a476bb39b80fcadf5e545856aa2e90de2 (diff) | |
download | frameworks_base-53aa6ef70d8692277f9403f94d43918ad9712dd0.zip frameworks_base-53aa6ef70d8692277f9403f94d43918ad9712dd0.tar.gz frameworks_base-53aa6ef70d8692277f9403f94d43918ad9712dd0.tar.bz2 |
RTP: Prepare to unhide the APIs.
Polish things a little bit.
Change-Id: I2c3cea8b34b9c858879bc722ea1f38082ba22b8d
Diffstat (limited to 'voip/jni')
-rw-r--r-- | voip/jni/rtp/AmrCodec.cpp | 2 | ||||
-rw-r--r-- | voip/jni/rtp/AudioGroup.cpp | 18 |
2 files changed, 7 insertions, 13 deletions
diff --git a/voip/jni/rtp/AmrCodec.cpp b/voip/jni/rtp/AmrCodec.cpp index 72ee44e..84c7166 100644 --- a/voip/jni/rtp/AmrCodec.cpp +++ b/voip/jni/rtp/AmrCodec.cpp @@ -73,7 +73,7 @@ int AmrCodec::set(int sampleRate, const char *fmtp) } // Handle mode-set and octet-align. - char *modes = (char*)strcasestr(fmtp, "mode-set="); + const char *modes = strcasestr(fmtp, "mode-set="); if (modes) { mMode = 0; mModeSet = 0; diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp index 0c8a725..cba1123 100644 --- a/voip/jni/rtp/AudioGroup.cpp +++ b/voip/jni/rtp/AudioGroup.cpp @@ -90,6 +90,7 @@ public: void encode(int tick, AudioStream *chain); void decode(int tick); +private: enum { NORMAL = 0, SEND_ONLY = 1, @@ -97,7 +98,6 @@ public: LAST_MODE = 2, }; -private: int mMode; int mSocket; sockaddr_storage mRemote; @@ -463,6 +463,7 @@ public: bool add(AudioStream *stream); bool remove(int socket); +private: enum { ON_HOLD = 0, MUTED = 1, @@ -471,7 +472,6 @@ public: LAST_MODE = 3, }; -private: AudioStream *mChain; int mEventQueue; volatile int mDtmfEvent; @@ -948,16 +948,10 @@ void remove(JNIEnv *env, jobject thiz, jint socket) void setMode(JNIEnv *env, jobject thiz, jint mode) { - if (mode < 0 || mode > AudioGroup::LAST_MODE) { - jniThrowException(env, "java/lang/IllegalArgumentException", NULL); - return; - } AudioGroup *group = (AudioGroup *)env->GetIntField(thiz, gNative); if (group && !group->setMode(mode)) { jniThrowException(env, "java/lang/IllegalArgumentException", NULL); - return; } - env->SetIntField(thiz, gMode, mode); } void sendDtmf(JNIEnv *env, jobject thiz, jint event) @@ -969,10 +963,10 @@ void sendDtmf(JNIEnv *env, jobject thiz, jint event) } JNINativeMethod gMethods[] = { - {"add", "(IILjava/lang/String;ILjava/lang/String;I)V", (void *)add}, - {"remove", "(I)V", (void *)remove}, - {"setMode", "(I)V", (void *)setMode}, - {"sendDtmf", "(I)V", (void *)sendDtmf}, + {"nativeAdd", "(IILjava/lang/String;ILjava/lang/String;I)V", (void *)add}, + {"nativeRemove", "(I)V", (void *)remove}, + {"nativeSetMode", "(I)V", (void *)setMode}, + {"nativeSendDtmf", "(I)V", (void *)sendDtmf}, }; } // namespace |