Commit graph

996 commits

Author SHA1 Message Date
Romain Vimont
9160d465ec Add feature test macro to declare kill()
Avoid the following warning on some systems:

> warning: implicit declaration of function 'kill'
> [-Wimplicit-function-declaration]
2018-11-10 16:16:08 +01:00
Romain Vimont
5c739874a4 Fix memory leak on error
On decode error, unref the packet.
2018-11-09 16:10:44 +01:00
Romain Vimont
d061c30965 Replace Ctrl by Meta for volume shortcuts on MacOS
Ctrl+UP and Ctrl+DOWN are already used by the window manager on MacOS.

Use Cmd key instead (like on VLC).
2018-11-01 16:19:07 +01:00
Romain Vimont
5bf1261364 Refactor to support Meta in shortcuts
Move the Ctrl and Meta key down checks to each shortcut individually, so
that we can add a shortcut involving Meta.
2018-11-01 16:19:07 +01:00
Romain Vimont
facbbced9e
Merge pull request #310 from npes87184/master
fix text memory leak
2018-10-27 14:49:00 +02:00
yuchenlin
96056e3213 input_manager: fix potential memory leak on text
Fix potential memory leak when controller_push_event failed.

Signed-off-by: yuchenlin <npes87184@gmail.com>
2018-10-27 20:07:22 +08:00
Romain Vimont
0b92b93358 Capture Alt and Meta keys
Alt and Meta keys should not be forwarded to the device. For now, they
are not used for shortcuts, but they could be.
2018-10-24 19:08:36 +02:00
Romain Vimont
c20245630e Factorize Windows command building
Extract command line building to a separate method.
2018-10-21 18:57:06 +02:00
Romain Vimont
b882322f73 Work around Os.write() not updating position
ByteBuffer position is not updated as expected by Os.write() on old
Android versions. Count the remaining bytes manually.

Fixes <https://github.com/Genymobile/scrcpy/issues/291>.
2018-10-09 08:43:17 +02:00
Romain Vimont
8875955921 Support paths containing spaces on Windows
Quote the arguments of "adb push" to support paths which contain spaces
on Windows.

Fixes <https://github.com/Genymobile/scrcpy/issues/288>.
2018-10-04 21:01:23 +02:00
Romain Vimont
ff4430b2a3 Declare fun(void) functions with no parameters
This is not C++.
2018-10-04 17:04:20 +02:00
Romain Vimont
cea176c210 Update links to v1.4 in README and BUILD 2018-10-04 00:13:28 +02:00
Romain Vimont
f613752606 Update platform-tools (28.0.1) for Windows
Include the latest version of adb in Windows releases.
2018-10-03 23:18:37 +02:00
Romain Vimont
24d107d017 Bump version to 1.4 2018-10-03 23:03:27 +02:00
Romain Vimont
66d1f81f56 Merge branch 'master' into dev 2018-10-03 23:02:09 +02:00
Romain Vimont
411aa4fcfd Handle alpha and space chars as raw events
To handle special chars, text is handled as text input instead of key
events. However, this breaks the separation of DOWN and UP key events.

As a compromise, send letters and space as key events, to preserve
original DOWN/UP events, but send other text input events as text, to be
able to send "special" characters.

Fixes <https://github.com/Genymobile/scrcpy/issues/87>.

Suggested-by: pete1414
Suggested-by: King-Slide <kingslide@gmail.com>
2018-10-03 22:07:09 +02:00
Romain Vimont
78d5a4d8a1 Add link to Gentoo Ebuild in README 2018-09-19 22:09:52 +02:00
Romain Vimont
52e2c60190
Merge pull request #261 from npes87184/dev
prevent closing console right after process error in windows
2018-09-18 08:56:40 +02:00
yuchenlin
140b1ef6a5 prevent closing console right after process error in windows
Signed-off-by: yuchenlin <npes87184@gmail.com>
2018-09-14 20:34:59 +08:00
Romain Vimont
eca99d5af7 Fix header guard name 2018-09-13 16:27:19 +02:00
Romain Vimont
6a1fb070f7 Merge branch 'npes87184:dev' into dev (#254)
Return specific error for missing adb binary on Windows
2018-09-09 15:28:56 +02:00
yuchenlin
27bed948d4 Use specific error for missing binary on Windows
Signed-off-by: yuchenlin <npes87184@gmail.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
2018-09-09 15:28:25 +02:00
Romain Vimont
66def38b73 Avoid additional buffer copy in userspace
Directly send the data from MediaCodec buffers to the LocalSocket,
without an intermediate copy in userspace.
2018-09-09 15:05:06 +02:00
Romain Vimont
a60aef5aaf Merge branch 'philippsandhaus:master' into dev (#252)
Added new command line parameter to start in fullscreen
2018-09-04 18:51:56 +02:00
Romain Vimont
28015c3ee4 Present fullscreen option in README 2018-09-04 18:51:35 +02:00
Philipp Sandhaus
af9808cf02 Add option to start in fullscreen
Signed-off-by: Romain Vimont <rom@rom1v.com>
2018-09-04 18:51:32 +02:00
Romain Vimont
34550311be Merge branch 'npes87184:dev' into dev (#236)
check adb runnable before starting scrcpy
2018-09-04 18:43:17 +02:00
Romain Vimont
55d33ddd5f Do not handle system-specific values in command.c
The common command.c handled process errors from system-specific int
values (errno).

Rather, expose a new enum process_result to handle error cause in a
generic way.
2018-09-04 08:57:07 +02:00
yuchenlin
6d2d803003 Notify adb missing
There are many user who encounters missing adb.
To stop things happens again, we check it and show
sexy response to user.

Signed-off-by: yuchenlin <npes87184@gmail.com>
2018-09-04 08:46:17 +02:00
Romain Vimont
fdbb725436 Add link to FLAG_SECURE in FAQ 2018-08-20 15:00:01 +02:00
Romain Vimont
ce6e5d1969 Explain how to install adb on Mac OS
The package scrcpy from Homebrew does not install adb.
2018-08-17 19:51:25 +02:00
Romain Vimont
963890e9c2 Separate build instructions from README
README included build instructions, which made it complicated to follow.
Move the build instructions to a separate file (BUILD.md).
2018-08-17 17:57:08 +02:00
Romain Vimont
3b5e54278e Update FFmpeg (4.0.2) for Windows
Include the last version of FFmpeg in Windows releases.
2018-08-15 19:30:02 +02:00
Romain Vimont
dd3ba685e4 Update platform-tools (28.0.0) for Windows
Include the last version of adb in Windows releases.

Fixes <https://github.com/Genymobile/scrcpy/issues/224>.
2018-08-15 19:30:02 +02:00
Romain Vimont
89e0203682 Add missing include for lock_util.h
lock_util.c did not include lock_util.h. This was catched by the gcc
option -Wmissing-prototypes.
2018-08-15 19:30:02 +02:00
Romain Vimont
536b31829a Separate multi-words filenames by '_'
Rename foobar.ext to foo_bar.ext.

<https://github.com/Genymobile/scrcpy/pull/226#discussion_r209454865>
2018-08-15 19:30:01 +02:00
Romain Vimont
f3f704d1ed Document "push file" feature
Document how to push a file to /sdcard/ in the shortcuts list.
2018-08-15 17:19:32 +02:00
Romain Vimont
6581f9feb9 Make request_queue functions static
These functions are local to file_handler.c.
2018-08-15 17:19:32 +02:00
Romain Vimont
359685b1db Simplify SDL_assert() calls
SDL_assert() already prevents "unused variable" warnings.
2018-08-15 17:19:32 +02:00
Romain Vimont
4527be4cde Add missing include config.h
When config.h is not included, BUILD_DEBUG is not set.
2018-08-15 17:19:32 +02:00
Romain Vimont
92d1aff85f Merge branch 'npes87184:push_file_to_sdcard' into dev (#226)
support drag & drop file to device /sdcard
2018-08-15 17:18:15 +02:00
npes87184
66f45f9dae Support drag&drop a file to transfer it to device
Signed-off-by: npes87184 <npes87184@gmail.com>
2018-08-15 17:12:10 +02:00
npes87184
aa97eed24b installer -> file_handler
Signed-off-by: npes87184 <npes87184@gmail.com>
2018-08-15 17:11:41 +02:00
Romain Vimont
2daeb1fd5f Reset current installer process
The current_process field was never reset after an installation is
complete. As a consequence, installer_stop() attempted to terminate it,
leading to a warning, at best.
2018-08-15 17:10:07 +02:00
Grief
cde0b3d248 Return non-zero value on connection loss
Make scrscpy to return 0 exit code only in case when the user closes its
app, otherwise, i.e. in case of connection loss, return 1.
2018-08-15 14:20:45 +02:00
Romain Vimont
6fa209fa82 Remove AINPUT_SOURCE_ANY value
In the Android input header file, an enum has a value taking more than
31 bits, leading to the following warning:

    ISO C restricts enumerator values to range of ‘int’

Since we don't use it, remove it.
2018-08-12 15:35:29 +02:00
Romain Vimont
b37c0f6cd6 Replace Uint32 by int to fix warnings in tinyxpm 2018-08-12 15:35:25 +02:00
Romain Vimont
c4a1fc746b Explicitly use ISO C11
ISO C99 doesn't support unnamed structs/unions.
2018-08-12 15:21:30 +02:00
npes87184
a3ab92226d Destroy mutex if strdup failed
Signed-off-by: npes87184 <npes87184@gmail.com>
2018-08-12 14:57:36 +02:00
Romain Vimont
ec66b3be82
Merge pull request #225 from npes87184/master
remove redundant semicolon
2018-08-12 14:56:13 +02:00