fate: vpx: Remove one redundant $(eval) invocation
pthread: Avoid spurious wakeups

pthread_wait_cond can wake up unexpectedly (Wikipedia: Spurious_wakeup).

The FF_THREAD_SLICE thread mechanism could spontaneously execute
jobs or allow the caller of avctx->execute to return before all
jobs were complete.

Test both cases to ensure the wakeup is real.

Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
avio: Use AVERROR_PROTOCOL_NOT_FOUND

When the protocol is missing ffurl_alloc() should return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).

Bug-Id: 577
CC: libav-stable@libav.org
avplay: Accept cpuflags option

Quite useful for debugging.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
wip: extended logging
avplay: Support selecting codecs

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
lavc: Add private API to manipulate AVPacketList
lavf: use ff_packet_list API
lavc: introduce CODEC_CAP_PKT_TS

Codecs with internal parallelism need to set the pkt_pts/pkt_dts
by themselves.
wip: qsv decoders

Originally written by Luca Barbato <lu_zero@gentoo.org>.
Further contributions by Yukinori Yamazoe <drocon11@gmail.com>.

qsv: Smaller fixes
qsv: Flush cached frames when EOF

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
qsv: Add behavior when device busy

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
qsv: Add behavior when PicStruct is tripling and doubling

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
qsv: Change to dynamic surface allocate

Changed to dynamic surface allocate in get_surface(), because number of surfaces may be insufficient when it is a fixed value.
And reduced number of memcpy when output frame.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
qsv: Change to dynamic timestamps allocate

Change to dynamic timestamps allocate, because the number of timestamps may be insufficient when it is a fixed value.
The number of timestamps depends on the number of packets required before outputting the frame, and the number to be reserved for frame reordering.
The number of packets which QSV decoder needs cannot be guessed before starting to output first frame, because it depends on the video stream.
The number to be reserved for frame reordering from H.264 specification is 32.
(Max B frame) * (Max picture per frame) = 16 * 2 = 32 (1 picture = 1 packet)
After first frame is output, the number of timestamps can be determined.

In the following cases, the value is changed.
1. If the number of timestamps is insufficient, it is increased until first frame is output.
2. Add 32 to the number of timestamps in use after first frame is output.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
qsv: Support video parameter changed

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
qsv: Add AVOption async_depth

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
qsv: Add MPEG-2 video decoding support

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>