Support for Signal calls.

Merge in RedPhone

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2015-09-09 13:54:29 -07:00
parent 3d4ae60d81
commit d83a3d71bc
2585 changed files with 803492 additions and 45 deletions

34
jni/redphone/Clock.h Normal file
View File

@@ -0,0 +1,34 @@
#ifndef __CLOCK_H__
#define __CLOCK_H__
#include "AudioCodec.h"
#include <android/log.h>
class Clock {
private:
volatile uint32_t tickCount;
uint32_t dataReceived;
public:
Clock() : tickCount(0), dataReceived(0) {}
uint32_t tick(int frames) {
tickCount += (frames * SPEEX_FRAME_SIZE);
return tickCount;
}
uint32_t getTickCount() {
return tickCount;
}
uint32_t getImprovisedTimestamp(int dataLen) {
dataReceived += dataLen;
return (dataReceived / SPEEX_ENCODED_FRAME_SIZE) * SPEEX_FRAME_SIZE;
}
};
#endif