README: Virtual remote control's "port" argument is optional
stbt-tv: Stream live video through network

Launching 'stbt tv' with '-l' (for "listen") command line argument
streams video through a TCP socket. Used in conjunction with
'stbt control', it makes remote configuration of the set-top-boxes under
test possible.

The choice of TCP protocol is unusual for this application; the reason
behind is that it is easier to configure both the client and the server
compared to using RTP over UDP. As this tool serves for the convenience
of test system administrators, getting low latency is not critical.

TCP port is read from the new 'tv.port' parameter of the stb-tester
config file, or the hard-coded value 4953 is used if it isn't
specified. 4953 is the default value used by 'tcpclientsrc'.

Video bandwidth is read from the 'tv.bandwidth' parameter in bps,
defaults to 1500000 (1.5 Mbps). This value is a rule of thumb
compromise of video quality and network load; users can fine-tune the
bitrate with tools like tcpperf.

The receiving side can watch the video stream with
* vlc:
    `vlc tcp://<host>:<port>`
* gst-launch:
    `gst-launch tcpclientsrc host=<host> port=<port> ! \
        mpegtsdemux ! decodebin2 ! autovideosink`
stbt tv -l: Error message if gstreamer-ffmpeg isn't installed

3c58225 added the `-l` flag to `stbt tv`. It requires ffenc_mpeg4 from
gstreamer-ffmpeg. On Fedora, gstreamer-ffmpeg isn't available in the
standard repositories; you have to install the rpmfusion repository. So
I don't want to mandate gstreamer-ffmpeg as a requirement in the rpm
spec file; that would force users to install rpmfusion even if they
don't want this feature of `stbt tv`. Instead, `stbt tv` now prints an
informative error message.
stbt tv -l: Print stream URL to stdout

For easy copy-and-paste into VLC.
Merge branch 'stbt-tv-to-provide-streaming-video'

* stbt-tv-to-provide-streaming-video:
  stbt tv -l: Print stream URL to stdout
  stbt tv -l: Error message if gstreamer-ffmpeg isn't installed
  stbt-tv: Stream live video through network
extra/runner/report.py: extra-columns appear in a predictable order

Prior to this commit, the order that a user's `extra-columns` appeared
in the html report wasn't consistent (see below for why). This commit
changes this so they appear in the order they appear in the
`extra-columns` file. Although this order is perhaps slightly arbitary,
it is an improvement on having no order at all.

Python dictionaries (which `collections.defaultdict inherits from), don't
have a consistent order (like a list) and so when iterating over different
instances of otherwise identical dictionaries you aren't guarenteed to
access the dictionaries' keys in the same order. See [1].

This commit changes report.py's Run.extra_columns attribute to use an
`OrderedDict`, instead of a `defaultdict`, which guarantees the order of
iteration over a dictionary's contents will always be the order they are
instantiated.

[1] http://www.laurentluce.com/posts/python-dictionary-implementation/
stbt.Display.on_eos: Fix null dereference

...when sink pipeline sends EOS just after source pipeline. The source
pipeline's EOS triggers `restart_source`, which sets the source pipeline
to `None` and waits a few seconds before restarting it; so for a few
seconds, an EOS from the sink pipeline would try to access an invalid
source pipeline.
stbt screenshot: Work around Blackmagic purple tint in first second of video

The first second of video frames delivered by the Blackmagic Intensity
Pro card is brighter than subsequent frames, and with a magenta tint.
Thanks to Aiman Baharna for the bug report & analysis.
test_press_visualisation, test_draw_text: Fix race condition

These tests used to run a stbt script that saved 3 seconds of output to
a video on disk, then ran a second stbt script that analysed that video.
On a heavily loaded system (such as the Travis CI service that runs our
tests in the cloud), the second (verification) script could fail, if
`stbt run` took longer than 3 seconds to reach the `wait_for_match`
call. In that case `wait_for_match` would raise `NoVideo` instead of
finding the match.

Instead, we run 2 `stbt run` instances at the same time, connected via
filesink -> named pipe -> filesrc. The `stbt run` instance providing the
video runs as long as necessary for the other `stbt run` to find the
match; and *only* as long as necessary, so in most cases these tests
run much faster than the previous version.

The `gdppay` and `gdpdepay` payloader elements wrap the raw data with
the "GStreamer Data Protocol". Without this, the filesrc doesn't know
the caps of the video it's receiving.

I cropped the `red-black.png` template tightly around the two lines of
text, because now there may be a third "black" line underneath them from
the previous call to `press_black`.