adaptivedemux: use GstSystemClock to all real-time calculations
authorFlorin Apostol <florin.apostol@oregan.net>
Tue, 16 Feb 2016 14:44:10 +0000 (14:44 +0000)
committerThiago Santos <thiagoss@osg.samsung.com>
Thu, 21 Apr 2016 19:46:09 +0000 (16:46 -0300)
commit74d62b91449b2f21d417bc67b58792217c185b8d
tree6bf3296b39ecf59decd836a41c1ee6d9f31dbcc9
parentb66a9acdb898f39a23a7b1febc41d367d903a461
adaptivedemux: use GstSystemClock to all real-time calculations

A realtime clock is used in many places, such as deciding which
fragment to select at start up and deciding how long to sleep
before a fragment becomes available. For example dashdemux needs
sample the client's estimate of UTC when selecting where to start
in a live DASH stream.

The problem with dashdemux calculating the client's idea of UTC is
that it makes it difficult to create unit tests, because the passage
of time is a factor in the test.

This commit changes dashdemux and adaptivedemux to use the
GstSystemClock, so that a unit test can replace the system clock when
it needs to be able to control the clock.

This commit makes no change to the behaviour under normal usage, as
GstSystemClock is based upon the system time.

https://bugzilla.gnome.org/show_bug.cgi?id=762147
ext/dash/gstdashdemux.c
gst-libs/gst/adaptivedemux/gstadaptivedemux.c
gst-libs/gst/adaptivedemux/gstadaptivedemux.h