video: decoder: vaapi: introduce a reordering mechanism
video: decoder: vaapi: introduce a reordering mechanism

Introduce a reordering mechanism to reorder from decode order into
display order. This builds upon the new display_order() call introduced
in cros-codecs.

As frames are delivered in decode order, we have to wait before
outputting them if we notice any gaps. Thus a monotonically increasing
counter is required. This is because we rely on the monotonically
increasing property to identify the gaps.

BUG=b:214478588
TEST="The decoded data is in order (unless corruption took place)"

Change-Id: Ia910aa739088d110e0ee0f24c0b50e049625a399
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3907529
Reviewed-by: Alexandre Courbot <301cd6a3ea50a894b4b51e385c5eb12b9a4ffc0c@chromium.org>
Reviewed-by: Keiichi Watanabe <815e4e8f7c92a23424d7c3f51ead622bcedbc720@chromium.org>
Commit-Queue: Alexandre Courbot <301cd6a3ea50a894b4b51e385c5eb12b9a4ffc0c@chromium.org>

google/crosvm,google/crosvm,google/crosvm,google/crosvm