Skip to content

fix #2841 by adding dynamic options #6013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

netwdev
Copy link

@netwdev netwdev commented Apr 16, 2025

Since no one liked the idea of saving the server config to a file as in #5153, I decided to try getting all the optional arguments from the client using the first connected socket. The required/important arguments, in contrast, are still given on the command line just like before, but should no longer exceed the character limit of 255.

As of now, the command-line-only arguments are:

  • (version)
  • log_level
  • scid
  • tunnel_forward
  • control
  • video
  • audio
  • send_dummy_byte (+raw_stream)
  • net_args (new)

The optional arguments are received once after the dummy byte is sent (if enabled) and are expected as 4-byte length-prefixed JSON data.

I'm sure there are better ways to do this, but I think this approach might be acceptable because:

  • it doesn’t affect scrcpy clients on new releases due to the command-line argument handling
  • it has minimal latency impact when enabled

Some drawbacks are:

  • two separate argument handling paths are needed
  • it introduces a completely new protocol

Closes #2841
Closes #5153

EDIT
I forgot all the "list_*" arguments like "list_encoders" but imo they should be used separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack corruption detected when using version 1.21
1 participant