2015-09-09 13:54:29 -07:00
|
|
|
#ifndef __WEBRTC_JITTER_BUFFER_H__
|
|
|
|
#define __WEBRTC_JITTER_BUFFER_H__
|
|
|
|
|
|
|
|
#include "AudioCodec.h"
|
|
|
|
#include "WebRtcCodec.h"
|
|
|
|
#include "RtpPacket.h"
|
|
|
|
|
|
|
|
#include <android/log.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <modules/audio_coding/neteq/interface/neteq.h>
|
|
|
|
#include <modules/interface/module_common_types.h>
|
|
|
|
|
|
|
|
class WebRtcJitterBuffer {
|
|
|
|
|
|
|
|
private:
|
|
|
|
webrtc::NetEq *neteq;
|
|
|
|
WebRtcCodec webRtcCodec;
|
|
|
|
|
2015-11-04 17:30:09 -08:00
|
|
|
pthread_t stats;
|
|
|
|
pthread_mutex_t lock;
|
|
|
|
pthread_cond_t condition;
|
|
|
|
|
2015-09-09 13:54:29 -07:00
|
|
|
public:
|
|
|
|
WebRtcJitterBuffer(AudioCodec &codec);
|
|
|
|
~WebRtcJitterBuffer();
|
|
|
|
int init();
|
|
|
|
|
|
|
|
void addAudio(RtpPacket *packet, uint32_t tick);
|
|
|
|
int getAudio(short *rawData, int maxRawData);
|
|
|
|
void stop();
|
|
|
|
void collectStats();
|
|
|
|
static void* collectStats(void *context);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|