crosvm/media
Alexandre Courbot 74cd872091 media: cros-codecs: vaapi: use method to get reference to parsed metadata
The StreamMetadataState struct provides us with some useful stream
information, but some if it is only available after the initial stream
parsing is done. As a consequence, many of its accessor methods return
an error if we are in the wrong state. This check is repeated quite a
lot in code that uses StreamMetadataState even though a single check
should be enough.

Replace these accessor methods by a single method returning a reference
to the parsed state if it is accessible. This groups redundant runtime
checks for the metadata parsing state into a single check and thus
reduces the code size a bit.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: I2455ec7901e29f50716d535017f83e4d19b3c6fa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164541
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2023-03-01 12:55:19 +00:00
..
cros-codecs media: cros-codecs: vaapi: use method to get reference to parsed metadata 2023-03-01 12:55:19 +00:00
ffmpeg
libva
libvda