improve daemon:

- add jitter-buffer command to set the size of the jitter buffer
- add jitter-buffer-reset command to reset the jitter buffer during a call/stream
- improve documentation and add command line option to generate an html documentation.
This commit is contained in:
Simon Morlat 2012-12-11 11:03:31 +01:00
parent f69018fdf7
commit 122d8eba46
4 changed files with 19 additions and 3 deletions

View file

@ -55,7 +55,8 @@ linphone_daemon_SOURCES=daemon.cc \
commands/terminate.h \
commands/unregister.h \
commands/quit.h \
commands/version.h
commands/version.h \
commands/jitterbuffer.cc commands/jitterbuffer.h
linphone_daemon_pipetest_SOURCES=daemon-pipetest.c

View file

@ -14,6 +14,7 @@
#include "daemon.h"
#include "commands/adaptive-jitter-compensation.h"
#include "commands/jitterbuffer.h"
#include "commands/answer.h"
#include "commands/audio-codec-get.h"
#include "commands/audio-codec-move.h"
@ -279,6 +280,7 @@ Daemon::Daemon(const char *config_path, const char *factory_config_path, const c
linphone_core_set_user_data(mLc, this);
linphone_core_enable_video(mLc, capture_video, display_video);
initCommands();
mUseStatsEvents=true;
}
const list<DaemonCommand*> &Daemon::getCommandList() const {
@ -376,6 +378,8 @@ void Daemon::initCommands() {
mCommands.push_back(new MediaEncryptionCommand());
mCommands.push_back(new PortCommand());
mCommands.push_back(new AdaptiveBufferCompensationCommand());
mCommands.push_back(new JitterBufferCommand());
mCommands.push_back(new JitterBufferResetCommand());
mCommands.push_back(new VersionCommand());
mCommands.push_back(new QuitCommand());
mCommands.push_back(new HelpCommand());
@ -421,7 +425,7 @@ void Daemon::callStateChanged(LinphoneCall *call, LinphoneCallState state, const
}
void Daemon::callStatsUpdated(LinphoneCall *call, const LinphoneCallStats *stats) {
mEventQueue.push(new CallStatsResponse(this, call, stats, true));
if (mUseStatsEvents) mEventQueue.push(new CallStatsResponse(this, call, stats, true));
}
void Daemon::dtmfReceived(LinphoneCall *call, int dtmf) {
@ -623,6 +627,7 @@ static void printHelp() {
"\t--log <path>\t\tSupply a file where the log will be saved\n"
"\t--factory-config <path>\tSupply a readonly linphonerc style config file to start with.\n"
"\t--config <path>\t\tSupply a linphonerc style config file to start with.\n"
"\t--disable-stats-events\t\tDo not automatically raise RTP statistics events.\n"
"\t-C\t\t\tenable video capture.\n"
"\t-D\t\t\tenable video display.\n");
}
@ -678,6 +683,10 @@ void Daemon::quit() {
mRunning = false;
}
void Daemon::enableStatsEvents(bool enabled){
mUseStatsEvents=enabled;
}
Daemon::~Daemon() {
uninitCommands();
@ -712,6 +721,7 @@ int main(int argc, char *argv[]) {
const char *log_file = NULL;
bool capture_video = false;
bool display_video = false;
bool nostats=FALSE;
int i;
for (i = 1; i < argc; ++i) {
@ -757,9 +767,12 @@ int main(int argc, char *argv[]) {
capture_video = true;
} else if (strcmp(argv[i], "-D") == 0) {
display_video = true;
}else if (strcmp(argv[i],"--disable-stats-events")==0){
nostats=TRUE;
}
}
Daemon app(config_path, factory_config_path, log_file, pipe_name, display_video, capture_video);
app.enableStatsEvents(!nostats);
return app.run();
}
;

View file

@ -181,6 +181,7 @@ public:
int updateAudioStreamId(AudioStream *audio_stream);
void dumpCommandsHelp();
void dumpCommandsHelpHtml();
void enableStatsEvents(bool enabled);
private:
static void* iterateThread(void *arg);
static void callStateChanged(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState state, const char *msg);
@ -204,6 +205,7 @@ private:
int mChildFd;
std::string mHistfile;
bool mRunning;
bool mUseStatsEvents;
FILE *mLogFile;
int mCallIds;
int mProxyIds;

@ -1 +1 @@
Subproject commit 243cc4d3da14b68bb7d2919c93475c122995dfc7
Subproject commit b50d3b3a047ce9e071840fd3ffa53a7f24a2fefd