Log parameters + bind localhost is now possible
This commit is contained in:
parent
ce2f67cec8
commit
156439e390
3 changed files with 19 additions and 8 deletions
|
@ -15,6 +15,7 @@ dcall \
|
|||
-t filesrc \
|
||||
-a file:///assets/i_have_a_dream.mp3 \
|
||||
-s fakesink \
|
||||
-b 127.0.0.1
|
||||
-l $3 \
|
||||
-d $4/log/client-dcall-gstreamer.log \
|
||||
> $4/log/client-dcall-stdout.log 2> $4/log/client-dcall-stderr.log
|
||||
|
|
|
@ -15,6 +15,7 @@ dcall \
|
|||
-t filesrc \
|
||||
-a file:///assets/i_have_a_dream.mp3 \
|
||||
-s fakesink \
|
||||
-b 127.0.0.1
|
||||
-l $3 \
|
||||
-d ../log/server-dcall-gstreamer.log \
|
||||
> ../log/server-dcall-stdout.log 2> ../log/server-dcall-stderr.log
|
||||
|
|
25
src/dcall.c
25
src/dcall.c
|
@ -12,8 +12,8 @@ struct dcall_elements {
|
|||
GstElement *pipeline;
|
||||
GstElement *rx_tap, *rx_jitterbuffer, *rx_depay, *rx_opusdec, *rx_resample, *rx_echocancel, *rx_pulse, *rx_fakesink;
|
||||
GstElement *tx_pulse, *tx_filesrc, *tx_mpegaudioparse, *tx_mpgaudiodec, *tx_audioconvert, *tx_echocancel, *tx_queue, *tx_resample, *tx_opusenc, *tx_pay, *tx_sink;
|
||||
char *remote_host, *audio_tap, *audio_sink, *audio_file, *gstreamer_log_path;
|
||||
int remote_port, latency;
|
||||
char *local_host, *remote_host, *audio_tap, *audio_sink, *audio_file, *gstreamer_log_path;
|
||||
int remote_port, local_port, latency;
|
||||
guint64 grtppktlost;
|
||||
GMainLoop *loop;
|
||||
};
|
||||
|
@ -33,8 +33,8 @@ int create_rx_chain(struct dcall_elements* de) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
g_object_set(G_OBJECT (de->rx_tap), "port", 5000, NULL);
|
||||
//g_object_set(G_OBJECT (rx_tap), "address", "127.0.0.1", NULL);
|
||||
g_object_set(G_OBJECT (de->rx_tap), "port", de->local_port, NULL);
|
||||
g_object_set(G_OBJECT (de->rx_tap), "address", de->local_host, NULL);
|
||||
g_object_set(G_OBJECT (de->rx_tap), "caps", gst_caps_new_simple("application/x-rtp", "media", G_TYPE_STRING, "audio", NULL), NULL);
|
||||
|
||||
g_object_set(G_OBJECT (de->rx_jitterbuffer), "do-lost", TRUE, NULL);
|
||||
|
@ -218,22 +218,29 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
GstBus *bus;
|
||||
struct dcall_elements de = {
|
||||
.audio_file = "voice.mp3",
|
||||
.audio_file = "file://./voice.mp3",
|
||||
.gstreamer_log_path = "dcall.log",
|
||||
.latency = 150,
|
||||
.remote_port = 5000,
|
||||
.remote_host = "127.13.3.7",
|
||||
.remote_port = 5000,
|
||||
.local_host = "0.0.0.0",
|
||||
.local_port = 5000,
|
||||
.audio_sink = "pulsesink",
|
||||
.audio_tap = "pulsesrc",
|
||||
.grtppktlost = 0
|
||||
};
|
||||
int opt = 0;
|
||||
|
||||
while ((opt = getopt(argc, argv, "t:s:r:p:l:d:a:h")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "t:s:r:p:l:d:a:hb:c:")) != -1) {
|
||||
switch(opt) {
|
||||
case 'a': //latency
|
||||
case 'a':
|
||||
de.audio_file = optarg;
|
||||
break;
|
||||
case 'b':
|
||||
de.local_host = optarg;
|
||||
break;
|
||||
case 'c':
|
||||
de.local_port = atoi(optarg);
|
||||
case 'd':
|
||||
de.gstreamer_log_path = optarg;
|
||||
break;
|
||||
|
@ -259,6 +266,8 @@ int main(int argc, char *argv[]) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
printf("dcall configuration:\n\tnetwork in: %s:%d, out: %s:%d\n\taudio in: %s, out: %s\n\tmisc latency: %dms, audio_file: %s\n",
|
||||
de.local_host, de.local_port, de.remote_host, de.remote_port, de.audio_tap, de.audio_sink, de.latency, de.audio_file);
|
||||
|
||||
setenv("GST_DEBUG_FILE", de.gstreamer_log_path, 0);
|
||||
setenv("GST_DEBUG", "3,opusdec:5", 0);
|
||||
|
|
Loading…
Reference in a new issue