stbt.Display: Add clock on each frame's left top corner

While recording a video with this commit there will be visible clock
on left top corner. Clock displays time when given frame was
processed. In addition when calling a function 'press' we will draw not
only an information that button was pressed but as well time when it was
pressed. This should provide accurate information that will let us find
relation between actions registered in logs and what happened on screen.
stbt.py: Change video text font to HERSHEY_DUPLEX

HERSHEY_TRIPLEX is a serifed font, HERSHEY_DUPLEX is a sans-serif font.
Sans-serif fonts are more ususal in computing while serifed fonts are
more usual in traditional printed publications. I find HERSHEY_DUPLEX
easier to read on screen.
stbt.press: Draw black background behind the key name

`stbt.press` draws the name of the key on the output video. This shows
up on the video recorded by `stbt batch run` for each test run.

When the live TV in the system-under-test is showing white, you couldn't
see the key-name debug text. Now we draw a black box behind the text,
so the debug is always white-on-black.
stbt.press: Extend the black background to create a margin over the text

It's easier to read text if the black background doesn't end at the
edges of the text. E.g. the letter 'E' on a white background is still
difficult to read because the top and bottom '_' lines are right at
the edge.
stbt.py: Drop the last frame on underrun

`stbt._display.last_buffer` stores the most recent GSt buffer until
`stbt.gst_samples` removes it or it's replaced by a newer buffer.
To put it other way, if the video stream stops then `gst_samples`
yields the very last sample of the video stream even though it's called
minutes later.

This behaviour has unwanted effects in the following situations:

1.
    stbt.press("POWER_OFF")
    time.sleep(5)
    # Make sure that the device under test is off
    try:
        stbt.frames().next()
    except stbt.NoVideo:
        pass
    else:
        raise stbt.UITestFailure("The device is still on")

In this case `stbt.frames` never raises NoVideo, as it yields the
sample that had been stored *before* the box was powered off.

2.
    stbt.wait_for_match("menu.png")
    stbt.press("POWER_OFF")
    time.sleep(5)
    stbt.press("POWER_ON")
    # Make sure that we no longer see menu.png because
    # it should disappear if the device under test is restarted
    try:
        stbt.wait_for_match("menu.png")
    except stbt.MatchTimeout:
        pass
    else:
        raise stbt.UITestFailure("menu.png hasn't disappeared")

In this case we have a race condition between stbt and the device under
test. The device needs some time to start delivering frames after it's
powered on; if it doesn't happen before `gst_samples` is called then
`wait_for_match("menu.png")` returns false positive as the first sample
that `gst_samples` yields is the one that had been stored *before* the
device was powered off.

Note that these issues only occur with Blackmagic and HD PVR capture
devices because VidiUs emit all-blue frames if they don't receive
video.

The solution is to drop `last_buffer` if the user data queue sends an
underrun message. However, in my experience capturing video with HD PVR
results in a lot of underrun messages even though the video stream
appears to be continuous. The underrun messages are so frequent that
dropping the last sample after each message results in deleting valuable
video frames and the video output is lagging. To work around this issue,
the same timer is used that "restart source" is using; it's cancelled
if the video stream continues, as signalled by a "running" message.
stbt.py: Stop sink pipeline while the source pipeline is restarting

The VidiU capture device restarts its encoder every time the video
resolution changes. It results in an EOS message sent to the source bus
that triggers restarting the source pipeline, as implemented in
6b7ba0a3.

However, if the video saving pipeline is active (--save-video option),
the tests fail with one of the following errors:
1. GStreamer raises a general stream error: "streaming task paused,
   reason not-negotiated (-4)".
2. No EOS message is sent after an encoder restart, therefore the source
   pipeline never gets restarted, and the test hangs forever or times
   out with NoVideo.

If we stop video encoding when the source pipeline sends the EOS
message, and don't restart it until the source pipeline is successfully
restarted, we can avoid the above failures.

Note that it's not enough to set the sink pipeline to STATE_PAUSED.
When we restart video recording, the video encoder raises an error
because video timestamps are getting inconsistent after a source
pipeline restart. We have to restart the encoder in order to
successfully resume video recording; we simply append the new video
stream to the existing video file.

This fix has a side-effect with xvimagesink. As the entire sink pipeline
is stopped during source pipeline restart, the video output window gets
closed for this duration. However as we don't see any video during
pipeline restart anyway, only a black or blue screen, it's not a
blocking issue.
stbt.py: Save a streamable video and regenerate EBML header at the end

The previous commit modified stbt.py to stop and restart the sink
pipeline every time the source pipeline is rebuilt.

Unfortunately it has an issue that the video file is corrupt because the
video file index is recreated for each file segment. A solution is to
create a `seekable` file that doesn't contain a video file index, and
rebuild the index at the end.

This commit introduces a new dependency, `ffmpeg` that we use to
recreate video file index.
stbt.py: Re-timestamp buffers after source pipeline restart

Every time the source pipeline is rebuilt, timestamps of the video
buffers restart counting from zero. It implies the following issues:
* If the source pipeline is restarted while `frames` is running,
  the actual timeout value is getting unpredictable, as `frames`
  times out if `timestamp - self.start_timestamp > timeout_secs` and
  both `timestamp` and `self.start_timestamp` are reset to 0 while
  `timeout_secs` stays the same.
* Concatenating the video files of a test run produces a corrupted video
  file because the timestamps are not in increasing order. It is also
  impossible to rebuild the video file index (e.g. with `ffmpeg` or
  `avconv`) to make the merged video file seekable.

This commit modifies `on_new_sample` to offset the timestamp of every
buffer by the last video timestamp before the most recent source
pipeline restart, and also by the duration of the pipeline restart
to make `gst_samples` time out at the expected time.

Note that this fix doesn't substitute the patch "Stop sink pipeline
while the source pipeline is restarting". Even though timestamps are
in the right order, without that patch restarting the source pipeline
still results in the same GStreamer error "streaming task paused, reason
not-negotiated (-4)".
extra/stb-tester.spec: Increment release number