- 10 8月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
Add an option to crop the screen on the server. This allows to mirror only part of the device screen.
-
- 29 5月, 2018 2 次提交
-
-
-
由 Romain Vimont 提交于
In practice, proc_show_touches may not be used uninitialized, since it checks the flag options->show_touches, but the compiler can't know that, so initialize it to avoid the warning.
-
- 25 3月, 2018 4 次提交
-
-
由 Romain Vimont 提交于
Enabling "show touches" involves the execution of an adb command, which takes some time. In order to parallelize, execute the command as soon as possible, but reap the process only once everything is initialized.
-
由 Romain Vimont 提交于
If --show-touches is set, then the option must be disabled on quit. Since it executes an adb command, it takes some time, so close the window beforehand so that the close window button does not seem unresponsive.
-
由 Romain Vimont 提交于
Add -t/--show-touches option to show physical touches while scrcpy is running. See <https://github.com/Genymobile/scrcpy/issues/96>.
-
由 Romain Vimont 提交于
The scrcpy() function accepts as many parameters as there are options. To simplify, group all options in a separate struct.
-
- 22 3月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
Request SDL not to replace the SIGINT and SIGTERM handlers, so that the process is immediately terminated on Ctrl+C. This avoids process hanging on Ctrl+C during network calls on initialization. Some of them accepted a timeout, but it was not used since commit 9b056f50 anymore.
-
- 15 3月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
For readability and consistency, indent case statatements, and remove unnecessary additional blocks.
-
- 14 3月, 2018 2 次提交
-
-
由 Romain Vimont 提交于
Do not pass any data to the event watcher, it is unused.
-
由 Romain Vimont 提交于
On Windows and MacOS, resizing blocks the event loop, so resizing events are not triggered: - <https://bugzilla.libsdl.org/show_bug.cgi?id=2077> - <https://stackoverflow.com/a/40693139/1987178> As a workaround, register an event watcher to render the screen from another thread. Since the whole event loop is blocked during resizing, the screen content is not refreshed (on Windows and MacOS) until resizing ends.
-
- 12 3月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
The serial is needed for many server actions, but this is an implementation detail, so the caller should not have to provide it on every call. Instead, store the serial in the server instance on server_start(). This paves the way to implement the "adb forward" fallback properly.
-
- 16 2月, 2018 2 次提交
-
-
由 Romain Vimont 提交于
Call shutdown() on the device socket to make the device process finish its execution quickly and gracefully, without killing it.
-
由 Romain Vimont 提交于
SDL_net is not very suitable for scrcpy. For example, SDLNet_TCP_Accept() is non-blocking, so we have to wrap it by calling many SDL_Net-specific functions to make it blocking. But above all, SDLNet_TCP_Open() is a server socket only when no IP is provided; otherwise, it's a client socket. Therefore, it is not possible to create a server socket bound to localhost, so it accepts connections from anywhere. This is a problem for scrcpy, because on start, the application listens for nearly 1 second until it accepts the first connection, supposedly from the device. If someone on the local network manages to connect to the server socket first, then they can stream arbitrary H.264 video. This may be troublesome, for example during a public presentation ;-) Provide our own simplified API (net.h) instead, implemented for the different platforms.
-
- 15 2月, 2018 3 次提交
-
-
由 Romain Vimont 提交于
Disable FPS counter on start, and use Ctrl+i to enable/disable it.
-
由 Romain Vimont 提交于
The "screen control" handled user input, which happened to be only used to control the screen. The controller and screen were passed to every function. Instead, group them in a struct input_manager. The purpose is to add a new shortcut to enable/disable FPS counter. This feature is not related to "screen control", and will require access to the "frames" instance.
-
由 Romain Vimont 提交于
Remove frame counter from scrcpy.c and add a new FPS counter, logging as INFO the measured frame rate every second (on new frame).
-
- 13 2月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
Use macros to wrap SDL_Log* functions with the "application" category.
-
- 09 2月, 2018 12 次提交
-
-
由 Romain Vimont 提交于
Wait no more than 2 seconds for accepting the connection from the device, since it blocks the event loop, preventing to react to SIGTERM (Ctrl+C).
-
由 Romain Vimont 提交于
On startup, the client has to: 1. listen on a port 2. push and start the server to the device 3. wait for the server to connect (accept) 4. read device name and size 5. initialize SDL 6. initialize the window and renderer 7. show the window From the execution of the app_process command to start the server on the device, to the execution of the java main method, it takes ~800ms. As a consequence, step 3 also takes ~800ms on the client. Once complete, the client initializes SDL, which takes ~500ms. These two expensive actions are executed sequentially: HOST DEVICE listen on port | | push/start the server |----------------->|| app_process loads the jar accept the connection . ^ || . | || . | WASTE || . | OF || . | TIME || . | || . | || . v X execution of our java main connection accepted |<-----------------| connect to the host init SDL || | || ,----------------| send frames || |,---------------| || ||,--------------| || |||,-------------| || ||||,------------| init window/renderer | |||||,-----------| display frames |<++++++-----------| (many frames skipped) The rationale for step 3 occuring before step 5 is that initializing SDL replaces the SIGTERM handler to receive the event in the event loop, so pressing Ctrl+C during step 5 would not work (since it blocks the event loop). But this is not so important; let's parallelize the SDL initialization with the app_process execution (we'll just add a timeout to the connection): HOST DEVICE listen on port | | push/start the server |----------------->||app_process loads the jar init SDL || || || || || || || || || || || || accept the connection . || . X execution of our java main connection accepted |<-----------------| connect to the host init window/renderer | | display frames |<-----------------| send frames |<-----------------| In addition, show the window only once the first frame is available to avoid flickering (opening a black window for 100~200ms). Note: the window and renderer are initialized after the connection is accepted because they use the device information received from the device.
-
由 Romain Vimont 提交于
Expose an initializer so that the caller does not have to guess what fields must be initialized.
-
由 Romain Vimont 提交于
SDLNet_TCP_Close() not only closes, but also release the resources. Therefore, we must not close the socket if another thread attempts to read it. For that purpose, move socket closing from server_stop() to server_destroy().
-
由 Romain Vimont 提交于
Replace screen_update() by a higher-level screen_update_frame() handling the whole frame updating, so that scrcpy.c just call it without managing implementation details.
-
由 Romain Vimont 提交于
On exit, the renderer will not consume frames anymore, so signal the condition variable to wake up the decoder.
-
由 Romain Vimont 提交于
Expose frames_offer_decoded_frame() and frames_consume_rendered_frame() so that callers are not exposed to frame swapping (between the decoding and rendering frames) details.
-
由 Romain Vimont 提交于
The mutex was not unlocked on all code paths.
-
由 Romain Vimont 提交于
Move the code handling user input from scrcpy.c to a separate file, screencontrol.c.
-
由 Romain Vimont 提交于
As soon as we accepted a connection, we can remove the "adb reverse" tunnel.
-
由 Romain Vimont 提交于
Move the code to read the initial device info from scrcpy.c to a separate file, device.c.
-
由 Romain Vimont 提交于
The file server.c already existed, but exposed a low-level API. Make it higher-level, so that scrcpy.c does not handle server details directly.
-
- 08 2月, 2018 3 次提交
-
-
由 Romain Vimont 提交于
The file scrcpy.c contains too many different things in addition to the main logic, so move the screen code to a separate file, screen.c.
-
由 Romain Vimont 提交于
The struct decoder is defined in decoder.h. For naming consistency, define the struct controller in controller.h.
-
由 Romain Vimont 提交于
Some functions in scrcpy.c are not used outside the file, so declare them static.
-
- 07 2月, 2018 3 次提交
-
-
由 Romain Vimont 提交于
Let some time to print any exception trace before killing it.
-
由 Romain Vimont 提交于
Log at debug level user requests to quit.
-
由 Romain Vimont 提交于
The skip_frames flag was a non-configurable runtime flag. Since it is not exposed to the user, there is no need for a (possible) runtime cost. For testing purpose, we still want it to be configurable, so make it a compilation flag.
-
- 06 2月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
We encounter some problems with SDL2_image on MSYS2 (Windows), so implement our own XPM parsing which does not depend on SDL_image. The input XPM is considered safe (it's in our source repo), so do not check XPM format errors. This implies that read_xpm() is not safe to call on any unsafe input. Although less straightforward, use SDL_CreateRGBSurfaceFrom() instead of SDL_CreateRGBSurfaceWithFormatFrom() because it is available with SDL versions older than 2.0.5.
-
- 05 2月, 2018 2 次提交
-
-
由 Romain Vimont 提交于
The hint SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH appeared in SDL 2.0.5. Ignore it if the SDL version is older.
-
由 Romain Vimont 提交于
Add a bugdroid icon loaded from an XPM.
-
- 04 2月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
The scrcpy() function returns a SDL_bool to indicate its success, but was initialized to 0 (SDL_FALSE) instead of SDL_TRUE.
-