Romain Vimont
e30e692b36
Print FFmpeg logs
...
FFmpeg logs are redirected to a specific SDL log category.
Initialize the log level for this category to print them as expected.
2 years ago
Romain Vimont
10e8295aea
Move FFmpeg callback initialization
...
Configure FFmpeg log redirection on start from a log helper.
2 years ago
Romain Vimont
f30fd963a1
Upgrade FFmpeg custom builds for Windows
...
Use a build which includes the pcm_s16le decoder, to support RAW audio.
Refs <https://github.com/rom1v/scrcpy-deps/commits/6.0-scrcpy-2 >
2 years ago
Romain Vimont
9d60d7880b
Upgrade FFmpeg (6.0) for Windows
...
Use the latest version (specifically built for scrcpy).
Refs <https://www.ffmpeg.org/download.html#release_6.0 >
2 years ago
Romain Vimont
0fc62bfcd6
Use minimal prebuilt FFmpeg for Windows
...
On the scrcpy-deps repo, I built FFmpeg 5.1.2 binaries for Windows with
only the features used by scrcpy.
For comparison, here are the sizes of the dll for FFmpeg 5.1.2:
- before: 89M
- after: 4.7M
It also allows to upgrade the old FFmpeg version (4.3.1) used for win32.
Refs <https://github.com/rom1v/scrcpy-deps >
Refs <https://github.com/Genymobile/scrcpy/issues/1753 >
2 years ago
Romain Vimont
a20615066d
Simplify libusb prebuilt scripts
...
In theory, include/ might be slightly different for win32 and win64
builds. Use each one separately to simplify.
2 years ago
Romain Vimont
14a85fd61e
Silence lint warning about constant in API 29
...
MediaFormat.MIMETYPE_VIDEO_AV1 has been added in API 29, but it is not
a problem to inline the constant in older versions.
2 years ago
Romain Vimont
5bf52a98ed
Remove manifest package name
...
As reported by gradle:
> Setting the namespace via a source AndroidManifest.xml's package
> attribute is deprecated.
>
> Please instead set the namespace (or testNamespace) in the module's
> build.gradle file, as described here:
> https://developer.android.com/studio/build/configure-app-module#set-namespace
2 years ago
Romain Vimont
a252194161
Upgrade gradle build tools to 7.4.0
...
Plugin version 7.4.0.
Gradle version 7.5.
Refs <https://developer.android.com/studio/releases/gradle-plugin#updating-gradle >
2 years ago
Romain Vimont
b5d41ad4f6
Fix useless garbage initialization
...
The variable `p` was initialized with a garbage value (a `const char **`
casted to `char *`). Fortunately, it was never read.
Refs <https://github.com/Genymobile/scrcpy/issues/3765 >
2 years ago
Romain Vimont
389dd77b50
Fix MIN/MAX macros
...
Expressions like "x < MAX(y, z)" were broken.
2 years ago
Romain Vimont
3c3c07db05
Initialize server->serial in all cases
...
Running scrcpy --tcpip on a device already connected via TCP/IP did not
initialize server->serial.
As a consequence, in debug mode, an assertion failed:
scrcpy: ../app/src/server.c:770: run_server: Assertion
`server->serial' failed.
In release mode, scrcpy failed with this error:
adb: -s requires an argument
2 years ago
Romain Vimont
6b422e21bf
Fix error message on icon loading failure
2 years ago
Romain Vimont
8e8b039a63
Do not use avformat network
...
Scrcpy does not use FFmpeg network features. Initialize network locally
instead (useful only for Windows).
The include block has been moved to fix the following warning:
Please include winsock2.h before windows.h
2 years ago
Romain Vimont
0702be86d8
Accept Windows Sockets from version 1.1
...
Version 2.2 is probably not necessary (1.1 is the version required by
FFmpeg when network is enabled).
Refs <891ed24f77/libavformat/network.c (L63)
>
Refs <https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup >
2 years ago
Romain Vimont
0cea7fb24c
Fix WSAStartup() error check on Windows
2 years ago
Romain Vimont
3d10fbd9b4
Fix --bit-rate option in bash completion script
...
The option is --bit-rate, not --bitrate.
2 years ago
Romain Vimont
3e3756a323
Add auto-completion for --codec option
...
Add missing command to bash and zsh completion scripts.
2 years ago
Romain Vimont
5d6bcc5966
Use enum for long options constants
...
This avoids to manually assign values.
2 years ago
Romain Vimont
5973d4cdd7
Initialize mouse_input_mode explicitly
...
The explicit initialization was missing. It had no consequences because
SC_MOUSE_INPUT_MODE_INJECT == 0.
Fixes #3749 <https://github.com/Genymobile/scrcpy/issues/3749 >
2 years ago
Romain Vimont
0a151b96fe
Accept muxing AV1 into MP4 container
...
MP4 supports AV1.
Refs d2dce51038
2 years ago
Romain Vimont
ebecbe6bc6
Fix inconsistent quotes
...
The encoder name started with a simple quote but ended with a
double quote. Use a single quote for both.
2 years ago
Romain Vimont
d5dff239c8
Suggest commands with an explicit '='
2 years ago
Romain Vimont
5cf86ef7ff
Move finally-block to fix deadlock on stop
...
DesktopConnection implements Closeable, so it is implicitly closed after
its try-with-resources block. Closing the DesktopConnection shutdowns
the sockets, so it is necessary in particular to wake up blocking read()
calls from the controller.
But the controller thread was joined before the DesktopConnection was
closed, causing a deadlock. To fix the problem, join the controller
thread only after the DesktopConnection is closed.
Refs 400a1c69b1
2 years ago
Romain Vimont
e02f30f895
Remove unnecessary error logs
...
When a call to a packet or frame sink fails, do not log the error on the
caller side: either the "failure" is expected (explicitly stopped) or it
must be logged by the packet or frame sink implementation.
2 years ago
Romain Vimont
25e2eb7d7c
Document default video codec
...
Mention the default option value, like for other commands.
2 years ago
Romain Vimont
280a9afda8
Fix command-line help typo
2 years ago
Romain Vimont
e91618586c
Prefix receiver by sc_
...
Like all other components in scrcpy.
2 years ago
Romain Vimont
680ddf64be
Fix demuxer error message
...
Now that there are several possible codecs, do not hardcode H.264 in the
error message.
Refs 3e517cd40e
2 years ago
Romain Vimont
f4e7085c34
Log non-EPIPE I/O exceptions
...
On close, the client closes the socket. This wakes up socket blocking
calls on the server-side, by throwing an exception. Since this exception
is expected, it was not logged.
However, other IOExceptions might occur, which must not be ignored. For
that purpose, log only IOException when they are not caused by an EPIPE
error.
2 years ago
Romain Vimont
439a1fd4ed
Rename 'uid' to 'scid'
...
A random identifier is generated to differentiate multiple running
scrcpy instances. Rename it from 'uid' to 'scid' (scrcpy id) not to
confuse it with Linux UID.
Fixes #3729 <https://github.com/Genymobile/scrcpy/issues/3729 >
Refs 4315be1648
2 years ago
Romain Vimont
49eb326ce9
Extract packet merging
...
Config packets must be prepended to the next media packet. Extract the
logic to a new sc_packet_merger helper to simplify the demuxer code.
2 years ago
Romain Vimont
f03f32267e
Remove unused parser
...
Since 1c02b58412
, the parser is not used
anymore.
2 years ago
Romain Vimont
45b2e6db5c
Log component stopped in finally clause
...
The message must be logged even when no exception occurs.
2 years ago
Romain Vimont
400a1c69b1
Join all threads before end of main
...
Some calls from separate threads may throw exceptions once the main()
method has returned.
2 years ago
Romain Vimont
730eb1086a
Properly report demuxer errors
...
All demuxer errors were reported as "device disconnected", even if the
failure was not related to device socket read.
2 years ago
Romain Vimont
4f9e9c6619
Prefix UI events constants by SC_
2 years ago
Romain Vimont
953edfd1df
Split codec_id reading
...
Receive codec id and convert it to AVCodecID separately.
This will allow the caller to distinguish between EOS and unknown codec
id.
2 years ago
Romain Vimont
230b8274b9
Fix error return value
...
The function returns an enum AVCodecID, not a bool.
2 years ago
Romain Vimont
40866ddc10
Fix demuxer error message
...
The message applies to all packets, not only config packets.
2 years ago
Romain Vimont
bd56c0abf7
Remove unused codec context
...
The demuxer does not need any codec context.
2 years ago
Romain Vimont
6524e90c68
Remove unused constant
...
This line was committed by error.
Refs 3e517cd40e
2 years ago
Kartik Kushwaha
b4caa483dd
Add Fedora instructions in README
...
Add the command to install the scrcpy package for Fedora directly.
PR #3715 <https://github.com/Genymobile/scrcpy/pull/3715 >
Signed-off-by: Romain Vimont <rom@rom1v.com>
2 years ago
Romain Vimont
f2dee20a20
Set power mode on all physical displays
...
Android 10 and above support multiple physical displays. Apply power
mode to all of them.
Fixes #3716 <https://github.com/Genymobile/scrcpy/issues/3716 >
2 years ago
Romain Vimont
d2dce51038
Add support for AV1
...
Add option --codec=av1.
PR #3713 <https://github.com/Genymobile/scrcpy/pull/3713 >
2 years ago
Romain Vimont
4342c5637d
Add support for H265
...
Add option --codec=h265.
PR #3713 <https://github.com/Genymobile/scrcpy/pull/3713 >
Fixes #3092 <https://github.com/Genymobile/scrcpy/issues/3092 >
2 years ago
Romain Vimont
3e517cd40e
Add option to select video codec
...
Introduce the selection mechanism. Alternative codecs will be added in
further commits.
PR #3713 <https://github.com/Genymobile/scrcpy/pull/3713 >
2 years ago
Romain Vimont
f70f6cdd3e
Simplify server info initialization
...
Use sc_read16be() to read 16-bit integer fields.
2 years ago
Romain Vimont
87972e2022
Extract video streaming to a separate class
...
ScreenEncoder handled both capture/encoding and sending over the
network.
Move the streaming part to a separate VideoStreamer.
2 years ago
Romain Vimont
3aac74e9e9
Move variable assignment
...
Computing eof flag is not necessary if rotation changed.
2 years ago