Be more verbose

This commit is contained in:
Martin Pulec
2015-09-27 11:37:05 +02:00
parent 9d482fd8b2
commit 72cdc3d5fd
2 changed files with 10 additions and 2 deletions

View File

@@ -88,7 +88,7 @@ void recompress_process_async(void *state, shared_ptr<video_frame> frame, int po
double seconds = chrono::duration_cast<chrono::microseconds>(now - s->t0).count() / 1000000.0;
if(seconds > 5) {
double fps = s->frames / seconds;
fprintf(stdout, "[%.4x->%s:%d] %d frames in %g seconds = %g FPS\n",
log_msg(LOG_LEVEL_INFO, "[%.4x->%s:%d] %d frames in %g seconds = %g FPS\n",
rtp_my_ssrc(s->video_rxtx->m_network_devices[0]),
s->host.c_str(), s->tx_port,
s->frames, seconds, fps);

View File

@@ -311,7 +311,8 @@ static void usage(const char *progname) {
"\t\t--control-port <port_number>[:0|:1] - control port to connect to, optionally client/server (default)\n"
"\t\t--blend - enable blending from original to newly received stream, increases latency\n"
"\t\t--capture-filter <cfg_string> - apply video capture filter to incoming video\n"
"\t\t--help\n");
"\t\t--help\n"
"\t\t--verbose\n");
printf("\tand hostX_options may be:\n"
"\t\t-P <port> - TX port to be used\n"
"\t\t-c <compression> - compression\n"
@@ -344,6 +345,7 @@ struct cmdline_parameters {
int control_connection_type = 0;
bool blend = false;
const char *capture_filter = NULL;
bool verbose = false;
};
/**
@@ -372,6 +374,8 @@ static bool parse_fmt(int argc, char **argv, struct cmdline_parameters *parsed)
} else if(strcmp(argv[start_index], "--help") == 0) {
usage(argv[0]);
return false;
} else if(strcmp(argv[start_index], "--verbose") == 0) {
parsed->verbose = true;
} else {
usage(argv[0]);
return false;
@@ -518,6 +522,10 @@ int main(int argc, char **argv)
return EXIT_SUCCESS;
}
if (params.verbose) {
log_level = LOG_LEVEL_VERBOSE;
}
if ((bufsize = atoi(params.bufsize)) <= 0) {
fprintf(stderr, "invalid buffer size: %d\n", bufsize);
return 1;