Compare commits

..

6 Commits
dev ... master

Author SHA1 Message Date
Romain Vimont
cac8e9c821 Happy new year 2025! 2025-01-01 15:01:18 +01:00
Jaime J. Denizard
1c7680f689 Fix some grammatical issues in documentation
PR #5722 <https://github.com/Genymobile/scrcpy/pull/5722>

Signed-off-by: Romain Vimont <rom@rom1v.com>
2025-01-01 14:59:11 +01:00
Markus
5ae01749bf Reintroduce WinGet install note
This semantically reverts c27ab46efbcab0b9558a91e691d799ffef496c97.

WinGet package has been fixed by:
<https://github.com/microsoft/winget-pkgs/pull/196442>

Refs #4027 <https://github.com/Genymobile/scrcpy/issues/4027>
PR #5686 <https://github.com/Genymobile/scrcpy/pull/5686>

Signed-off-by: Romain Vimont <rom@rom1v.com>
2024-12-19 18:34:20 +01:00
Romain Vimont
1fd57ede1f Move "screen off timeout" section in documentation
Place the "screen off timeout" section right after "stay awake", as they
serve a similar purpose.
2024-12-17 13:09:24 +01:00
Romain Vimont
48fc18e380 Add must-know tips
All users should be aware of the main shortcuts and the most important
setting to improve performance.
2024-12-17 12:24:50 +01:00
Romain Vimont
ea6a94d355 Fix mouse documentation formatting
Make the format consistent with the shortcuts documentation.
2024-12-17 12:21:57 +01:00
131 changed files with 328 additions and 344 deletions

View File

@ -74,7 +74,6 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y meson ninja-build nasm ffmpeg libsdl2-2.0-0 \
libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev \
libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev \
@ -84,7 +83,7 @@ jobs:
run: release/test_client.sh
build-linux-x86_64:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Check architecture
run: |
@ -100,7 +99,6 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y meson ninja-build nasm ffmpeg libsdl2-2.0-0 \
libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev \
libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev \
@ -131,12 +129,14 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y meson ninja-build nasm ffmpeg libsdl2-2.0-0 \
libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev \
libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev \
mingw-w64 mingw-w64-tools libz-mingw-w64-dev
- name: Workaround for old meson version run by Github Actions
run: sed -i 's/^pkg-config/pkgconfig/' cross_win32.txt
- name: Build
run: release/build_windows.sh 32
@ -162,12 +162,14 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y meson ninja-build nasm ffmpeg libsdl2-2.0-0 \
libsdl2-dev libavcodec-dev libavdevice-dev libavformat-dev \
libavutil-dev libswresample-dev libusb-1.0-0 libusb-1.0-0-dev \
mingw-w64 mingw-w64-tools libz-mingw-w64-dev
- name: Workaround for old meson version run by Github Actions
run: sed -i 's/^pkg-config/pkgconfig/' cross_win64.txt
- name: Build
run: release/build_windows.sh 64
@ -206,13 +208,6 @@ jobs:
libtool
- name: Build
env:
# the default Xcode (and macOS SDK) version can be found at
# <https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md#xcode>
#
# then the minimal supported deployment target of that macOS SDK can be found at
# <https://developer.apple.com/support/xcode/#minimum-requirements>
MACOSX_DEPLOYMENT_TARGET: 10.13
run: release/build_macos.sh aarch64
# upload-artifact does not preserve permissions
@ -249,13 +244,6 @@ jobs:
# autoconf and libtool are already installed on macos-13
- name: Build
env:
# the default Xcode (and macOS SDK) version can be found at
# <https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode>
#
# then the minimal supported deployment target of that macOS SDK can be found at
# <https://developer.apple.com/support/xcode/#minimum-requirements>
MACOSX_DEPLOYMENT_TARGET: 10.13
run: release/build_macos.sh x86_64
# upload-artifact does not preserve permissions

View File

@ -188,7 +188,7 @@
identification within third-party archives.
Copyright (C) 2018 Genymobile
Copyright (C) 2018-2024 Romain Vimont
Copyright (C) 2018-2025 Romain Vimont
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -78,6 +78,16 @@ Note that USB debugging is not required to run scrcpy in [OTG mode](doc/otg.md).
- [macOS](doc/macos.md)
## Must-know tips
- [Reducing resolution](doc/video.md#size) may greatly improve performance
(`scrcpy -m1024`)
- [_Right-click_](doc/mouse.md#mouse-bindings) triggers `BACK`
- [_Middle-click_](doc/mouse.md#mouse-bindings) triggers `HOME`
- <kbd>Alt</kbd>+<kbd>f</kbd> toggles [fullscreen](doc/window.md#fullscreen)
- There are many other [shortcuts](doc/shortcuts.md)
## Usage examples
There are a lot of options, [documented](#user-documentation) in separate pages.
@ -200,7 +210,7 @@ work][donate]:
## Licence
Copyright (C) 2018 Genymobile
Copyright (C) 2018-2024 Romain Vimont
Copyright (C) 2018-2025 Romain Vimont
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -192,19 +192,19 @@ datadir = get_option('datadir') # by default 'share'
install_man('scrcpy.1')
install_data('data/icon.png',
rename: 'scrcpy.png',
install_dir: datadir / 'icons/hicolor/256x256/apps')
install_dir: join_paths(datadir, 'icons/hicolor/256x256/apps'))
install_data('data/zsh-completion/_scrcpy',
install_dir: datadir / 'zsh/site-functions')
install_dir: join_paths(datadir, 'zsh/site-functions'))
install_data('data/bash-completion/scrcpy',
install_dir: datadir / 'bash-completion/completions')
install_dir: join_paths(datadir, 'bash-completion/completions'))
# Desktop entry file for application launchers
if host_machine.system() == 'linux'
# Install a launcher (ex: /usr/local/share/applications/scrcpy.desktop)
install_data('data/scrcpy.desktop',
install_dir: datadir / 'applications')
install_dir: join_paths(datadir, 'applications'))
install_data('data/scrcpy-console.desktop',
install_dir: datadir / 'applications')
install_dir: join_paths(datadir, 'applications'))
endif
@ -279,9 +279,3 @@ if get_option('buildtype') == 'debug'
test(t[0], exe)
endforeach
endif
if meson.version().version_compare('>= 0.58.0')
devenv = environment()
devenv.set('SCRCPY_ICON_PATH', meson.current_source_dir() / 'data/icon.png')
meson.add_devenv(devenv)
endif

View File

@ -829,7 +829,7 @@ Report bugs to <https://github.com/Genymobile/scrcpy/issues>.
.SH COPYRIGHT
Copyright \(co 2018 Genymobile <https://www.genymobile.com>
Copyright \(co 2018\-2024 Romain Vimont <rom@rom1v.com>
Copyright \(co 2018\-2025 Romain Vimont <rom@rom1v.com>
Licensed under the Apache License, Version 2.0.

View File

@ -4,10 +4,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "adb/adb_device.h"
#include "adb/adb_parser.h"
#include "adb_device.h"
#include "adb_parser.h"
#include "util/env.h"
#include "util/file.h"
#include "util/log.h"

View File

@ -6,7 +6,7 @@
#include <stdbool.h>
#include <inttypes.h>
#include "adb/adb_device.h"
#include "adb_device.h"
#include "util/intr.h"
#define SC_ADB_NO_STDOUT (1 << 0)

View File

@ -4,6 +4,7 @@
#include "common.h"
#include <stdbool.h>
#include <stddef.h>
#include "util/vector.h"

View File

@ -3,7 +3,6 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "util/log.h"
#include "util/str.h"

View File

@ -3,9 +3,9 @@
#include "common.h"
#include <stdbool.h>
#include <stddef.h>
#include "adb/adb_device.h"
#include "adb_device.h"
/**
* Parse the available devices from the output of `adb devices`

View File

@ -1,11 +1,11 @@
#include "adb_tunnel.h"
#include <assert.h>
#include <inttypes.h>
#include "adb/adb.h"
#include "adb.h"
#include "util/log.h"
#include "util/net_intr.h"
#include "util/process_intr.h"
static bool
listen_on_port(struct sc_intr *intr, sc_socket socket, uint16_t port) {

View File

@ -3,7 +3,9 @@
#include "common.h"
#include <SDL2/SDL_audio.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <SDL2/SDL.h>
#include "audio_regulator.h"
#include "trait/frame_sink.h"

View File

@ -1,9 +1,5 @@
#include "audio_regulator.h"
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <libavcodec/avcodec.h>
#include <libavutil/opt.h>

View File

@ -5,8 +5,6 @@
#include <stdatomic.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <libavcodec/avcodec.h>
#include <libswresample/swresample.h>
#include "util/audiobuf.h"

View File

@ -5,7 +5,6 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "options.h"
@ -14,7 +13,6 @@
#include "util/str.h"
#include "util/strbuf.h"
#include "util/term.h"
#include "util/tick.h"
#define STR_IMPL_(x) #x
#define STR(x) STR_IMPL_(x)

View File

@ -1,9 +1,11 @@
#include "decoder.h"
#include <errno.h>
#include <libavcodec/packet.h>
#include <libavutil/avutil.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/channel_layout.h>
#include "events.h"
#include "trait/frame_sink.h"
#include "util/log.h"
/** Downcast packet_sink to decoder */

View File

@ -3,11 +3,13 @@
#include "common.h"
#include <libavcodec/avcodec.h>
#include "trait/frame_source.h"
#include "trait/packet_sink.h"
#include <stdbool.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
struct sc_decoder {
struct sc_packet_sink packet_sink; // packet sink trait
struct sc_frame_source frame_source; // frame source trait

View File

@ -2,7 +2,9 @@
#include <assert.h>
#include <stdlib.h>
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
#include <libavformat/avformat.h>
#include "util/log.h"

View File

@ -4,7 +4,6 @@
#include "common.h"
#include <stdbool.h>
#include <libavutil/frame.h>
#include "clock.h"
#include "trait/frame_source.h"

View File

@ -1,11 +1,14 @@
#include "demuxer.h"
#include <assert.h>
#include <inttypes.h>
#include <libavcodec/avcodec.h>
#include <libavutil/channel_layout.h>
#include <libavutil/time.h>
#include <unistd.h>
#include "decoder.h"
#include "events.h"
#include "packet_merger.h"
#include "recorder.h"
#include "util/binary.h"
#include "util/log.h"

View File

@ -4,8 +4,12 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include "trait/packet_source.h"
#include "trait/packet_sink.h"
#include "util/net.h"
#include "util/thread.h"

View File

@ -3,9 +3,9 @@
#include "common.h"
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <unistd.h>
#define DEVICE_MSG_MAX_SIZE (1 << 18) // 256k
// type: 1 byte; length: 4 bytes

View File

@ -1,8 +1,6 @@
#include "display.h"
#include <assert.h>
#include <inttypes.h>
#include <string.h>
#include <libavutil/pixfmt.h>
#include "util/log.h"

View File

@ -4,8 +4,7 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <libavutil/frame.h>
#include <libavformat/avformat.h>
#include <SDL2/SDL.h>
#include "coords.h"

View File

@ -1,7 +1,5 @@
#include "events.h"
#include <assert.h>
#include "util/log.h"
#include "util/thread.h"

View File

@ -1,11 +1,11 @@
#include "file_pusher.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "adb/adb.h"
#include "util/log.h"
#include "util/process_intr.h"
#define DEFAULT_PUSH_TARGET "/sdcard/Download/"

View File

@ -1,7 +1,6 @@
#include "fps_counter.h"
#include <assert.h>
#include <stdint.h>
#include "util/log.h"

View File

@ -5,9 +5,9 @@
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#include "util/thread.h"
#include "util/tick.h"
struct sc_fps_counter {
sc_thread thread;

View File

@ -1,6 +1,8 @@
#include "frame_buffer.h"
#include <assert.h>
#include <libavutil/avutil.h>
#include <libavformat/avformat.h>
#include "util/log.h"

View File

@ -4,7 +4,6 @@
#include "common.h"
#include <stdbool.h>
#include <libavutil/frame.h>
#include "util/thread.h"

View File

@ -3,7 +3,6 @@
#include "common.h"
#include <stddef.h>
#include <stdint.h>
#define SC_HID_MAX_SIZE 15

View File

@ -2,8 +2,6 @@
#include <assert.h>
#include <inttypes.h>
#include <stddef.h>
#include <sys/types.h>
#include "util/binary.h"
#include "util/log.h"

View File

@ -4,7 +4,6 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include "hid/hid_event.h"
#include "input_events.h"

View File

@ -1,6 +1,5 @@
#include "hid_keyboard.h"
#include <assert.h>
#include <string.h>
#include "util/log.h"

View File

@ -4,7 +4,6 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include "hid/hid_event.h"
#include "input_events.h"

View File

@ -1,7 +1,5 @@
#include "hid_mouse.h"
#include <stdint.h>
// 1 byte for buttons + padding, 1 byte for X position, 1 byte for Y position,
// 1 byte for wheel motion
#define SC_HID_MOUSE_INPUT_SIZE 4

View File

@ -3,6 +3,8 @@
#include "common.h"
#include <stdbool.h>
#include "hid/hid_event.h"
#include "input_events.h"

View File

@ -2,22 +2,17 @@
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>
#include <libavutil/pixdesc.h>
#include <libavutil/pixfmt.h>
#include <SDL2/SDL.h>
#include "config.h"
#include "compat.h"
#include "util/env.h"
#ifdef PORTABLE
# include "util/file.h"
#endif
#include "util/file.h"
#include "util/log.h"
#include "util/str.h"
#define SCRCPY_PORTABLE_ICON_FILENAME "icon.png"
#define SCRCPY_DEFAULT_ICON_PATH \

View File

@ -3,7 +3,9 @@
#include "common.h"
#include <SDL2/SDL_surface.h>
#include <stdbool.h>
#include <SDL2/SDL.h>
#include <libavformat/avformat.h>
SDL_Surface *
scrcpy_icon_load(void);

View File

@ -9,6 +9,7 @@
#include <SDL2/SDL_events.h>
#include "coords.h"
#include "options.h"
/* The representation of input events in scrcpy is very close to the SDL API,
* for simplicity.

View File

@ -1,12 +1,8 @@
#include "input_manager.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_keycode.h>
#include "android/input.h"
#include "android/keycodes.h"
#include "input_events.h"
#include "screen.h"
#include "shortcut_mod.h"

View File

@ -4,12 +4,12 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <SDL2/SDL_events.h>
#include <SDL2/SDL_keycode.h>
#include <SDL2/SDL.h>
#include "controller.h"
#include "file_pusher.h"
#include "fps_counter.h"
#include "options.h"
#include "trait/gamepad_processor.h"
#include "trait/key_processor.h"

View File

@ -1,13 +1,8 @@
#include "keyboard_sdk.h"
#include <assert.h>
#include <ctype.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "android/input.h"
#include "android/keycodes.h"
#include "control_msg.h"
#include "controller.h"
#include "input_events.h"

View File

@ -1,6 +1,9 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include <unistd.h>
#include <libavformat/avformat.h>
#ifdef HAVE_V4L2
# include <libavdevice/avdevice.h>
#endif

View File

@ -1,12 +1,12 @@
#include "mouse_sdk.h"
#include <assert.h>
#include <stdint.h>
#include "android/input.h"
#include "control_msg.h"
#include "controller.h"
#include "input_events.h"
#include "util/intmap.h"
#include "util/log.h"
/** Downcast mouse processor to sc_mouse_sdk */

View File

@ -6,6 +6,7 @@
#include <stdbool.h>
#include "controller.h"
#include "screen.h"
#include "trait/mouse_processor.h"
struct sc_mouse_sdk {

View File

@ -2,8 +2,7 @@
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <SDL2/SDL.h>
#include "SDL2/SDL.h"
void
sc_opengl_init(struct sc_opengl *gl) {

View File

@ -1,7 +1,5 @@
#include "options.h"
#include <stddef.h>
const struct scrcpy_options scrcpy_options_default = {
.serial = NULL,
.crop = NULL,

View File

@ -5,6 +5,7 @@
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "util/tick.h"

View File

@ -1,9 +1,5 @@
#include "packet_merger.h"
#include <stdlib.h>
#include <string.h>
#include <libavutil/avutil.h>
#include "util/log.h"
void

View File

@ -5,7 +5,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <libavcodec/packet.h>
#include <libavcodec/avcodec.h>
/**
* Config packets (containing the SPS/PPS) are sent in-band. A new config

View File

@ -2,6 +2,7 @@
#include <assert.h>
#include <inttypes.h>
#include <stdint.h>
#include <SDL2/SDL_clipboard.h>
#include "device_msg.h"

View File

@ -1,9 +1,6 @@
#include "recorder.h"
#include <assert.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/time.h>

View File

@ -4,10 +4,9 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <libavcodec/packet.h>
#include <libavformat/avformat.h>
#include "coords.h"
#include "options.h"
#include "trait/packet_sink.h"
#include "util/thread.h"

View File

@ -1,11 +1,10 @@
#include "scrcpy.h"
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <libavformat/avformat.h>
#include <sys/time.h>
#include <SDL2/SDL.h>
#ifdef _WIN32
@ -38,9 +37,9 @@
#endif
#include "util/acksync.h"
#include "util/log.h"
#include "util/net.h"
#include "util/rand.h"
#include "util/timeout.h"
#include "util/tick.h"
#ifdef HAVE_V4L2
# include "v4l2_sink.h"
#endif

View File

@ -3,6 +3,7 @@
#include "common.h"
#include <stdbool.h>
#include "options.h"
enum scrcpy_exit_code {

View File

@ -1,14 +1,11 @@
#ifndef SC_SCREEN_H
#define SC_SCREEN_H
#ifndef SCREEN_H
#define SCREEN_H
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <SDL2/SDL.h>
#include <libavcodec/avcodec.h>
#include <libavutil/frame.h>
#include <libavutil/pixfmt.h>
#include <libavformat/avformat.h>
#include "controller.h"
#include "coords.h"
@ -17,6 +14,7 @@
#include "frame_buffer.h"
#include "input_manager.h"
#include "mouse_capture.h"
#include "opengl.h"
#include "options.h"
#include "trait/key_processor.h"
#include "trait/frame_sink.h"

View File

@ -1,18 +1,19 @@
#include "server.h"
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <SDL2/SDL_timer.h>
#include <SDL2/SDL_platform.h>
#include "adb/adb.h"
#include "util/binary.h"
#include "util/env.h"
#include "util/file.h"
#include "util/log.h"
#include "util/net_intr.h"
#include "util/process.h"
#include "util/process_intr.h"
#include "util/str.h"
#define SC_SERVER_FILENAME "scrcpy-server"

View File

@ -1,17 +1,19 @@
#ifndef SC_SERVER_H
#define SC_SERVER_H
#ifndef SERVER_H
#define SERVER_H
#include "common.h"
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#include "adb/adb_tunnel.h"
#include "coords.h"
#include "options.h"
#include "util/intr.h"
#include "util/log.h"
#include "util/net.h"
#include "util/thread.h"
#include "util/tick.h"
#define SC_DEVICE_NAME_FIELD_LENGTH 64
struct sc_server_info {

View File

@ -3,7 +3,6 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <SDL2/SDL_keycode.h>

View File

@ -1,11 +1,10 @@
#include "util/file.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef __APPLE__
# include <mach-o/dyld.h> // for _NSGetExecutablePath()

View File

@ -4,8 +4,6 @@
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

View File

@ -3,6 +3,7 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include <libavcodec/avcodec.h>

View File

@ -1,7 +1,5 @@
#include "frame_source.h"
#include <assert.h>
void
sc_frame_source_init(struct sc_frame_source *source) {
source->sink_count = 0;

View File

@ -3,9 +3,7 @@
#include "common.h"
#include <stdbool.h>
#include "trait/frame_sink.h"
#include "frame_sink.h"
#define SC_FRAME_SOURCE_MAX_SINKS 2

View File

@ -3,6 +3,9 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include "input_events.h"
/**

View File

@ -3,6 +3,7 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include "input_events.h"

View File

@ -3,6 +3,7 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include "input_events.h"

View File

@ -3,6 +3,7 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include <libavcodec/avcodec.h>

View File

@ -1,7 +1,5 @@
#include "packet_source.h"
#include <assert.h>
void
sc_packet_source_init(struct sc_packet_source *source) {
source->sink_count = 0;

View File

@ -3,9 +3,7 @@
#include "common.h"
#include <stdbool.h>
#include "trait/packet_sink.h"
#include "packet_sink.h"
#define SC_PACKET_SOURCE_MAX_SINKS 2

View File

@ -1,10 +1,5 @@
#include "gamepad_uhid.h"
#include <assert.h>
#include <inttypes.h>
#include <string.h>
#include <SDL2/SDL_gamecontroller.h>
#include "hid/hid_gamepad.h"
#include "input_events.h"
#include "util/log.h"

View File

@ -3,6 +3,8 @@
#include "common.h"
#include <stdbool.h>
#include "controller.h"
#include "hid/hid_gamepad.h"
#include "trait/gamepad_processor.h"

View File

@ -1,12 +1,6 @@
#include "keyboard_uhid.h"
#include <assert.h>
#include <string.h>
#include <SDL2/SDL_keyboard.h>
#include <SDL2/SDL_keycode.h>
#include "util/log.h"
#include "util/thread.h"
/** Downcast key processor to keyboard_uhid */
#define DOWNCAST(KP) container_of(KP, struct sc_keyboard_uhid, key_processor)

View File

@ -1,8 +1,5 @@
#include "mouse_uhid.h"
#include <assert.h>
#include <string.h>
#include "hid/hid_mouse.h"
#include "input_events.h"
#include "util/log.h"

View File

@ -1,5 +1,6 @@
#include "uhid_output.h"
#include <assert.h>
#include <inttypes.h>
#include "uhid/keyboard_uhid.h"

View File

@ -3,7 +3,7 @@
#include "common.h"
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
/**

View File

@ -1,16 +1,13 @@
#include "aoa_hid.h"
#include "util/log.h"
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <libusb-1.0/libusb.h>
#include "aoa_hid.h"
#include "events.h"
#include "util/log.h"
#include "util/str.h"
#include "util/tick.h"
#include "util/vector.h"
// See <https://source.android.com/devices/accessories/aoa2#hid-support>.

View File

@ -3,13 +3,16 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdbool.h>
#include <libusb-1.0/libusb.h>
#include "hid/hid_event.h"
#include "usb/usb.h"
#include "usb.h"
#include "util/acksync.h"
#include "util/thread.h"
#include "util/tick.h"
#include "util/vecdeque.h"
enum sc_aoa_event_type {

View File

@ -1,7 +1,5 @@
#include "gamepad_aoa.h"
#include <stdbool.h>
#include "input_events.h"
#include "util/log.h"

View File

@ -3,8 +3,10 @@
#include "common.h"
#include <stdbool.h>
#include "aoa_hid.h"
#include "hid/hid_gamepad.h"
#include "usb/aoa_hid.h"
#include "trait/gamepad_processor.h"
struct sc_gamepad_aoa {

View File

@ -5,8 +5,8 @@
#include <stdbool.h>
#include "aoa_hid.h"
#include "hid/hid_keyboard.h"
#include "usb/aoa_hid.h"
#include "trait/key_processor.h"
struct sc_keyboard_aoa {

View File

@ -1,7 +1,6 @@
#include "mouse_aoa.h"
#include <assert.h>
#include <stddef.h>
#include "hid/hid_mouse.h"
#include "input_events.h"

View File

@ -5,7 +5,7 @@
#include <stdbool.h>
#include "usb/aoa_hid.h"
#include "aoa_hid.h"
#include "trait/mouse_processor.h"
struct sc_mouse_aoa {

View File

@ -1,19 +1,10 @@
#include "scrcpy_otg.h"
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#ifdef _WIN32
# include "adb/adb.h"
#endif
#include "adb/adb.h"
#include "events.h"
#include "usb/screen_otg.h"
#include "usb/aoa_hid.h"
#include "usb/gamepad_aoa.h"
#include "usb/keyboard_aoa.h"
#include "usb/mouse_aoa.h"
#include "screen_otg.h"
#include "util/log.h"
struct scrcpy_otg {

View File

@ -1,11 +1,7 @@
#include "screen_otg.h"
#include <assert.h>
#include <stddef.h>
#include "icon.h"
#include "options.h"
#include "util/acksync.h"
#include "util/log.h"
static void

View File

@ -4,13 +4,12 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include <SDL2/SDL.h>
#include "keyboard_aoa.h"
#include "mouse_aoa.h"
#include "mouse_capture.h"
#include "usb/gamepad_aoa.h"
#include "usb/keyboard_aoa.h"
#include "usb/mouse_aoa.h"
#include "gamepad_aoa.h"
struct sc_screen_otg {
struct sc_keyboard_aoa *keyboard;

View File

@ -1,6 +1,7 @@
#include "acksync.h"
#include <assert.h>
#include "util/log.h"
bool
sc_acksync_init(struct sc_acksync *as) {

View File

@ -3,10 +3,7 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
#include "util/thread.h"
#include "util/tick.h"
#include "thread.h"
#define SC_SEQUENCE_INVALID 0

View File

@ -6,7 +6,6 @@
#include <assert.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
/**

View File

@ -3,6 +3,9 @@
#include "common.h"
#include <stdbool.h>
#include <stdint.h>
struct sc_average {
// Current average value
float avg;

View File

@ -4,6 +4,7 @@
#include "common.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
static inline void

View File

@ -2,9 +2,7 @@
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
# include "util/str.h"
#endif
#include "util/str.h"
char *
sc_get_env(const char *varname) {

View File

@ -3,7 +3,6 @@
#include "common.h"
#include <stddef.h>
#include <stdint.h>
struct sc_intmap_entry {

View File

@ -1,9 +1,9 @@
#include "intr.h"
#include <assert.h>
#include "util/log.h"
#include <assert.h>
bool
sc_intr_init(struct sc_intr *intr) {
bool ok = sc_mutex_init(&intr->mutex);

View File

@ -6,9 +6,9 @@
#include <stdatomic.h>
#include <stdbool.h>
#include "util/net.h"
#include "util/process.h"
#include "util/thread.h"
#include "net.h"
#include "process.h"
#include "thread.h"
/**
* Interruptor to wake up a blocking call from another thread

View File

@ -4,10 +4,7 @@
# include <windows.h>
#endif
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <libavutil/log.h>
#include <libavformat/avformat.h>
static SDL_LogPriority
log_level_sc_to_sdl(enum sc_log_level level) {

View File

@ -1,27 +1,28 @@
#include "net.h"
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#include "log.h"
#ifdef _WIN32
# include <ws2tcpip.h>
typedef int socklen_t;
#else
# include <arpa/inet.h>
# include <fcntl.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
# include <arpa/inet.h>
# include <unistd.h>
# include <sys/socket.h>
# include <sys/types.h>
# include <fcntl.h>
# define SOCKET_ERROR -1
typedef struct sockaddr_in SOCKADDR_IN;
typedef struct sockaddr SOCKADDR;
typedef struct in_addr IN_ADDR;
#endif
#include "util/log.h"
bool
net_init(void) {
#ifdef _WIN32

View File

@ -4,15 +4,14 @@
#include "common.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#ifdef _WIN32
# include <winsock2.h>
typedef SOCKET sc_raw_socket;
# define SC_RAW_SOCKET_NONE INVALID_SOCKET
#else // not _WIN32
# include <sys/socket.h>
typedef int sc_raw_socket;
# define SC_RAW_SOCKET_NONE -1
#endif

View File

@ -3,13 +3,8 @@
#include "common.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include "util/intr.h"
#include "util/net.h"
#include "intr.h"
#include "net.h"
bool
net_connect_intr(struct sc_intr *intr, sc_socket socket, uint32_t addr,

Some files were not shown because too many files have changed in this diff Show More