Commit Graph

2408 Commits (master)
 

Author SHA1 Message Date
Romain Vimont fe6e9acb36 Log device selection at INFO level
The selected device should be logged by default.
10 months ago
Cédric Skwar 625934fb1b Fix fedora package in build instructions
In Fedora, the package is libusb1-devel.

Fixes #4131 <https://github.com/Genymobile/scrcpy/issues/4131>
PR #4132 <https://github.com/Genymobile/scrcpy/pull/4132>

Signed-off-by: Romain Vimont <rom@rom1v.com>
10 months ago
Romain Vimont 85b55b3c4e Fix possible division by zero
On sway (a window manager), SDL_WINDOWEVENT_EXPOSED and
SDL_WINDOWEVENT_SIZE_CHANGED might not be called before a mouse event is
triggered. As a consequence, the "content rectangle" might not be
initialized when the mouse event is processed, causing a division by
zero.

To avoid the problem, initialize the content rect immediately when the
window is shown.

Fixes #4115 <https://github.com/Genymobile/scrcpy/issues/4115>
10 months ago
Romain Vimont 7b7076ef85 Add direct links to donations 10 months ago
Romain Vimont 808bd14e30 Ignore fold change events for other display ids
Scrcpy mirrors a specific display id, it must ignore events for other
display ids.

Fixes #4120 <https://github.com/Genymobile/scrcpy/issues/4120>
10 months ago
Romain Vimont 0049b3ce07 Remove superfluous log
This line was committed by error in commit
a52053421a.
11 months ago
Romain Vimont 5764f47fee Update links to v2.1 11 months ago
Romain Vimont 2dab1f7024 Bump version to 2.1 11 months ago
Romain Vimont 744312ec64 Merge branch 'master' into release 11 months ago
Romain Vimont b9315620e2 Fix adb forward initialization
In forward mode, the dummy byte must be written immediately after the
first accept(), otherwise the client will wait indefinitely, causing a
deadlock (or a timeout).

Regression introduced by 8c650e53cd.
11 months ago
Romain Vimont ea59d525bd Fix code style
The code should fit in 80 columns.
11 months ago
Romain Vimont 0ffcfa0f5c Accept failure in rotation or fold registration
Do not make scrcpy fail if rotation or display fold listeners could not
be registered.
11 months ago
Romain Vimont c0f3c080b6 Register DisplayFoldListener only for Android 10+
This listener does not exist on Android < 10, and it makes scrcpy fail.
11 months ago
Romain Vimont d046678f85 Upgrade platform-tools (34.0.3) for Windows
Include the latest version of adb in Windows releases.
11 months ago
Romain Vimont fae3fbc934 Update developer documentation 11 months ago
Romain Vimont 5061b7e02c Fix build without gradle
Add missing class generation from IDisplayFoldListener.aidl.

Refs 24999d0d32
11 months ago
Romain Vimont 09009c2aa7 Upgrade SDL (2.28.0) for Windows
Include the latest version of SDL in Windows releases.

Fixes #3825 <https://github.com/Genymobile/scrcpy/issues/3825>
Refs libsdl/#7478 <https://github.com/libsdl-org/SDL/issues/7478>
11 months ago
Romain Vimont fb21bbf763 Add workarounds for Honor devices
Audio did not work on Honor devices.

To make it work, a system context must be set as a base context of
FakeContext (so that a PackageManager is available), and a current
Application and ActivityThread must be set.

These workarounds must not be applied for all devices, because they
might cause other issues.

Fixes #4015 <https://github.com/Genymobile/scrcpy/issues/4015>
Refs #3085 <https://github.com/Genymobile/scrcpy/issues/3805>

Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
11 months ago
Romain Vimont 0f1afff7a6 Move workarounds execution
Expose a single public static method in the Workarounds class to apply
all necessary workarounds.
11 months ago
Romain Vimont 48a00fb481 Log device BRAND
The BRAND value is not always the same as the MANUFACTURER value.
11 months ago
Romain Vimont 3b7e2ca9c8 Fix lint warning
Suppress lint "DiscouragedPrivateApi" in Workarounds.java.
11 months ago
wuderek 5bd7514871 Add InputManagerGlobal for Android 14 beta 3
Parts of the InputManager class have been moved to a new
InputManagerGlobal class in Android 14 preview.

Fixes #4074 <https://github.com/Genymobile/scrcpy/issues/4074>
PR #4075 <https://github.com/Genymobile/scrcpy/pull/4075>

Signed-off-by: Romain Vimont <rom@rom1v.com>
11 months ago
Romain Vimont d3c2955fb9 Add --time-limit
Add an option to stop scrcpy automatically after a given delay.

PR #4052 <https://github.com/Genymobile/scrcpy/pull/4052>
Fixes #3752 <https://github.com/Genymobile/scrcpy/issues/3752>
11 months ago
Romain Vimont 5042f8de93 Improve recording documentation 11 months ago
Romain Vimont 7536f95d1c Rename raw_video_stream to raw_stream
This server-specific option impacts both the video and audio streams.
11 months ago
Romain Vimont 6832e8d629 Remove spurious empty line 11 months ago
Romain Vimont 28313631e5 Reformat Java code
Fix code style.
11 months ago
Romain Vimont fdbc9397a7 Name Java threads
Give a user-friendly name to Java threads created by the server.
11 months ago
Romain Vimont 4ad7479425 Add missing shortcut in documentation
MOD+Backspace also triggers BACK.
11 months ago
Romain Vimont a3cdf1a6b8 Add option to kill adb on close
Killing adb on close by default would be incorrect, since it would break
any other usage of adb in parallel.

It could be easily done manually by calling "adb kill-server" once
scrcpy terminates, but add an option --kill-adb-on-close for
convenience.

Fixes #205 <https://github.com/Genymobile/scrcpy/issues/205>
Fixes #2580 <https://github.com/Genymobile/scrcpy/issues/2580>
Fixes #4049 <https://github.com/Genymobile/scrcpy/issues/4049>
11 months ago
Romain Vimont b16d4d1835 Fix adb server vs adb daemon confusion
The adb daemon runs on the device, the adb server runs as a background
process on the computer.
11 months ago
Romain Vimont b8d43866d2 Fix options alphabetical order
Commit fc52b24503 missed this one.
11 months ago
Romain Vimont 2d79aeb117 Simplify command in documentation
If --no-video is passed, --no-playback is equivalent to
--no-audio-playback.
11 months ago
Romain Vimont 888a5aae7d Fix typo in recording documentation
The option is --record, not --record-file.
11 months ago
Romain Vimont 323ea2f1d9 Fix PTS when not monotonically increasing
Some decoders fail to guarantee that PTS is strictly monotonically
increasing. Fix the (rescaled) PTS when it does not respect this
constraint.

Fixes #4054 <https://github.com/Genymobile/scrcpy/issues/4054>
11 months ago
Romain Vimont 9ca554ca41 Extract stream-specific structure in recorder
For now, it only contains the stream index, but more fields will be
added.
11 months ago
Romain Vimont 9d3c656414 Fix recorder waiting when stream disabled
In the recorder, if the video or audio stream is disabled, do not wait
for its initialization (it will never happen) to process the header.

In that case (scrcpy --no-audio --record=file.mp4), this caused the
whole content to be buffered in memory, and written only on exit.
11 months ago
Romain Vimont 379caf8551 Use a single condvar in recorder
The sc_cond_wait() in sc_recorder_process_header() needs to be notified
of changes to video_init/audio_init (protected by stream_cond) and
video_queue/audio_queue (protected by queue_cond).

Use only one condition variable to simplify.
11 months ago
Romain Vimont 2aec7b4c9d Mention how to interrupt scrcpy without video
There is no window to close if video playback is disabled.
11 months ago
Romain Vimont fc52b24503 Reorder options in alphabetical order
Fix the options order, using the short option as key first (if any) in
all cases for consistency.
11 months ago
Romain Vimont ff5ffc892f Add option to select audio source
Pass --audio-source=mic to capture the microphone instead of the device
audio output.
11 months ago
Romain Vimont 360f2fea1e Extract AudioCapture creation
This will allow to pass capture options without code duplication.
11 months ago
Adonis Najimi 24999d0d32 Reset video capture on folding event
Handle folding event the same way as rotation events.

Fixes #3960 <https://github.com/Genymobile/scrcpy/issues/3960>
PR #3979 <https://github.com/Genymobile/scrcpy/pull/3979>

Signed-off-by: Romain Vimont <rom@rom1v.com>
11 months ago
Romain Vimont 8e2c0d6407 Rename rotationChanged to resetCapture
The flag is used to reset the capture (restart the encoding) on rotation
change. It will also be used for other events (on folding change), so
rename it.

PR #3979 <https://github.com/Genymobile/scrcpy/pull/3979>
11 months ago
Romain Vimont 9a2abba098 Update demuxer comment
The comment was outdated:
 - the "meta" header is now always present (not only when recording is
   enabled);
 - it is not only used for the video stream, but also for the audio
   stream.
11 months ago
shuax b2d860382f Fix stream offset on audio buffer underflow
The `read` variable is in number of samples, while the offset must be in
bytes.

PR #4045 <https://github.com/Genymobile/scrcpy/pull/4045>

Signed-off-by: Romain Vimont <rom@rom1v.com>
11 months ago
Romain Vimont 4c4a03ebe1 Reorder options to maintain alphabetical order 11 months ago
Yan 798dfd240e Turn device screen off after set up
Sometimes it can take quite a while for everything to get set up and
the screen to appear.

PR #3902 <https://github.com/Genymobile/scrcpy/pull/3902>

Signed-off-by: Romain Vimont <rom@rom1v.com>
11 months ago
Romain Vimont c4caa6b81d Document --no-{video,audio}-playback
PR #4033 <https://github.com/Genymobile/scrcpy/pull/4033>
11 months ago
Romain Vimont 1efbfe1175 Add separate video and audio playback options
Add --no-video-playback and --no-audio-playback. The option
--no-playback is now an alias for both.

PR #4033 <https://github.com/Genymobile/scrcpy/pull/4033>
11 months ago