]> git.sesse.net Git - nageru/blobdiff - nageru/flags.cpp
Remove/hide some SRT flags if not compiling with SRT.
[nageru] / nageru / flags.cpp
index e625f8c11510163c2037fc20fbb1d8b79bcfefd1..3c1575589b6a33169e1f922c9eb726fd55218188 100644 (file)
@@ -162,7 +162,7 @@ void usage(Program program)
                fprintf(stderr, "      --midi-mapping=FILE         start with the given MIDI controller mapping (implies --multichannel)\n");
                fprintf(stderr, "      --default-hdmi-input        default to HDMI over SDI inputs for cards that have both\n");
                fprintf(stderr, "      --fake-cards-audio          make fake (disconnected) cards output a simple tone\n");
-               fprintf(stderr, "      --v4l-output DEVICE         send video (no audio) to V4L2 output/loopback\n");
+               fprintf(stderr, "      --v4l-output=DEVICE         send video (no audio) to V4L2 output/loopback\n");
                fprintf(stderr, "      --http-x264-video           send x264-compressed video to HTTP clients\n");
                fprintf(stderr, "      --record-x264-video         store x264-compressed video to disk (implies --http-x264-video,\n");
                fprintf(stderr, "                                    removes the need for working VA-API encoding)\n");
@@ -172,10 +172,9 @@ void usage(Program program)
        fprintf(stderr, "      --x264-preset               x264 quality preset (default " X264_DEFAULT_PRESET ")\n");
        fprintf(stderr, "      --x264-tune                 x264 tuning (default " X264_DEFAULT_TUNE ", can be blank)\n");
        fprintf(stderr, "      --x264-speedcontrol         try to match x264 preset to available CPU speed\n");
-       fprintf(stderr, "      --x264-speedcontrol-verbose  output speedcontrol debugging statistics\n");
        fprintf(stderr, "      --x264-bitrate              x264 bitrate (in kilobit/sec, default %d)\n",
                DEFAULT_X264_OUTPUT_BIT_RATE);
-       fprintf(stderr, "      --x264-crf=VALUE            quality-based VBR (-12 to 51), incompatible with --x264-bitrate and VBV\n");
+       fprintf(stderr, "      --x264-crf=VALUE            quality-based VBR (-12 to 51), incompatible with --x264-bitrate\n");
        fprintf(stderr, "      --x264-param=NAME[,VALUE]   set any x264 parameter, for fine tuning\n");
        if (program == PROGRAM_NAGERU) {
                fprintf(stderr, "      --x264-separate-disk-preset x264 quality preset (default " X264_DEFAULT_PRESET ")\n");
@@ -204,9 +203,11 @@ void usage(Program program)
                DEFAULT_AUDIO_OUTPUT_BIT_RATE / 1000);
        fprintf(stderr, "      --http-port=PORT            which port to use for the built-in HTTP server\n");
        fprintf(stderr, "                                  (default is %d)\n", DEFAULT_HTTPD_PORT);
+#ifdef HAVE_SRT
        fprintf(stderr, "      --srt-port=PORT             which port to use for receiving SRT streams\n");
        fprintf(stderr, "                                  (default is %d)\n", DEFAULT_SRT_PORT);
        fprintf(stderr, "      --no-srt                    disable receiving SRT streams\n");
+#endif
        if (program == PROGRAM_KAERU) {
                fprintf(stderr, "      --no-transcode-video        copy encoded video raw from the source stream\n");
                fprintf(stderr, "                                    (experimental, must be H.264)\n");
@@ -283,8 +284,6 @@ void parse_flags(Program program, int argc, char * const argv[])
                { "x264-preset", required_argument, 0, OPTION_X264_PRESET },
                { "x264-tune", required_argument, 0, OPTION_X264_TUNE },
                { "x264-speedcontrol", no_argument, 0, OPTION_X264_SPEEDCONTROL },
-               { "x264-speedcontrol-verbose", no_argument, 0, OPTION_X264_SPEEDCONTROL_VERBOSE },
-               { "x264-bitrate", required_argument, 0, OPTION_X264_BITRATE },
                { "x264-crf", required_argument, 0, OPTION_X264_CRF },
                { "x264-param", required_argument, 0, OPTION_X264_PARAM },
                { "x264-separate-disk-preset", required_argument, 0, OPTION_X264_SEPARATE_DISK_PRESET },
@@ -303,8 +302,10 @@ void parse_flags(Program program, int argc, char * const argv[])
                { "http-audio-codec", required_argument, 0, OPTION_HTTP_AUDIO_CODEC },
                { "http-audio-bitrate", required_argument, 0, OPTION_HTTP_AUDIO_BITRATE },
                { "http-port", required_argument, 0, OPTION_HTTP_PORT },
+#ifdef HAVE_SRT
                { "srt-port", required_argument, 0, OPTION_SRT_PORT },
-               { "no-srt", no_argument, 0, OPTION_NO_SRT },
+#endif
+               { "no-srt", no_argument, 0, OPTION_NO_SRT },  // We silently allow this even without HAVE_SRT.
                { "no-transcode-video", no_argument, 0, OPTION_NO_TRANSCODE_VIDEO },
                { "no-transcode-audio", no_argument, 0, OPTION_NO_TRANSCODE_AUDIO },
                { "disable-audio", no_argument, 0, OPTION_DISABLE_AUDIO },
@@ -340,6 +341,11 @@ void parse_flags(Program program, int argc, char * const argv[])
                // apitrace in real time). For developers only, so undocumented.
                { "no-flush-pbos", no_argument, 0, OPTION_NO_FLUSH_PBOS },
 
+               // Output speedcontrol debugging statistics. For developers only,
+               // so undocumented (users can get this information from Prometheus
+               // statistics, too).
+               { "x264-speedcontrol-verbose", no_argument, 0, OPTION_X264_SPEEDCONTROL_VERBOSE },
+
                // Deprecated variants.
                { "10-bit-input", no_argument, 0, OPTION_10_BIT_INPUT },
                { "10-bit-output", no_argument, 0, OPTION_10_BIT_OUTPUT },
@@ -432,9 +438,11 @@ void parse_flags(Program program, int argc, char * const argv[])
                case OPTION_HTTP_PORT:
                        global_flags.http_port = atoi(optarg);
                        break;
+#ifdef HAVE_SRT
                case OPTION_SRT_PORT:
                        global_flags.srt_port = atoi(optarg);
                        break;
+#endif
                case OPTION_NO_SRT:
                        global_flags.srt_port = -1;
                        break;