summaryrefslogtreecommitdiffstats
path: root/voip
diff options
context:
space:
mode:
Diffstat (limited to 'voip')
-rw-r--r--voip/java/android/net/sip/SipProfile.java19
-rw-r--r--voip/jni/rtp/Android.mk5
-rw-r--r--voip/jni/rtp/AudioGroup.cpp19
3 files changed, 25 insertions, 18 deletions
diff --git a/voip/java/android/net/sip/SipProfile.java b/voip/java/android/net/sip/SipProfile.java
index ec8d0ed..6c99141 100644
--- a/voip/java/android/net/sip/SipProfile.java
+++ b/voip/java/android/net/sip/SipProfile.java
@@ -47,6 +47,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
private boolean mSendKeepAlive = false;
private boolean mAutoRegistration = true;
private boolean mAllowOutgoingCall = false;
+ private int mCallingUid = -1;
/** @hide */
public static final Parcelable.Creator<SipProfile> CREATOR =
@@ -293,6 +294,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
mSendKeepAlive = (in.readInt() == 0) ? false : true;
mAutoRegistration = (in.readInt() == 0) ? false : true;
mAllowOutgoingCall = (in.readInt() == 0) ? false : true;
+ mCallingUid = in.readInt();
}
/** @hide */
@@ -306,6 +308,7 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
out.writeInt(mSendKeepAlive ? 1 : 0);
out.writeInt(mAutoRegistration ? 1 : 0);
out.writeInt(mAllowOutgoingCall ? 1 : 0);
+ out.writeInt(mCallingUid);
}
/** @hide */
@@ -437,4 +440,20 @@ public class SipProfile implements Parcelable, Serializable, Cloneable {
public boolean isOutgoingCallAllowed() {
return mAllowOutgoingCall;
}
+
+ /**
+ * Sets the calling process's Uid in the sip service.
+ * @hide
+ */
+ public void setCallingUid(int uid) {
+ mCallingUid = uid;
+ }
+
+ /**
+ * Gets the calling process's Uid in the sip settings.
+ * @hide
+ */
+ public int getCallingUid() {
+ return mCallingUid;
+ }
}
diff --git a/voip/jni/rtp/Android.mk b/voip/jni/rtp/Android.mk
index 3bd85aa..a364355 100644
--- a/voip/jni/rtp/Android.mk
+++ b/voip/jni/rtp/Android.mk
@@ -32,11 +32,10 @@ LOCAL_SHARED_LIBRARIES := \
libutils \
libmedia
-LOCAL_STATIC_LIBRARIES := libspeex
+LOCAL_STATIC_LIBRARIES :=
LOCAL_C_INCLUDES += \
- $(JNI_H_INCLUDE) \
- external/speex/include
+ $(JNI_H_INCLUDE)
LOCAL_CFLAGS += -fvisibility=hidden
diff --git a/voip/jni/rtp/AudioGroup.cpp b/voip/jni/rtp/AudioGroup.cpp
index b5a4e22..bb45a9a 100644
--- a/voip/jni/rtp/AudioGroup.cpp
+++ b/voip/jni/rtp/AudioGroup.cpp
@@ -40,8 +40,6 @@
#include <media/AudioTrack.h>
#include <media/mediarecorder.h>
-#include <speex/speex_echo.h>
-
#include "jni.h"
#include "JNIHelp.h"
@@ -447,8 +445,6 @@ private:
int mDeviceSocket;
AudioTrack mTrack;
AudioRecord mRecord;
-
- SpeexEchoState *mEchoState;
bool networkLoop();
bool deviceLoop();
@@ -510,7 +506,6 @@ AudioGroup::AudioGroup()
mEventQueue = -1;
mDtmfEvent = -1;
mDeviceSocket = -1;
- mEchoState = NULL;
mNetworkThread = new NetworkThread(this);
mDeviceThread = new DeviceThread(this);
}
@@ -523,9 +518,6 @@ AudioGroup::~AudioGroup()
mRecord.stop();
close(mEventQueue);
close(mDeviceSocket);
- if (mEchoState) {
- speex_echo_state_destroy(mEchoState);
- }
while (mChain) {
AudioStream *next = mChain->mNext;
delete mChain;
@@ -574,8 +566,7 @@ bool AudioGroup::set(int sampleRate, int sampleCount)
}
LOGD("latency: output %d, input %d", mTrack.latency(), mRecord.latency());
- // Initialize echo canceller.
- mEchoState = speex_echo_state_init(sampleCount, sampleRate);
+ // TODO: initialize echo canceler here.
// Create device socket.
int pair[2];
@@ -642,7 +633,6 @@ bool AudioGroup::setMode(int mode)
if (mode == MUTED) {
mRecord.stop();
} else {
- speex_echo_state_reset(mEchoState);
mRecord.start();
}
@@ -803,7 +793,7 @@ bool AudioGroup::deviceLoop()
status_t status = mRecord.obtainBuffer(&buffer, 1);
if (status == NO_ERROR) {
- int count = ((int)buffer.frameCount < toRead) ?
+ int count = (buffer.frameCount < toRead) ?
buffer.frameCount : toRead;
memcpy(&input[mSampleCount - toRead], buffer.i8, count * 2);
toRead -= count;
@@ -827,9 +817,8 @@ bool AudioGroup::deviceLoop()
if (mMode == NORMAL) {
send(mDeviceSocket, input, sizeof(input), MSG_DONTWAIT);
} else {
- int16_t result[mSampleCount];
- speex_echo_cancellation(mEchoState, input, output, result);
- send(mDeviceSocket, result, sizeof(result), MSG_DONTWAIT);
+ // TODO: Echo canceller runs here.
+ send(mDeviceSocket, input, sizeof(input), MSG_DONTWAIT);
}
}
return true;