1. 16 7月, 2021 1 次提交
  2. 14 7月, 2021 15 次提交
    • R
      Improve slope estimation on start · 0ae10f2b
      Romain Vimont 提交于
      The first frames are typically received and decoded with more delay than
      the others, causing a wrong slope estimation on start.
      
      To compensate, assume an initial slope of 1, then progressively use the
      estimated slope.
      0ae10f2b
    • R
      Add buffering debugging tools · 4c4d0229
      Romain Vimont 提交于
      Output buffering and clock logs by disabling a compilation flag.
      4c4d0229
    • R
      Add clock tests · 2f03141e
      Romain Vimont 提交于
      The clock rolling sum is not trivial. Test it.
      2f03141e
    • R
      Add buffering command line options · 33977203
      Romain Vimont 提交于
      Add --display-buffer and --v4l2-buffer options to configure buffering
      time.
      33977203
    • R
      Implement buffering · 79278961
      Romain Vimont 提交于
      To minimize latency (at the cost of jitter), scrcpy always displays a
      frame as soon as it available, without waiting.
      
      However, when recording (--record), it still writes the captured
      timestamps to the output file, so that the recorded file can be played
      correctly without jitter.
      
      Some real-time use cases might benefit from adding a small latency to
      compensate for jitter too. For example, few tens of seconds of latency
      for live-streaming are not important, but jitter is noticeable.
      
      Therefore, implement a buffering mechanism (disabled by default) to add
      a configurable latency delay.
      
      PR #2417 <https://github.com/Genymobile/scrcpy/issues/2417>
      79278961
    • R
      Notify new frames via callbacks · 408a3012
      Romain Vimont 提交于
      Currently, a frame is available to the consumer as soon as it is pushed
      by the producer (which can detect if the previous frame is skipped).
      
      Notify the new frames (and frame skipped) via callbacks instead.
      
      This paves the way to add (optional) buffering, which will introduce a
      delay between the time when the frame is produced and the time it is
      available to be consumed.
      408a3012
    • R
      Extract current video_buffer to frame_buffer · 4d8bcfc6
      Romain Vimont 提交于
      The current video buffer only stores one pending frame.
      
      In order to add a new buffering feature, move this part to a separate
      "frame buffer". Keep the video_buffer, which currently delegates all its
      calls to the frame_buffer.
      4d8bcfc6
    • R
      Rename video_buffer to sc_video_buffer · 336248df
      Romain Vimont 提交于
      Add a scrcpy-specific prefix.
      336248df
    • R
      Relax v4l2_sink lock constraints · 28bce48d
      Romain Vimont 提交于
      To fix a data race, commit 5caeab5f
      called video_buffer_push() and video_buffer_consume() under the
      v4l2_sink lock.
      
      Instead, use the previous_skipped indication (initialized with video
      buffer locked) to lock only for protecting the has_frame flag.
      
      This enables the possibility for the video_buffer to notify new frames
      via callbacks without lock inversion issues.
      28bce48d
    • R
      Replace delay by deadline in timedwait() · 32e692d5
      Romain Vimont 提交于
      The function sc_cond_timedwait() accepted a parameter representing the
      max duration to wait, because it internally uses SDL_CondWaitTimeout().
      
      Instead, accept a deadline, to be consistent with
      pthread_cond_timedwait().
      32e692d5
    • R
      Wrap tick API · ec871dd3
      Romain Vimont 提交于
      This avoids to use the SDL timer API directly, and will allow to handle
      generic ticks (possibly negative).
      ec871dd3
    • R
      Add missing error log · 5524f378
      Romain Vimont 提交于
      Log video buffer initialization failure in v4l2_sink.
      5524f378
    • R
      Move include fps_counter · 4ed3aa36
      Romain Vimont 提交于
      The fps_counter is not used from video_buffer.
      4ed3aa36
    • R
      Remove obsolete comment · 40cea1f6
      Romain Vimont 提交于
      Commit 2a94a2b1 removed video_buffer
      callbacks, the comment is now meaningless.
      40cea1f6
    • R
      Rename queue to sc_queue · 099cba07
      Romain Vimont 提交于
      Add a scrcpy-specific prefix.
      099cba07
  3. 07 7月, 2021 2 次提交
  4. 04 7月, 2021 1 次提交
  5. 26 6月, 2021 4 次提交
    • R
      Fix v4l2 data race · 5caeab5f
      Romain Vimont 提交于
      The v4l2_sink implementation directly read the internal video_buffer
      field "pending_frame_consumed", which is protected by the internal
      video_buffer mutex. But this mutex was not locked, so reads were racy.
      
      Lock using the v4l2_sink mutex in addition, and use a separate field to
      avoid depending on the video_buffer internal data.
      5caeab5f
    • R
      Initialize fields before starting a thread · 33fbdc86
      Romain Vimont 提交于
      To avoid data races.
      
      Reported by TSAN.
      33fbdc86
    • R
      Fix assertion race condition in debug mode · f33d3797
      Romain Vimont 提交于
      Commit 21d206f3 added mutex assertions.
      
      However, the "locker" variable to trace the locker thread id was read
      and written by several threads without any protection, so it was racy.
      
      Reported by TSAN.
      f33d3797
    • R
      Initialize controller even if there is no display · 7dca5078
      Romain Vimont 提交于
      The options --no-display and --no-control are independent.
      
      The controller was not initialized when no display was requested,
      because it was assumed that no control could occur without display. But
      that's not true (anymore): for example, it is possible to pass
      --turn-screen-off.
      
      Fixes #2426 <https://github.com/Genymobile/scrcpy/issues/2426>
      7dca5078
  6. 21 6月, 2021 9 次提交
  7. 20 6月, 2021 8 次提交