mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 03:57:24 +00:00
video: decoder: vaapi: use max_{width|height} from CodedCaps if no value is returned
The max width and height from the coded side are the best approximation for the max width and height of the raw side if the actual values are not available in VA-API. In particular, it's extremely unlikely to have 1x1 as acceptable values for max_width and max_height. BUG=b:214478588 TEST=cargo test -p devices --features=video-decoder,vaapi virtio::video::decoder::backend::vaapi::tests::test_get_capabilities -- --include-ignored Change-Id: I6d9830b4da69f29f5e2e11c3fa688db4a7007726 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3901273 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
parent
49d746a47c
commit
23f0edd0ba
1 changed files with 2 additions and 2 deletions
|
@ -243,7 +243,7 @@ impl VaapiDecoder {
|
|||
let max_width = match max_width.get(0) {
|
||||
Some(libva::GenericValue::Integer(i)) => *i as u32,
|
||||
Some(other) => panic!("Unexpected VAGenericValue {:?}", other),
|
||||
None => 1,
|
||||
None => coded_cap.max_width,
|
||||
};
|
||||
|
||||
let max_height = config.query_surface_attributes_by_type(
|
||||
|
@ -252,7 +252,7 @@ impl VaapiDecoder {
|
|||
let max_height = match max_height.get(0) {
|
||||
Some(libva::GenericValue::Integer(i)) => *i as u32,
|
||||
Some(other) => panic!("Unexpected VAGenericValue {:?}", other),
|
||||
None => 1,
|
||||
None => coded_cap.max_height,
|
||||
};
|
||||
|
||||
raw_caps.push(RawCap {
|
||||
|
|
Loading…
Reference in a new issue