diff --git a/src/hd-rum-translator/hd-rum-decompress.cpp b/src/hd-rum-translator/hd-rum-decompress.cpp index 5439ddcef..7534484e3 100644 --- a/src/hd-rum-translator/hd-rum-decompress.cpp +++ b/src/hd-rum-translator/hd-rum-decompress.cpp @@ -392,7 +392,7 @@ next_iteration: return NULL; } -void *hd_rum_decompress_init(unsigned short rx_port) +void *hd_rum_decompress_init() { struct state_transcoder_decompress *s; int ttl = 255; @@ -402,7 +402,7 @@ void *hd_rum_decompress_init(unsigned short rx_port) initialize_video_decompress(); s = new state_transcoder_decompress; - s->network_device = rtp_init_if("localhost", (char *) NULL, rx_port, rx_port, ttl, + s->network_device = rtp_init_if("localhost", (char *) NULL, 0, 0, ttl, rtcp_bw, FALSE, hd_rum_receive_pkt, (uint8_t *) s, use_ipv6, false); s->my_last_ssrc = -1; diff --git a/src/hd-rum-translator/hd-rum-decompress.h b/src/hd-rum-translator/hd-rum-decompress.h index 5ef37eedd..b7626f214 100644 --- a/src/hd-rum-translator/hd-rum-decompress.h +++ b/src/hd-rum-translator/hd-rum-decompress.h @@ -3,7 +3,7 @@ extern "C" { #endif ssize_t hd_rum_decompress_write(void *state, void *buf, size_t count); -void *hd_rum_decompress_init(unsigned short rx_port); +void *hd_rum_decompress_init(); void hd_rum_decompress_done(void *state); void hd_rum_decompress_add_port(void *decompress_state, void *recompress_state); void hd_rum_decompress_add_inactive_port(void *decompress_state, void *recompress_state); diff --git a/src/hd-rum-translator/hd-rum-translator.c b/src/hd-rum-translator/hd-rum-translator.c index 03bf9aaa2..44a02a6fc 100644 --- a/src/hd-rum-translator/hd-rum-translator.c +++ b/src/hd-rum-translator/hd-rum-translator.c @@ -250,8 +250,10 @@ static void usage(const char *progname) { printf("\twhere global_opts may be:\n" "\t\t--control-port - control port to connect to\n"); printf("\tand hostX_options may be:\n" + "\t\t-P - TX port to be used\n" "\t\t-c - compression\n" - "\t\t-m - MTU size. Will be used only with compression.\n" + "\t\tFollowing options will be used only if '-c' parameter is set:\n" + "\t\t-m - MTU size\n" "\t\t-l - bitrate to be shaped to\n" "\t\t-f - FEC that will be used for transmission.\n" ); @@ -259,6 +261,7 @@ static void usage(const char *progname) { struct host_opts { char *addr; + int port; int mtu; char *compression; char *fec; @@ -309,6 +312,9 @@ static void parse_fmt(int argc, char **argv, char **bufsize, unsigned short *por for(int i = 1; i < argc; ++i) { if (argv[i][0] == '-') { switch(argv[i][1]) { + case 'P': + (*host_opts)[host_idx].port = atoi(argv[i + 1]); + break; case 'm': (*host_opts)[host_idx].mtu = atoi(argv[i + 1]); break; @@ -490,40 +496,44 @@ int main(int argc, char **argv) } // we need only one shared receiver decompressor for all recompressing streams - state.decompress = hd_rum_decompress_init(port + 2); + state.decompress = hd_rum_decompress_init(); if(!state.decompress) { return EXIT_INIT_PORT; } state.host_count = host_count; for (i = 0; i < host_count; i++) { + int mtu = 1500; + if(hosts[i].mtu) { + mtu = hosts[i].mtu; + } + int tx_port = port; + if(hosts[i].port) { + tx_port = hosts[i].port; + } + state.replicas[i].magic = REPLICA_MAGIC; state.replicas[i].host = hosts[i].addr; state.replicas[i].port = port; - state.replicas[i].sock = output_socket(port, hosts[i].addr, + state.replicas[i].sock = output_socket(tx_port, hosts[i].addr, bufsize); module_init_default(&state.replicas[i].mod); state.replicas[i].mod.cls = MODULE_CLASS_PORT; if(hosts[i].compression == NULL) { state.replicas[i].type = USE_SOCK; - int mtu = 1500; char compress[] = "none"; char *fec = NULL; state.replicas[i].recompress = recompress_init(&state.replicas[i].mod, hosts[i].addr, compress, - 0, port, mtu, fec, hosts[i].packet_rate); + 0, tx_port, mtu, fec, hosts[i].packet_rate); hd_rum_decompress_add_inactive_port(state.decompress, state.replicas[i].recompress); } else { state.replicas[i].type = RECOMPRESS; - int mtu = 1500; - if(hosts[i].mtu) { - mtu = hosts[i].mtu; - } state.replicas[i].recompress = recompress_init(&state.replicas[i].mod, hosts[i].addr, hosts[i].compression, - 0, port, mtu, hosts[i].fec, hosts[i].packet_rate); + 0, tx_port, mtu, hosts[i].fec, hosts[i].packet_rate); if(state.replicas[i].recompress == 0) { fprintf(stderr, "Initializing output port '%s' failed!\n", hosts[i].addr); diff --git a/src/main.cpp b/src/main.cpp index e3150e07b..fe23cbf82 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -249,7 +249,8 @@ static void usage(void) printf("\n"); printf("\t--audio-channel-map | help\n"); printf("\n"); - printf("\t--audio-scale | | help\n"); + printf("\t--audio-scale | | help\n"); + printf("\t \tscales received audio\n"); printf("\n"); printf("\t--audio-capture-channels number of input channels that will\n"); printf("\t be captured (default 2).\n"); diff --git a/src/rtp/audio_decoders.c b/src/rtp/audio_decoders.c index 9d99bd29d..2796b3698 100644 --- a/src/rtp/audio_decoders.c +++ b/src/rtp/audio_decoders.c @@ -430,8 +430,8 @@ int decode_audio_frame(struct coded_data *cdata, void *data) if(device_sample_rate == sample_rate) // no resampling device_bps = bps; - printf("New incoming audio format detected: %d Hz, %d channels, %d bits per sample, codec %s\n", - sample_rate, input_channels, bps * 8, + printf("New incoming audio format detected: %d Hz, %d channel%s, %d bits per sample, codec %s\n", + sample_rate, input_channels, input_channels == 1 ? "": "s", bps * 8, get_name_to_audio_codec(get_audio_codec_to_tag(audio_tag))); diff --git a/src/video_compress/dxt_glsl.cpp b/src/video_compress/dxt_glsl.cpp index 81b2b8915..81e50b4d7 100644 --- a/src/video_compress/dxt_glsl.cpp +++ b/src/video_compress/dxt_glsl.cpp @@ -205,6 +205,15 @@ struct module *dxt_glsl_compress_init(struct module *parent, const struct video_ struct state_video_compress_rtdxt *s; const char *opts = params->cfg; + if(strcmp(opts, "help") == 0) { + printf("DXT GLSL comperssion usage:\n"); + printf("\t-c RTDXT:DXT1\n"); + printf("\t\tcompress with DXT1\n"); + printf("\t-c RTDXT:DXT5\n"); + printf("\t\tcompress with DXT5 YCoCg\n"); + return &compress_init_noerr; + } + s = (struct state_video_compress_rtdxt *) calloc(1, sizeof(struct state_video_compress_rtdxt)); s->decoded = NULL; @@ -216,15 +225,6 @@ struct module *dxt_glsl_compress_init(struct module *parent, const struct video_ return NULL; } - if(strcmp(opts, "help") == 0) { - printf("DXT GLSL comperssion usage:\n"); - printf("\t-c RTDXT:DXT1\n"); - printf("\t\tcompress with DXT1\n"); - printf("\t-c RTDXT:DXT5\n"); - printf("\t\tcompress with DXT5 YCoCg\n"); - return &compress_init_noerr; - } - if (strcasecmp(opts, "DXT5") == 0) { s->color_spec = DXT5; } else if (strcasecmp(opts, "DXT1") == 0) {