summaryrefslogtreecommitdiffstats
path: root/voip/jni/rtp
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2010-11-30 19:45:47 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-11-30 19:45:47 -0800
commit4c7cc83827458945fe7a1f4bd2bfe0629f0d30ae (patch)
tree4fa585b3536dd2b65eaf5ef92fbd12a357507605 /voip/jni/rtp
parent1f2451007c660091b7b090c1ea332f9044515d2d (diff)
parent53aa6ef70d8692277f9403f94d43918ad9712dd0 (diff)
downloadframeworks_base-4c7cc83827458945fe7a1f4bd2bfe0629f0d30ae.zip
frameworks_base-4c7cc83827458945fe7a1f4bd2bfe0629f0d30ae.tar.gz
frameworks_base-4c7cc83827458945fe7a1f4bd2bfe0629f0d30ae.tar.bz2
Merge "RTP: Prepare to unhide the APIs."
Diffstat (limited to 'voip/jni/rtp')
-rw-r--r--voip/jni/rtp/AmrCodec.cpp2
-rw-r--r--voip/jni/rtp/AudioGroup.cpp18
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