[vlc-devel] [PATCH V3 00/19] player: add a timer API

Thomas Guillem thomas at gllm.fr
Fri Sep 6 17:20:30 CEST 2019


Branch available here: https://code.videolan.org/tguillem/vlc/tree/clock-update/13

Changes since the V2:
 - Add support for SMPTE Timecode updates. UI can now get notified when a video
   frame is rendered and get its correct timecode, that is "hh:mm:ss:ff" or
   "hh:mm:ss;ff" for 29.97fps and 59.94fps DF case). Cf. the new "player: add
   the timer API" commit log.

Few commits were added to implement this new feature:
 - "clock: add vlc_clock_UpdateVideo()":
    To pass the video fps to update points

 - "clock: handle forced points":
 - "vout: also update forced clock points":
   To get notified when a frame rendering is forced

 - "qt: add VLCSmpteTC gadget":
 - "WIP: qt: use the SMPTE Timecode as time widget":
    WIP UI modification to display the SMPTE timecode.

Note: The "qt: use the new player timer" implementation is quite dumb, it
should be reworked/reviewed by an UI expert.

Changes since the V1:
 - Removed the threaded timer

 - Don't pass the clock as a parameter to clock udpates

 - Use VLC_TICK_0 as origin, and not 0

 - Handle the b_access_control case in mpeg/ts.c (no first_pcr)

 - Reworked ES_OUT_SET_FIRST_PCR/vlc_clock_main_SetFirstPcr(): Replaced with
   ES_OUT_ADD_ORIGIN_TIME / vlc_clock_main_AddOriginPoint(), cf.  patches 01,
   02 and 03. Demuxers can send origin points to the main clock via the es_out.
   The clock will keep a map of origin points and will fix ts with their origin
   before being sent via callbacks. This fixes a TOCTOU issue when the ts
   module updated its origin more than one time.

Thomas Guillem (19):
  clock: rename SetFirstPcr to SetReferencePoint
  clock: add AddOriginPoint
  es_out: add the ES_OUT_ADD_ORIGIN_TIME control
  ts: update the origin time to the es_out
  clock: forward clock update points
  clock: add vlc_clock_UpdateVideo()
  vout: use vlc_clock_UpdateVideo()
  clock: handle forced points
  clock: re-indent after last commit
  vout: also update forced clock points
  input: forward clock update points
  input: send pause/playing date via events
  player: add the timer API
  aout: dummy: implement TimeGet
  test: player: add audio_block_length param
  test: player: test the timer API
  qt: use the new player timer
  qt: add VLCSmpteTC gadget
  WIP: qt: use the SMPTE Timecode as time widget

 include/vlc_es_out.h                          |   4 +
 include/vlc_player.h                          | 178 +++++++
 modules/audio_output/adummy.c                 |  61 ++-
 modules/demux/mpeg/ts.c                       |  24 +
 modules/demux/mpeg/ts_streams.c               |   2 +-
 modules/demux/mpeg/ts_streams_private.h       |   1 +
 modules/gui/qt/Makefile.am                    |   3 +
 .../gui/qt/components/player_controller.cpp   | 152 ++++--
 .../gui/qt/components/player_controller.hpp   |   6 +
 .../gui/qt/components/player_controller_p.hpp |  10 +
 modules/gui/qt/main_interface.cpp             |   3 +
 modules/gui/qt/qml/player/ControlBar.qml      |   2 +-
 modules/gui/qt/util/vlcsmptetc.cpp            |  50 ++
 modules/gui/qt/util/vlcsmptetc.hpp            |  48 ++
 src/Makefile.am                               |   1 +
 src/clock/clock.c                             | 214 ++++++--
 src/clock/clock.h                             |  66 ++-
 src/input/es_out.c                            |  61 ++-
 src/input/es_out_timeshift.c                  |  16 +
 src/input/event.h                             |  19 +-
 src/input/input.c                             |  25 +-
 src/input/input_internal.h                    |  25 +-
 src/input/item.c                              |   2 +-
 src/input/thumbnailer.c                       |   4 +-
 src/libvlccore.sym                            |   4 +
 src/player/input.c                            | 105 +++-
 src/player/player.c                           |  13 +-
 src/player/player.h                           |  89 +++-
 src/player/timer.c                            | 455 ++++++++++++++++++
 src/video_output/video_output.c               |  16 +-
 test/src/player/player.c                      | 258 +++++++++-
 31 files changed, 1766 insertions(+), 151 deletions(-)
 create mode 100644 modules/gui/qt/util/vlcsmptetc.cpp
 create mode 100644 modules/gui/qt/util/vlcsmptetc.hpp
 create mode 100644 src/player/timer.c

-- 
2.20.1



More information about the vlc-devel mailing list