Commit Graph

12 Commits (f76fe2c0d4847d0e40d8708f97591abf3fa22ea5)

Author SHA1 Message Date
Romain Vimont f76fe2c0d4 Fix --lock-video-orientation syntax
The argument for option --lock-video-orientation has been made optional
by 5af9d0ee0f.

With getopt_long(), contrary to mandatory arguments, optional arguments
must be given with a '=':

    --lock-video-orientation 2   # wrong, parse error
    --lock-video-orientation=2   # correct
3 years ago
Romain Vimont 55806e7d31 Remove option --render-expired-frames
This flag forced the decoder to wait for the previous frame to be
consumed by the display.

It was initially implemented as a compilation flag for testing, not
intended to be exposed at runtime. But to remove ifdefs and to allow
users to test this flag easily, it had finally been exposed by commit
ebccb9f6cc.

In practice, it turned out to be useless: it had no practical impact,
and it did not solve or mitigate any performance issues causing frame
skipping.

But that added some complexity to the codebase: it required an
additional condition variable, and made video buffer calls possibly
blocking, which in turn required code to interrupt it on exit.

To prepare support for multiple sinks plugged to the decoder (display
and v4l2 for example), the blocking call used for pacing the decoder
output becomes unacceptable, so just remove this useless "feature".
3 years ago
Romain Vimont ab912c23e7 Define feature test macros in common.h
This enables necessary functions once for all.

As a consequence, define common.h before any other header.
3 years ago
Romain Vimont 59feb2a15c Group common includes into common.h
Include config.h and compat.h in common.h, and include common.h from all
source files.
3 years ago
Romain Vimont 1b76d9fd78 Customize shortcut modifier
Add --shortcut-mod, and use Alt as default modifier.

This paves the way to forward the Ctrl key to the device.
4 years ago
Romain Vimont 199c74f62f Declare main() with argc/argv params in tests
Declaring the main method as "int main(void)" causes issues with SDL.

Fixes #1209 <https://github.com/Genymobile/scrcpy/issues/1209>
4 years ago
Romain Vimont 0ba74fbd9a Make scrcpy.h independant of other headers
The header scrcpy.h is intended to be the "public" API. It should not
depend on other internal headers.

Therefore, declare all required structs in this header and adapt
internal code.
4 years ago
Romain Vimont 29e5af76d4 Remove fprintf() call in tests
It should never have been committed.
4 years ago
George Stamoulis 1982bc439b Add option to lock video orientation
PR #1151 <https://github.com/Genymobile/scrcpy/pull/1151>

Signed-off-by: Romain Vimont <rom@rom1v.com>
4 years ago
Romain Vimont dc7fcf3c7a Accept port range
Accept a range of ports to listen to, so that it does not fail if
another instance of scrcpy is currently starting.

The range can be passed via the command line:

    scrcpy -p 27183:27186
    scrcpy -p 27183  # implicitly 27183:27183, as before

The default is 27183:27199.

Closes #951 <https://github.com/Genymobile/scrcpy/issues/951>
4 years ago
Romain Vimont 419c869c9c Use ARRAY_LEN() macro in tests 4 years ago
Romain Vimont 929bf48c7e Add tests for command-line parsing 4 years ago