Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04f19f42a7 | ||
|
|
3865ff53cd | ||
|
|
e2cc579316 | ||
|
|
b62a501819 | ||
|
|
83d323fcfa | ||
|
|
0b47251dee | ||
|
|
d129a97098 | ||
|
|
2bd4cb6d5d | ||
|
|
6eaaf41dfd | ||
|
|
c0aa9c65c7 | ||
|
|
d1fa44179e | ||
|
|
4e34827822 | ||
|
|
a42a557543 | ||
|
|
8b487bf52e | ||
|
|
bd3c94240d | ||
|
|
7a66c4d0a4 | ||
|
|
c79e0f6989 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,4 +7,3 @@ build/
|
|||||||
.gradle/
|
.gradle/
|
||||||
/x/
|
/x/
|
||||||
local.properties
|
local.properties
|
||||||
/scrcpy-server
|
|
||||||
|
|||||||
@@ -25,13 +25,12 @@ It focuses on:
|
|||||||
[lowlatency]: https://github.com/Genymobile/scrcpy/pull/646
|
[lowlatency]: https://github.com/Genymobile/scrcpy/pull/646
|
||||||
|
|
||||||
Its features include:
|
Its features include:
|
||||||
- [audio forwarding](doc/audio.md) (Android 11+)
|
- [audio forwarding](doc/audio.md) (Android >= 11)
|
||||||
- [recording](doc/recording.md)
|
- [recording](doc/recording.md)
|
||||||
- mirroring with [Android device screen off](doc/device.md#turn-screen-off)
|
- mirroring with [Android device screen off](doc/device.md#turn-screen-off)
|
||||||
- [copy-paste](doc/control.md#copy-paste) in both directions
|
- [copy-paste](doc/control.md#copy-paste) in both directions
|
||||||
- [configurable quality](doc/video.md)
|
- [configurable quality](doc/video.md)
|
||||||
- [camera mirroring](doc/camera.md) (Android 12+)
|
- Android device screen [as a webcam (V4L2)](doc/v4l2.md) (Linux-only)
|
||||||
- [mirroring as a webcam (V4L2)](doc/v4l2.md) (Linux-only)
|
|
||||||
- [physical keyboard/mouse simulation (HID)](doc/hid-otg.md)
|
- [physical keyboard/mouse simulation (HID)](doc/hid-otg.md)
|
||||||
- [OTG mode](doc/hid-otg.md#otg)
|
- [OTG mode](doc/hid-otg.md#otg)
|
||||||
- and more…
|
- and more…
|
||||||
@@ -78,7 +77,6 @@ documented in the following pages:
|
|||||||
- [Recording](doc/recording.md)
|
- [Recording](doc/recording.md)
|
||||||
- [Tunnels](doc/tunnels.md)
|
- [Tunnels](doc/tunnels.md)
|
||||||
- [HID/OTG](doc/hid-otg.md)
|
- [HID/OTG](doc/hid-otg.md)
|
||||||
- [Camera](doc/camera.md)
|
|
||||||
- [Video4Linux](doc/v4l2.md)
|
- [Video4Linux](doc/v4l2.md)
|
||||||
- [Shortcuts](doc/shortcuts.md)
|
- [Shortcuts](doc/shortcuts.md)
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ _scrcpy() {
|
|||||||
--camera-id=
|
--camera-id=
|
||||||
--camera-facing=
|
--camera-facing=
|
||||||
--camera-fps=
|
--camera-fps=
|
||||||
--camera-high-speed
|
|
||||||
--camera-size=
|
--camera-size=
|
||||||
--crop=
|
--crop=
|
||||||
-d --select-usb
|
-d --select-usb
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ arguments=(
|
|||||||
'--audio-output-buffer=[Configure the size of the SDL audio output buffer (in milliseconds)]'
|
'--audio-output-buffer=[Configure the size of the SDL audio output buffer (in milliseconds)]'
|
||||||
{-b,--video-bit-rate=}'[Encode the video at the given bit-rate]'
|
{-b,--video-bit-rate=}'[Encode the video at the given bit-rate]'
|
||||||
'--camera-ar=[Select the camera size by its aspect ratio]'
|
'--camera-ar=[Select the camera size by its aspect ratio]'
|
||||||
'--camera-high-speed=[Enable high-speed camera capture mode]'
|
|
||||||
'--camera-id=[Specify the camera id to mirror]'
|
'--camera-id=[Specify the camera id to mirror]'
|
||||||
'--camera-facing=[Select the device camera by its facing direction]:facing:(front back external)'
|
'--camera-facing=[Select the device camera by its facing direction]:facing:(front back external)'
|
||||||
'--camera-fps=[Specify the camera capture frame rate]'
|
'--camera-fps=[Specify the camera capture frame rate]'
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ cd "$DIR"
|
|||||||
mkdir -p "$PREBUILT_DATA_DIR"
|
mkdir -p "$PREBUILT_DATA_DIR"
|
||||||
cd "$PREBUILT_DATA_DIR"
|
cd "$PREBUILT_DATA_DIR"
|
||||||
|
|
||||||
DEP_DIR=platform-tools-34.0.5
|
DEP_DIR=platform-tools-34.0.3
|
||||||
|
|
||||||
FILENAME=platform-tools_r34.0.5-windows.zip
|
FILENAME=platform-tools_r34.0.3-windows.zip
|
||||||
SHA256SUM=3f8320152704377de150418a3c4c9d07d16d80a6c0d0d8f7289c22c499e33571
|
SHA256SUM=fce992e93eb786fc9f47df93d83a7b912c46742d45c39d712c02e06d05b72e2b
|
||||||
|
|
||||||
if [[ -d "$DEP_DIR" ]]
|
if [[ -d "$DEP_DIR" ]]
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ cd "$DIR"
|
|||||||
mkdir -p "$PREBUILT_DATA_DIR"
|
mkdir -p "$PREBUILT_DATA_DIR"
|
||||||
cd "$PREBUILT_DATA_DIR"
|
cd "$PREBUILT_DATA_DIR"
|
||||||
|
|
||||||
DEP_DIR=SDL2-2.28.4
|
DEP_DIR=SDL2-2.28.0
|
||||||
|
|
||||||
FILENAME=SDL2-devel-2.28.4-mingw.tar.gz
|
FILENAME=SDL2-devel-2.28.0-mingw.tar.gz
|
||||||
SHA256SUM=779d091072cf97291f80030f5232d97aa3d48ab0f2c14fe0b9d9a33c593cdc35
|
SHA256SUM=b91ce59eeacd4a9db403f976fd2337d9360b21ada374124417d716065c380e20
|
||||||
|
|
||||||
if [[ -d "$DEP_DIR" ]]
|
if [[ -d "$DEP_DIR" ]]
|
||||||
then
|
then
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ BEGIN
|
|||||||
VALUE "LegalCopyright", "Romain Vimont, Genymobile"
|
VALUE "LegalCopyright", "Romain Vimont, Genymobile"
|
||||||
VALUE "OriginalFilename", "scrcpy.exe"
|
VALUE "OriginalFilename", "scrcpy.exe"
|
||||||
VALUE "ProductName", "scrcpy"
|
VALUE "ProductName", "scrcpy"
|
||||||
VALUE "ProductVersion", "v2.2"
|
VALUE "ProductVersion", "2.1.1"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
58
app/scrcpy.1
58
app/scrcpy.1
@@ -45,15 +45,15 @@ Set a list of comma-separated key:type=value options for the device audio encode
|
|||||||
|
|
||||||
The possible values for 'type' are 'int' (default), 'long', 'float' and 'string'.
|
The possible values for 'type' are 'int' (default), 'long', 'float' and 'string'.
|
||||||
|
|
||||||
The list of possible codec options is available in the Android documentation:
|
The list of possible codec options is available in the Android documentation
|
||||||
|
.UR https://d.android.com/reference/android/media/MediaFormat
|
||||||
<https://d.android.com/reference/android/media/MediaFormat>
|
.UE .
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-audio\-encoder " name
|
.BI "\-\-audio\-encoder " name
|
||||||
Use a specific MediaCodec audio encoder (depending on the codec provided by \fB\-\-audio\-codec\fR).
|
Use a specific MediaCodec audio encoder (depending on the codec provided by \fB\-\-audio\-codec\fR).
|
||||||
|
|
||||||
The available encoders can be listed by \fB\-\-list\-encoders\fR.
|
The available encoders can be listed by \-\-list\-encoders.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-audio\-source " source
|
.BI "\-\-audio\-source " source
|
||||||
@@ -79,19 +79,13 @@ Default is 8M (8000000).
|
|||||||
.BI "\-\-camera\-ar " ar
|
.BI "\-\-camera\-ar " ar
|
||||||
Select the camera size by its aspect ratio (+/- 10%).
|
Select the camera size by its aspect ratio (+/- 10%).
|
||||||
|
|
||||||
Possible values are "sensor" (use the camera sensor aspect ratio), "\fInum\fR:\fIden\fR" (e.g. "4:3") and "\fIvalue\fR" (e.g. "1.6").
|
Possible values are "sensor" (use the camera sensor aspect ratio), "<num>:<den>" (e.g. "4:3") and "<value>" (e.g. "1.6").
|
||||||
|
|
||||||
.TP
|
|
||||||
.B \-\-camera\-high\-speed
|
|
||||||
Enable high-speed camera capture mode.
|
|
||||||
|
|
||||||
This mode is restricted to specific resolutions and frame rates, listed by \fB\-\-list\-camera\-sizes\fR.
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-camera\-id " id
|
.BI "\-\-camera\-id " id
|
||||||
Specify the device camera id to mirror.
|
Specify the device camera id to mirror.
|
||||||
|
|
||||||
The available camera ids can be listed by \fB\-\-list\-cameras\fR.
|
The available camera ids can be listed by \-\-list\-cameras.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-camera\-facing " facing
|
.BI "\-\-camera\-facing " facing
|
||||||
@@ -131,7 +125,7 @@ Disable screensaver while scrcpy is running.
|
|||||||
.BI "\-\-display\-id " id
|
.BI "\-\-display\-id " id
|
||||||
Specify the device display id to mirror.
|
Specify the device display id to mirror.
|
||||||
|
|
||||||
The available display ids can be listed by \fB\-\-list\-displays\fR.
|
The available display ids can be listed by \-\-list\-displays.
|
||||||
|
|
||||||
Default is 0.
|
Default is 0.
|
||||||
|
|
||||||
@@ -189,11 +183,9 @@ Inject computer clipboard text as a sequence of key events on Ctrl+v (like MOD+S
|
|||||||
|
|
||||||
This is a workaround for some devices not behaving as expected when setting the device clipboard programmatically.
|
This is a workaround for some devices not behaving as expected when setting the device clipboard programmatically.
|
||||||
|
|
||||||
.TP
|
|
||||||
.B \-\-list\-camera\-sizes
|
.B \-\-list\-camera\-sizes
|
||||||
List the valid camera capture sizes.
|
List the valid camera capture sizes.
|
||||||
|
|
||||||
.TP
|
|
||||||
.B \-\-list\-cameras
|
.B \-\-list\-cameras
|
||||||
List cameras available on the device.
|
List cameras available on the device.
|
||||||
|
|
||||||
@@ -241,7 +233,7 @@ Disable device control (mirror the device in read\-only).
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-N, \-\-no\-playback
|
.B \-N, \-\-no\-playback
|
||||||
Disable video and audio playback on the computer (equivalent to \fB\-\-no\-video\-playback \-\-no\-audio\-playback\fR).
|
Disable video and audio playback on the computer (equivalent to --no-video-playback --no-audio-playback).
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-\-no\-audio
|
.B \-\-no\-audio
|
||||||
@@ -363,7 +355,8 @@ Request SDL to use the given render driver (this is just a hint).
|
|||||||
|
|
||||||
Supported names are currently "direct3d", "opengl", "opengles2", "opengles", "metal" and "software".
|
Supported names are currently "direct3d", "opengl", "opengles2", "opengles", "metal" and "software".
|
||||||
|
|
||||||
<https://wiki.libsdl.org/SDL_HINT_RENDER_DRIVER>
|
.UR https://wiki.libsdl.org/SDL_HINT_RENDER_DRIVER
|
||||||
|
.UE
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-\-require\-audio
|
.B \-\-require\-audio
|
||||||
@@ -411,13 +404,13 @@ Set the maximum mirroring time, in seconds.
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-tunnel\-host " ip
|
.BI "\-\-tunnel\-host " ip
|
||||||
Set the IP address of the adb tunnel to reach the scrcpy server. This option automatically enables \fB\-\-force\-adb\-forward\fR.
|
Set the IP address of the adb tunnel to reach the scrcpy server. This option automatically enables --force-adb-forward.
|
||||||
|
|
||||||
Default is localhost.
|
Default is localhost.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-tunnel\-port " port
|
.BI "\-\-tunnel\-port " port
|
||||||
Set the TCP port of the adb tunnel to reach the scrcpy server. This option automatically enables \fB\-\-force\-adb\-forward\fR.
|
Set the TCP port of the adb tunnel to reach the scrcpy server. This option automatically enables --force-adb-forward.
|
||||||
|
|
||||||
Default is 0 (not forced): the local port used for establishing the tunnel will be used.
|
Default is 0 (not forced): the local port used for establishing the tunnel will be used.
|
||||||
|
|
||||||
@@ -457,15 +450,15 @@ Set a list of comma-separated key:type=value options for the device video encode
|
|||||||
|
|
||||||
The possible values for 'type' are 'int' (default), 'long', 'float' and 'string'.
|
The possible values for 'type' are 'int' (default), 'long', 'float' and 'string'.
|
||||||
|
|
||||||
The list of possible codec options is available in the Android documentation:
|
The list of possible codec options is available in the Android documentation
|
||||||
|
.UR https://d.android.com/reference/android/media/MediaFormat
|
||||||
<https://d.android.com/reference/android/media/MediaFormat>
|
.UE .
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-video\-encoder " name
|
.BI "\-\-video\-encoder " name
|
||||||
Use a specific MediaCodec video encoder (depending on the codec provided by \fB\-\-video\-codec\fR).
|
Use a specific MediaCodec video encoder (depending on the codec provided by \fB\-\-video\-codec\fR).
|
||||||
|
|
||||||
The available encoders can be listed by \fB\-\-list\-encoders\fR.
|
The available encoders can be listed by \-\-list\-encoders.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-video\-source " source
|
.BI "\-\-video\-source " source
|
||||||
@@ -635,7 +628,7 @@ Path to adb.
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B ANDROID_SERIAL
|
.B ANDROID_SERIAL
|
||||||
Device serial to use if no selector (\fB-s\fR, \fB-d\fR, \fB-e\fR or \fB\-\-tcpip=\fIaddr\fR) is specified.
|
Device serial to use if no selector (-s, -d, -e or --tcpip=<addr>) is specified.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B SCRCPY_ICON_PATH
|
.B SCRCPY_ICON_PATH
|
||||||
@@ -658,14 +651,23 @@ for the Debian Project (and may be used by others).
|
|||||||
|
|
||||||
|
|
||||||
.SH "REPORTING BUGS"
|
.SH "REPORTING BUGS"
|
||||||
Report bugs to <https://github.com/Genymobile/scrcpy/issues>.
|
Report bugs to
|
||||||
|
.UR https://github.com/Genymobile/scrcpy/issues
|
||||||
|
.UE .
|
||||||
|
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
Copyright \(co 2018 Genymobile <https://www.genymobile.com>
|
Copyright \(co 2018 Genymobile
|
||||||
|
.UR https://www.genymobile.com
|
||||||
|
Genymobile
|
||||||
|
.UE
|
||||||
|
|
||||||
Copyright \(co 2018\-2023 Romain Vimont <rom@rom1v.com>
|
Copyright \(co 2018\-2023
|
||||||
|
.MT rom@rom1v.com
|
||||||
|
Romain Vimont
|
||||||
|
.ME
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0.
|
Licensed under the Apache License, Version 2.0.
|
||||||
|
|
||||||
.SH WWW
|
.SH WWW
|
||||||
<https://github.com/Genymobile/scrcpy>
|
.UR https://github.com/Genymobile/scrcpy
|
||||||
|
.UE
|
||||||
|
|||||||
@@ -2290,13 +2290,19 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts->lock_video_orientation !=
|
||||||
|
SC_LOCK_VIDEO_ORIENTATION_UNLOCKED) {
|
||||||
|
LOGE("--lock-video-orientation is not supported for camera");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (opts->camera_id && opts->camera_facing != SC_CAMERA_FACING_ANY) {
|
if (opts->camera_id && opts->camera_facing != SC_CAMERA_FACING_ANY) {
|
||||||
LOGE("Could not specify both --camera-id and --camera-facing");
|
LOGE("Could not specify both --camera-id and --camera-facing");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts->camera_size) {
|
if (opts->camera_size) {
|
||||||
if (opts->max_size) {
|
if (opts->camera_ar) {
|
||||||
LOGE("Could not specify both --camera-size and -m/--max-size");
|
LOGE("Could not specify both --camera-size and -m/--max-size");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,5 @@ endian = 'little'
|
|||||||
|
|
||||||
[properties]
|
[properties]
|
||||||
prebuilt_ffmpeg = 'ffmpeg-6.0-scrcpy-4/win32'
|
prebuilt_ffmpeg = 'ffmpeg-6.0-scrcpy-4/win32'
|
||||||
prebuilt_sdl2 = 'SDL2-2.28.4/i686-w64-mingw32'
|
prebuilt_sdl2 = 'SDL2-2.28.0/i686-w64-mingw32'
|
||||||
prebuilt_libusb = 'libusb-1.0.26/libusb-MinGW-Win32'
|
prebuilt_libusb = 'libusb-1.0.26/libusb-MinGW-Win32'
|
||||||
|
|||||||
@@ -17,5 +17,5 @@ endian = 'little'
|
|||||||
|
|
||||||
[properties]
|
[properties]
|
||||||
prebuilt_ffmpeg = 'ffmpeg-6.0-scrcpy-4/win64'
|
prebuilt_ffmpeg = 'ffmpeg-6.0-scrcpy-4/win64'
|
||||||
prebuilt_sdl2 = 'SDL2-2.28.4/x86_64-w64-mingw32'
|
prebuilt_sdl2 = 'SDL2-2.28.0/x86_64-w64-mingw32'
|
||||||
prebuilt_libusb = 'libusb-1.0.26/libusb-MinGW-x64'
|
prebuilt_libusb = 'libusb-1.0.26/libusb-MinGW-x64'
|
||||||
|
|||||||
150
doc/camera.md
150
doc/camera.md
@@ -1,150 +0,0 @@
|
|||||||
# Camera
|
|
||||||
|
|
||||||
Camera mirroring is supported for devices with Android 12 or higher.
|
|
||||||
|
|
||||||
To capture the camera instead of the device screen:
|
|
||||||
|
|
||||||
```
|
|
||||||
scrcpy --video-source=camera
|
|
||||||
```
|
|
||||||
|
|
||||||
By default, it automatically switches [audio source](audio.md#source) to
|
|
||||||
microphone (as if `--audio-source=mic` were also passed).
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scrcpy --video-source=display # default is --audio-source=output
|
|
||||||
scrcpy --video-source=camera # default is --audio-source=mic
|
|
||||||
scrcpy --video-source=display --audio-source=mic # force display AND microphone
|
|
||||||
scrcpy --video-source=camera --audio-source=output # force camera AND device audio output
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## List
|
|
||||||
|
|
||||||
To list the cameras available (with their declared valid sizes and frame rates):
|
|
||||||
|
|
||||||
```
|
|
||||||
scrcpy --list-cameras
|
|
||||||
scrcpy --list-camera-sizes
|
|
||||||
```
|
|
||||||
|
|
||||||
_Note that the sizes and frame rates are declarative. They are not accurate on
|
|
||||||
all devices: some of them are declared but not supported, while some others are
|
|
||||||
not declared but supported._
|
|
||||||
|
|
||||||
|
|
||||||
## Selection
|
|
||||||
|
|
||||||
It is possible to pass an explicit camera id (as listed by `--list-cameras`):
|
|
||||||
|
|
||||||
```
|
|
||||||
scrcpy --video-source=camera --camera-id=0
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, the camera may be selected automatically:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scrcpy --video-source=camera # use the first camera
|
|
||||||
scrcpy --video-source=camera --camera-facing=front # use the first front camera
|
|
||||||
scrcpy --video-source=camera --camera-facing=back # use the first back camera
|
|
||||||
scrcpy --video-source=camera --camera-facing=external # use the first external camera
|
|
||||||
```
|
|
||||||
|
|
||||||
If `--camera-id` is specified, then `--camera-facing` is forbidden (the id
|
|
||||||
already determines the camera):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scrcpy --video-source=camera --camera-id=0 --camera-facing=front # error
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Size selection
|
|
||||||
|
|
||||||
It is possible to pass an explicit camera size:
|
|
||||||
|
|
||||||
```
|
|
||||||
scrcpy --video-source=camera --camera-size=1920x1080
|
|
||||||
```
|
|
||||||
|
|
||||||
The given size may be listed among the declared valid sizes
|
|
||||||
(`--list-camera-sizes`), but may also be anything else (some devices support
|
|
||||||
arbitrary sizes):
|
|
||||||
|
|
||||||
```
|
|
||||||
scrcpy --video-source=camera --camera-size=1840x444
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, a declared valid size (among the ones listed by
|
|
||||||
`list-camera-sizes`) may be selected automatically.
|
|
||||||
|
|
||||||
Two constraints are supported:
|
|
||||||
- `-m`/`--max-size` (already used for display mirroring), for example `-m1920`;
|
|
||||||
- `--camera-ar` to specify an aspect ratio (`<num>:<den>`, `<value>` or
|
|
||||||
`sensor`).
|
|
||||||
|
|
||||||
Some examples:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scrcpy --video-source=camera # use the greatest width and the greatest associated height
|
|
||||||
scrcpy --video-source=camera -m1920 # use the greatest width not above 1920 and the greatest associated height
|
|
||||||
scrcpy --video-source=camera --camera-ar=4:3 # use the greatest size with an aspect ratio of 4:3 (+/- 10%)
|
|
||||||
scrcpy --video-source=camera --camera-ar=1.6 # use the greatest size with an aspect ratio of 1.6 (+/- 10%)
|
|
||||||
scrcpy --video-source=camera --camera-ar=sensor # use the greatest size with the aspect ratio of the camera sensor (+/- 10%)
|
|
||||||
scrcpy --video-source=camera -m1920 --camera-ar=16:9 # use the greatest width not above 1920 and the closest to 16:9 aspect ratio
|
|
||||||
```
|
|
||||||
|
|
||||||
If `--camera-size` is specified, then `-m`/`--max-size` and `--camera-ar` are
|
|
||||||
forbidden (the size is determined by the value given explicitly):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scrcpy --video-source=camera --camera-size=1920x1080 -m3000 # error
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Frame rate
|
|
||||||
|
|
||||||
By default, camera is captured at Android's default frame rate (30 fps).
|
|
||||||
|
|
||||||
To configure a different frame rate:
|
|
||||||
|
|
||||||
```
|
|
||||||
scrcpy --video-source=camera --camera-fps=60
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## High speed capture
|
|
||||||
|
|
||||||
The Android camera API also supports a [high speed capture mode][high speed].
|
|
||||||
|
|
||||||
This mode is restricted to specific resolutions and frame rates, listed by
|
|
||||||
`--list-camera-sizes`.
|
|
||||||
|
|
||||||
```
|
|
||||||
scrcpy --video-source=camera --camera-size=1920x1080 --camera-fps=240
|
|
||||||
```
|
|
||||||
|
|
||||||
[high speed]: https://developer.android.com/reference/android/hardware/camera2/CameraConstrainedHighSpeedCaptureSession
|
|
||||||
|
|
||||||
|
|
||||||
## Brace expansion tip
|
|
||||||
|
|
||||||
All camera options start with `--camera-`, so if your shell supports it, you can
|
|
||||||
benefit from [brace expansion] (for example, it is supported _bash_ and _zsh_):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scrcpy --video-source=camera --camera-{facing=back,ar=16:9,high-speed,fps=120}
|
|
||||||
```
|
|
||||||
|
|
||||||
This will be expanded as:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scrcpy --video-source=camera --camera-facing=back --camera-ar=16:9 --camera-high-speed --camera-fps=120
|
|
||||||
```
|
|
||||||
|
|
||||||
[brace expansion]: https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html
|
|
||||||
|
|
||||||
|
|
||||||
## Webcam
|
|
||||||
|
|
||||||
Combined with the [V4L2](v4l2.md) feature on Linux, the Android device camera
|
|
||||||
may be used as a webcam on the computer.
|
|
||||||
@@ -1,14 +1,5 @@
|
|||||||
# Video
|
# Video
|
||||||
|
|
||||||
## Source
|
|
||||||
|
|
||||||
By default, scrcpy mirrors the device screen.
|
|
||||||
|
|
||||||
It is possible to capture the device camera instead.
|
|
||||||
|
|
||||||
See the dedicated [camera](camera.md) page.
|
|
||||||
|
|
||||||
|
|
||||||
## Size
|
## Size
|
||||||
|
|
||||||
By default, scrcpy attempts to mirror at the Android device resolution.
|
By default, scrcpy attempts to mirror at the Android device resolution.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
project('scrcpy', 'c',
|
project('scrcpy', 'c',
|
||||||
version: 'v2.2',
|
version: '2.1.1',
|
||||||
meson_version: '>= 0.48',
|
meson_version: '>= 0.48',
|
||||||
default_options: [
|
default_options: [
|
||||||
'c_std=c11',
|
'c_std=c11',
|
||||||
|
|||||||
16
release.mk
16
release.mk
@@ -98,10 +98,10 @@ dist-win32: build-server build-win32
|
|||||||
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win32/bin/avcodec-60.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win32/bin/avcodec-60.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win32/bin/avformat-60.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win32/bin/avformat-60.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win32/bin/swresample-4.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win32/bin/swresample-4.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/platform-tools-34.0.5/adb.exe "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/platform-tools-34.0.3/adb.exe "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/platform-tools-34.0.5/AdbWinApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/platform-tools-34.0.3/AdbWinApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/platform-tools-34.0.5/AdbWinUsbApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/platform-tools-34.0.3/AdbWinUsbApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/SDL2-2.28.4/i686-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/SDL2-2.28.0/i686-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/libusb-1.0.26/libusb-MinGW-Win32/bin/msys-usb-1.0.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/libusb-1.0.26/libusb-MinGW-Win32/bin/msys-usb-1.0.dll "$(DIST)/$(WIN32_TARGET_DIR)/"
|
||||||
|
|
||||||
dist-win64: build-server build-win64
|
dist-win64: build-server build-win64
|
||||||
@@ -116,10 +116,10 @@ dist-win64: build-server build-win64
|
|||||||
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win64/bin/avcodec-60.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win64/bin/avcodec-60.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win64/bin/avformat-60.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win64/bin/avformat-60.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win64/bin/swresample-4.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/ffmpeg-6.0-scrcpy-4/win64/bin/swresample-4.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/platform-tools-34.0.5/adb.exe "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/platform-tools-34.0.3/adb.exe "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/platform-tools-34.0.5/AdbWinApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/platform-tools-34.0.3/AdbWinApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/platform-tools-34.0.5/AdbWinUsbApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/platform-tools-34.0.3/AdbWinUsbApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/SDL2-2.28.4/x86_64-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/SDL2-2.28.0/x86_64-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
cp app/prebuilt-deps/data/libusb-1.0.26/libusb-MinGW-x64/bin/msys-usb-1.0.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
cp app/prebuilt-deps/data/libusb-1.0.26/libusb-MinGW-x64/bin/msys-usb-1.0.dll "$(DIST)/$(WIN64_TARGET_DIR)/"
|
||||||
|
|
||||||
zip-win32: dist-win32
|
zip-win32: dist-win32
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ android {
|
|||||||
applicationId "com.genymobile.scrcpy"
|
applicationId "com.genymobile.scrcpy"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode 200
|
versionCode 20101
|
||||||
versionName "v2.2"
|
versionName "2.1.1"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
SCRCPY_DEBUG=false
|
SCRCPY_DEBUG=false
|
||||||
SCRCPY_VERSION_NAME=v2.2
|
SCRCPY_VERSION_NAME=2.1.1
|
||||||
|
|
||||||
PLATFORM=${ANDROID_PLATFORM:-33}
|
PLATFORM=${ANDROID_PLATFORM:-33}
|
||||||
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-33.0.0}
|
BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-33.0.0}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ public class CameraCapture extends SurfaceCapture {
|
|||||||
this.maxSize = maxSize;
|
this.maxSize = maxSize;
|
||||||
try {
|
try {
|
||||||
size = selectSize(cameraId, null, maxSize, aspectRatio, highSpeed);
|
size = selectSize(cameraId, null, maxSize, aspectRatio, highSpeed);
|
||||||
return size != null;
|
return true;
|
||||||
} catch (CameraAccessException e) {
|
} catch (CameraAccessException e) {
|
||||||
Ln.w("Could not select camera size", e);
|
Ln.w("Could not select camera size", e);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
package com.genymobile.scrcpy;
|
package com.genymobile.scrcpy;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.hardware.camera2.CameraCharacteristics;
|
import android.hardware.camera2.CameraCharacteristics;
|
||||||
|
|
||||||
public enum CameraFacing {
|
public enum CameraFacing {
|
||||||
FRONT("front", CameraCharacteristics.LENS_FACING_FRONT),
|
FRONT("front", CameraCharacteristics.LENS_FACING_FRONT),
|
||||||
BACK("back", CameraCharacteristics.LENS_FACING_BACK),
|
BACK("back", CameraCharacteristics.LENS_FACING_BACK),
|
||||||
@SuppressLint("InlinedApi") // introduced in API 23
|
|
||||||
EXTERNAL("external", CameraCharacteristics.LENS_FACING_EXTERNAL);
|
EXTERNAL("external", CameraCharacteristics.LENS_FACING_EXTERNAL);
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|||||||
@@ -132,29 +132,20 @@ public final class DesktopConnection implements Closeable {
|
|||||||
return controlSocket;
|
return controlSocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() throws IOException {
|
public void close() throws IOException {
|
||||||
if (videoSocket != null) {
|
if (videoSocket != null) {
|
||||||
videoSocket.shutdownInput();
|
videoSocket.shutdownInput();
|
||||||
videoSocket.shutdownOutput();
|
videoSocket.shutdownOutput();
|
||||||
|
videoSocket.close();
|
||||||
}
|
}
|
||||||
if (audioSocket != null) {
|
if (audioSocket != null) {
|
||||||
audioSocket.shutdownInput();
|
audioSocket.shutdownInput();
|
||||||
audioSocket.shutdownOutput();
|
audioSocket.shutdownOutput();
|
||||||
|
audioSocket.close();
|
||||||
}
|
}
|
||||||
if (controlSocket != null) {
|
if (controlSocket != null) {
|
||||||
controlSocket.shutdownInput();
|
controlSocket.shutdownInput();
|
||||||
controlSocket.shutdownOutput();
|
controlSocket.shutdownOutput();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void close() throws IOException {
|
|
||||||
if (videoSocket != null) {
|
|
||||||
videoSocket.close();
|
|
||||||
}
|
|
||||||
if (audioSocket != null) {
|
|
||||||
audioSocket.close();
|
|
||||||
}
|
|
||||||
if (controlSocket != null) {
|
|
||||||
controlSocket.close();
|
controlSocket.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,6 @@ package com.genymobile.scrcpy;
|
|||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.io.FileDescriptor;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.PrintStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log both to Android logger (so that logs are visible in "adb logcat") and standard output/error (so that they are visible in the terminal
|
* Log both to Android logger (so that logs are visible in "adb logcat") and standard output/error (so that they are visible in the terminal
|
||||||
* directly).
|
* directly).
|
||||||
@@ -16,9 +11,6 @@ public final class Ln {
|
|||||||
private static final String TAG = "scrcpy";
|
private static final String TAG = "scrcpy";
|
||||||
private static final String PREFIX = "[server] ";
|
private static final String PREFIX = "[server] ";
|
||||||
|
|
||||||
private static final PrintStream CONSOLE_OUT = new PrintStream(new FileOutputStream(FileDescriptor.out));
|
|
||||||
private static final PrintStream CONSOLE_ERR = new PrintStream(new FileOutputStream(FileDescriptor.err));
|
|
||||||
|
|
||||||
enum Level {
|
enum Level {
|
||||||
VERBOSE, DEBUG, INFO, WARN, ERROR
|
VERBOSE, DEBUG, INFO, WARN, ERROR
|
||||||
}
|
}
|
||||||
@@ -29,12 +21,6 @@ public final class Ln {
|
|||||||
// not instantiable
|
// not instantiable
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void disableSystemStreams() {
|
|
||||||
PrintStream nullStream = new PrintStream(new NullOutputStream());
|
|
||||||
System.setOut(nullStream);
|
|
||||||
System.setErr(nullStream);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the log level.
|
* Initialize the log level.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -53,30 +39,30 @@ public final class Ln {
|
|||||||
public static void v(String message) {
|
public static void v(String message) {
|
||||||
if (isEnabled(Level.VERBOSE)) {
|
if (isEnabled(Level.VERBOSE)) {
|
||||||
Log.v(TAG, message);
|
Log.v(TAG, message);
|
||||||
CONSOLE_OUT.print(PREFIX + "VERBOSE: " + message + '\n');
|
System.out.print(PREFIX + "VERBOSE: " + message + '\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void d(String message) {
|
public static void d(String message) {
|
||||||
if (isEnabled(Level.DEBUG)) {
|
if (isEnabled(Level.DEBUG)) {
|
||||||
Log.d(TAG, message);
|
Log.d(TAG, message);
|
||||||
CONSOLE_OUT.print(PREFIX + "DEBUG: " + message + '\n');
|
System.out.print(PREFIX + "DEBUG: " + message + '\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void i(String message) {
|
public static void i(String message) {
|
||||||
if (isEnabled(Level.INFO)) {
|
if (isEnabled(Level.INFO)) {
|
||||||
Log.i(TAG, message);
|
Log.i(TAG, message);
|
||||||
CONSOLE_OUT.print(PREFIX + "INFO: " + message + '\n');
|
System.out.print(PREFIX + "INFO: " + message + '\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void w(String message, Throwable throwable) {
|
public static void w(String message, Throwable throwable) {
|
||||||
if (isEnabled(Level.WARN)) {
|
if (isEnabled(Level.WARN)) {
|
||||||
Log.w(TAG, message, throwable);
|
Log.w(TAG, message, throwable);
|
||||||
CONSOLE_ERR.print(PREFIX + "WARN: " + message + '\n');
|
System.err.print(PREFIX + "WARN: " + message + '\n');
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
throwable.printStackTrace(CONSOLE_ERR);
|
throwable.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,9 +74,9 @@ public final class Ln {
|
|||||||
public static void e(String message, Throwable throwable) {
|
public static void e(String message, Throwable throwable) {
|
||||||
if (isEnabled(Level.ERROR)) {
|
if (isEnabled(Level.ERROR)) {
|
||||||
Log.e(TAG, message, throwable);
|
Log.e(TAG, message, throwable);
|
||||||
CONSOLE_ERR.print(PREFIX + "ERROR: " + message + '\n');
|
System.err.print(PREFIX + "ERROR: " + message + "\n");
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
throwable.printStackTrace(CONSOLE_ERR);
|
throwable.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,21 +84,4 @@ public final class Ln {
|
|||||||
public static void e(String message) {
|
public static void e(String message) {
|
||||||
e(message, null);
|
e(message, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static class NullOutputStream extends OutputStream {
|
|
||||||
@Override
|
|
||||||
public void write(byte[] b) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(byte[] b, int off, int len) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void write(int b) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import android.hardware.camera2.params.StreamConfigurationMap;
|
|||||||
import android.media.MediaCodec;
|
import android.media.MediaCodec;
|
||||||
import android.util.Range;
|
import android.util.Range;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
@@ -117,7 +119,7 @@ public final class LogUtils {
|
|||||||
|
|
||||||
android.util.Size[] highSpeedSizes = configs.getHighSpeedVideoSizes();
|
android.util.Size[] highSpeedSizes = configs.getHighSpeedVideoSizes();
|
||||||
if (highSpeedSizes.length > 0) {
|
if (highSpeedSizes.length > 0) {
|
||||||
builder.append("\n High speed capture (--camera-high-speed):");
|
builder.append("\n High speed capture:");
|
||||||
for (android.util.Size size : highSpeedSizes) {
|
for (android.util.Size size : highSpeedSizes) {
|
||||||
Range<Integer>[] highFpsRanges = configs.getHighSpeedVideoFpsRanges();
|
Range<Integer>[] highFpsRanges = configs.getHighSpeedVideoFpsRanges();
|
||||||
SortedSet<Integer> uniqueHighFps = getUniqueSet(highFpsRanges);
|
SortedSet<Integer> uniqueHighFps = getUniqueSet(highFpsRanges);
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ public class ScreenCapture extends SurfaceCapture implements Device.RotationList
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setMaxSize(int maxSize) {
|
public boolean setMaxSize(int size) {
|
||||||
device.setMaxSize(maxSize);
|
device.setMaxSize(size);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ public final class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void scrcpy(Options options) throws IOException, ConfigurationException {
|
private static void scrcpy(Options options) throws IOException, ConfigurationException {
|
||||||
|
Ln.i("Device: [" + Build.MANUFACTURER + "] " + Build.BRAND + " " + Build.MODEL + " (Android " + Build.VERSION.RELEASE + ")");
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && options.getVideoSource() == VideoSource.CAMERA) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S && options.getVideoSource() == VideoSource.CAMERA) {
|
||||||
Ln.e("Camera mirroring is not supported before Android 12");
|
Ln.e("Camera mirroring is not supported before Android 12");
|
||||||
throw new ConfigurationException("Camera mirroring is not supported");
|
throw new ConfigurationException("Camera mirroring is not supported");
|
||||||
@@ -102,8 +104,8 @@ public final class Server {
|
|||||||
boolean video = options.getVideo();
|
boolean video = options.getVideo();
|
||||||
boolean audio = options.getAudio();
|
boolean audio = options.getAudio();
|
||||||
boolean sendDummyByte = options.getSendDummyByte();
|
boolean sendDummyByte = options.getSendDummyByte();
|
||||||
boolean camera = options.getVideoSource() == VideoSource.CAMERA;
|
|
||||||
|
|
||||||
|
boolean camera = true;
|
||||||
Workarounds.apply(audio, camera);
|
Workarounds.apply(audio, camera);
|
||||||
|
|
||||||
List<AsyncProcessor> asyncProcessors = new ArrayList<>();
|
List<AsyncProcessor> asyncProcessors = new ArrayList<>();
|
||||||
@@ -163,8 +165,6 @@ public final class Server {
|
|||||||
asyncProcessor.stop();
|
asyncProcessor.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.shutdown();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initThread.join();
|
initThread.join();
|
||||||
for (AsyncProcessor asyncProcessor : asyncProcessors) {
|
for (AsyncProcessor asyncProcessor : asyncProcessors) {
|
||||||
@@ -189,7 +189,7 @@ public final class Server {
|
|||||||
try {
|
try {
|
||||||
internalMain(args);
|
internalMain(args);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
Ln.e(t.getMessage(), t);
|
t.printStackTrace();
|
||||||
status = 1;
|
status = 1;
|
||||||
} finally {
|
} finally {
|
||||||
// By default, the Java process exits when all non-daemon threads are terminated.
|
// By default, the Java process exits when all non-daemon threads are terminated.
|
||||||
@@ -206,11 +206,8 @@ public final class Server {
|
|||||||
|
|
||||||
Options options = Options.parse(args);
|
Options options = Options.parse(args);
|
||||||
|
|
||||||
Ln.disableSystemStreams();
|
|
||||||
Ln.initLogLevel(options.getLogLevel());
|
Ln.initLogLevel(options.getLogLevel());
|
||||||
|
|
||||||
Ln.i("Device: [" + Build.MANUFACTURER + "] " + Build.BRAND + " " + Build.MODEL + " (Android " + Build.VERSION.RELEASE + ")");
|
|
||||||
|
|
||||||
if (options.getList()) {
|
if (options.getList()) {
|
||||||
if (options.getCleanup()) {
|
if (options.getCleanup()) {
|
||||||
CleanUp.unlinkSelf();
|
CleanUp.unlinkSelf();
|
||||||
|
|||||||
@@ -56,9 +56,9 @@ public abstract class SurfaceCapture {
|
|||||||
/**
|
/**
|
||||||
* Set the maximum capture size (set by the encoder if it does not support the current size).
|
* Set the maximum capture size (set by the encoder if it does not support the current size).
|
||||||
*
|
*
|
||||||
* @param maxSize Maximum size
|
* @param size Maximum size
|
||||||
*/
|
*/
|
||||||
public abstract boolean setMaxSize(int maxSize);
|
public abstract boolean setMaxSize(int size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicate if the capture has been closed internally.
|
* Indicate if the capture has been closed internally.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import android.media.MediaFormat;
|
|||||||
public enum VideoCodec implements Codec {
|
public enum VideoCodec implements Codec {
|
||||||
H264(0x68_32_36_34, "h264", MediaFormat.MIMETYPE_VIDEO_AVC),
|
H264(0x68_32_36_34, "h264", MediaFormat.MIMETYPE_VIDEO_AVC),
|
||||||
H265(0x68_32_36_35, "h265", MediaFormat.MIMETYPE_VIDEO_HEVC),
|
H265(0x68_32_36_35, "h265", MediaFormat.MIMETYPE_VIDEO_HEVC),
|
||||||
@SuppressLint("InlinedApi") // introduced in API 29
|
@SuppressLint("InlinedApi") // introduced in API 21
|
||||||
AV1(0x00_61_76_31, "av1", MediaFormat.MIMETYPE_VIDEO_AV1);
|
AV1(0x00_61_76_31, "av1", MediaFormat.MIMETYPE_VIDEO_AV1);
|
||||||
|
|
||||||
private final int id; // 4-byte ASCII representation of the name
|
private final int id; // 4-byte ASCII representation of the name
|
||||||
|
|||||||
Reference in New Issue
Block a user