RTP: Update native part to reflect the API change.
Change-Id: Ic2858920ad77d7312f2429f89ca509a481363431
diff --git a/voip/jni/rtp/AudioCodec.cpp b/voip/jni/rtp/AudioCodec.cpp
index ddd07fc..4d8d36c 100644
--- a/voip/jni/rtp/AudioCodec.cpp
+++ b/voip/jni/rtp/AudioCodec.cpp
@@ -36,9 +36,9 @@
class UlawCodec : public AudioCodec
{
public:
- bool set(int sampleRate, int sampleCount) {
- mSampleCount = sampleCount;
- return sampleCount > 0;
+ int set(int sampleRate, const char *fmtp) {
+ mSampleCount = sampleRate / 50;
+ return mSampleCount;
}
int encode(void *payload, int16_t *samples);
int decode(int16_t *samples, void *payload, int length);
@@ -89,9 +89,9 @@
class AlawCodec : public AudioCodec
{
public:
- bool set(int sampleRate, int sampleCount) {
- mSampleCount = sampleCount;
- return sampleCount > 0;
+ int set(int sampleRate, const char *fmtp) {
+ mSampleCount = sampleRate / 50;
+ return mSampleCount;
}
int encode(void *payload, int16_t *samples);
int decode(int16_t *samples, void *payload, int length);
@@ -152,8 +152,10 @@
{
AudioCodecType *type = gAudioCodecTypes;
while (type->name != NULL) {
- if (strcmp(codecName, type->name) == 0) {
- return type->create();
+ if (strcasecmp(codecName, type->name) == 0) {
+ AudioCodec *codec = type->create();
+ codec->name = type->name;
+ return codec;
}
++type;
}