Rename --srt-sink to --stream-sink

Co-authored-by: yeicor <4929005+yeicor@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-13 09:59:58 +00:00
parent eb585c2c4f
commit 98ad4c0ef9
5 changed files with 15 additions and 15 deletions

View file

@ -114,7 +114,7 @@ enum {
OPT_NO_VD_SYSTEM_DECORATIONS,
OPT_NO_VD_DESTROY_CONTENT,
OPT_DISPLAY_IME_POLICY,
OPT_SRT_SINK,
OPT_STREAM_SINK,
};
struct sc_option {
@ -958,8 +958,8 @@ static const struct sc_option options[] = {
#endif
},
{
.longopt_id = OPT_SRT_SINK,
.longopt = "srt-sink",
.longopt_id = OPT_STREAM_SINK,
.longopt = "stream-sink",
.argdesc = "url",
.text = "Stream the device video (and audio, if enabled) as MPEG-TS "
"over SRT to the given URL.\n"
@ -2700,8 +2700,8 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
LOGE("OTG mode (--otg) is disabled.");
return false;
#endif
case OPT_SRT_SINK:
opts->srt_sink = optarg;
case OPT_STREAM_SINK:
opts->stream_sink = optarg;
break;
case OPT_V4L2_SINK:
#ifdef HAVE_V4L2
@ -2893,15 +2893,15 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
}
if (opts->video && !opts->video_playback && !opts->record_filename
&& !v4l2 && !opts->srt_sink) {
LOGI("No video playback, no recording, no V4L2 sink, no SRT sink: "
&& !v4l2 && !opts->stream_sink) {
LOGI("No video playback, no recording, no V4L2 sink, no stream sink: "
"video disabled");
opts->video = false;
}
if (opts->audio && !opts->audio_playback && !opts->record_filename
&& !opts->srt_sink) {
LOGI("No audio playback, no recording, no SRT sink: audio disabled");
&& !opts->stream_sink) {
LOGI("No audio playback, no recording, no stream sink: audio disabled");
opts->audio = false;
}

View file

@ -71,7 +71,7 @@ const struct scrcpy_options scrcpy_options_default = {
.v4l2_device = NULL,
.v4l2_buffer = 0,
#endif
.srt_sink = NULL,
.stream_sink = NULL,
#ifdef HAVE_USB
.otg = false,
#endif

View file

@ -281,7 +281,7 @@ struct scrcpy_options {
const char *v4l2_device;
sc_tick v4l2_buffer;
#endif
const char *srt_sink;
const char *stream_sink;
#ifdef HAVE_USB
bool otg;
#endif

View file

@ -636,8 +636,8 @@ scrcpy(struct scrcpy_options *options) {
}
}
if (options->srt_sink) {
if (!sc_stream_sink_init(&s->stream_sink, options->srt_sink,
if (options->stream_sink) {
if (!sc_stream_sink_init(&s->stream_sink, options->stream_sink,
options->video, options->audio)) {
goto end;
}

View file

@ -204,7 +204,7 @@ sc_stream_sink_process_header(struct sc_stream_sink *sink) {
.opaque = sink,
};
LOGI("SRT sink: waiting for client on %s", sink->url);
LOGI("Stream sink: waiting for client on %s", sink->url);
int r = avio_open2(&sink->ctx->pb, connect_url, AVIO_FLAG_WRITE,
&int_cb, NULL);
@ -249,7 +249,7 @@ sc_stream_sink_process_packets(struct sc_stream_sink *sink) {
return false;
}
LOGI("SRT sink: streaming started on %s", sink->url);
LOGI("Stream sink: streaming started on %s", sink->url);
AVPacket *video_pkt = NULL;
AVPacket *audio_pkt = NULL;