1. 16 2月, 2018 1 次提交
    • R
      Replace SDL_net by custom implementation · 9b056f50
      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.
      9b056f50
  2. 15 2月, 2018 3 次提交
    • R
      Refactor screencontrol to inputmanager · 000ced9b
      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.
      000ced9b
    • R
      Expose skip_frames as a build option · 42882702
      Romain Vimont 提交于
      It can be initially configured by:
      
          meson builddir -Dskip_frames=false
      
      Or on an existing builddir by:
      
          mesonconf builddir -Dskip_frames=false
      42882702
    • R
      Add FPS counter · 38e66828
      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).
      38e66828
  3. 14 2月, 2018 3 次提交
    • R
      Require Meson 0.37 · 0efa9305
      Romain Vimont 提交于
      Older versions of Meson are too limited, and it's simple to install a
      newer version ("pip3 install meson").
      0efa9305
    • R
      Replace meson subprojects by subdir · c2127d08
      Romain Vimont 提交于
      Since Meson 0.44, subproject_dir may not be '.' anymore. This implies we
      must move app/ and server/ to a subprojects/ directory, which requires
      to also change some gradle files.
      
      Instead, just use subdir(), with options to disable building of the app
      or the server.
      c2127d08
    • R
      Refactor build system · ff94462d
      Romain Vimont 提交于
      The client was built with Meson, the server with Gradle, and were run by
      a Makefile.
      
      Add a Meson script for the server (which delegates to Gradle), and a
      parent script to build and install both the client and the server to the
      system, typically with:
      
          meson --buildtype release build
          cd build
          ninja
          sudo ninja install
      
      In addition, use a separate Makefile to build a "portable" version of
      the application (where the client expects the server to be in the
      current directory). Typically:
      
          make release-portable
          cd dist/scrcpy
          ./scrcpy
      
      This is especially useful for Windows builds, which are not "installed".
      ff94462d
  4. 13 2月, 2018 2 次提交
  5. 12 2月, 2018 1 次提交
  6. 09 2月, 2018 2 次提交
  7. 08 2月, 2018 2 次提交
  8. 07 2月, 2018 3 次提交
  9. 06 2月, 2018 1 次提交
    • R
      Parse XPM without SDL_image · 71c2bfdd
      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.
      71c2bfdd
  10. 05 2月, 2018 1 次提交
  11. 23 1月, 2018 1 次提交
    • R
      Rename screen -> scrcpy -> main · 2c352206
      Romain Vimont 提交于
      Rename scrcpy.c to main.c (this file handles the command line parsing),
      and screen.c to scrcpy.c (it exposes the entry point scrcpy()).
      2c352206
  12. 22 1月, 2018 1 次提交
  13. 19 1月, 2018 3 次提交
    • R
      Add unit tests for control event serialization · 52af91f6
      Romain Vimont 提交于
      Test serialization of the 4 types of events (keycode, text, mouse,
      scroll).
      52af91f6
    • R
      Add tests for strutil · f75c404a
      Romain Vimont 提交于
      Test our custom string handling functions.
      f75c404a
    • R
      Implement keyboard/mouse control · cabb102a
      Romain Vimont 提交于
      To control the device from the computer:
       - retrieve mouse and keyboard SDL events;
       - convert them to Android events;
       - serialize them;
       - send them on the same socket used by the video stream (but in the
       opposite direction);
       - deserialize the events on the Android side;
       - inject them using the InputManager.
      cabb102a
  14. 04 1月, 2018 1 次提交
  15. 18 12月, 2017 1 次提交
  16. 12 12月, 2017 1 次提交