- 13 2月, 2018 1 次提交
-
-
由 Romain Vimont 提交于
Print the logs only if their level is not under the threshold, which is defined to INFO in release mode and DEBUG in debug mode.
-
- 12 2月, 2018 6 次提交
-
-
由 Romain Vimont 提交于
CloseHandle() does not terminate the process. TerminateProcess() does.
-
由 Romain Vimont 提交于
All our logs should use APPLICATION category. The logs for other categories are not printed by default under the "critical" level.
-
由 Romain Vimont 提交于
On our Windows machine, the mingw ld.exe does not support sanitizers. Exclude them from the default debug build.
-
由 Romain Vimont 提交于
In release mode, use the default log priorities.
-
由 Romain Vimont 提交于
Because why not.
-
由 Romain Vimont 提交于
Characters like 'é' or 'î' are not resolved by getEvents(). For example, getEvents("é") returns null. However, it is possible to decompose them. For example, getEvents("\u0301e") returns the events generating "é". Thank you Philippe! ;)
-
- 09 2月, 2018 19 次提交
-
-
由 Romain Vimont 提交于
The SDL clean up does not crash anymore on exit, probably since the memory corruption caused by calling SDLNet_TCP_Close() too early has been resolved.
-
由 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 提交于
Turning the screen on is semantically associated to control(): only creating the EventController object should not turn the screen on.
-
由 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 提交于
"make build-debug" will build with ASAN and USAN enabled.
-
由 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 提交于
Do not wait 100ms anymore to let the server print any exception: we justly want to ignore them. Moreover, there is no nanosleep() on Windows, so this solve another problem.
-
由 Romain Vimont 提交于
On close, the socket is closed by the client, and the server process is killed. This leads to (expected) exceptions, that should not be printed.
-
由 Romain Vimont 提交于
When the video stream socket is closed and read_packey() returns -1, av_read_frame() still returns 0. To detect EOF, check the flag eof_reached in the AVIOContext. This avoids garbage errors on closing.
-
由 Romain Vimont 提交于
Avoid to send the command twice, once on mouse down, once on mouse up.
-
由 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 8 次提交
-
-
由 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 提交于
In practice, these headers are included only once, but it's a good practice to always use include guards.
-
由 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.
-
由 Romain Vimont 提交于
Apply Genymobile checkstyle and gradle build files organization.
-
由 Romain Vimont 提交于
Use AXIS_HSCROLL (available since API 12) instead of AXIS_SCROLL (since API 26).
-
由 Romain Vimont 提交于
In handleEvent(), connection.receiveControlEvent() may never return null: either it returns a valid ControlEvent, either it throws an Exception. Therefore, there is no need to propagate a flag to indicate whether it returned a valid ControlEvent.
-
由 Romain Vimont 提交于
Use one parse method per control event type.
-
- 07 2月, 2018 6 次提交
-
-
由 Romain Vimont 提交于
The server is not a real Android application, it's just a jar with a main method. Instrumented tests are meaningless in this context.
-
由 Romain Vimont 提交于
On some devices, we can reuse the same codec and display, but on some others (e.g. Nexus 5X with Android 7.1.2), it crashes on codec.stop() with an IllegalStateException. Therefore, always recreate the codec and display, so that it works on all devices.
-
由 Romain Vimont 提交于
If rotation changed, the dequeued output buffer was never released. Move it to a finally block to avoid the leak.
-
由 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 提交于
On --version, also print the dependencies version scrcpy has been compiled against.
-