ffmpeg: specify supported resolution range for input formats

This is required so the guest can know which resolutions are supported
for encoded formats.

BUG=b:169295147
TEST=ffplay from Linux guest can start streaming.

Change-Id: I6f86108efbc8971f3ee4b9ec494cec16ebce323d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3716017
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This commit is contained in:
Alexandre Courbot 2022-06-22 12:13:15 +09:00 committed by Chromeos LUCI
parent 8c60b64454
commit 4f902ffc9e

View file

@ -661,7 +661,22 @@ impl DecoderBackend for FfmpegDecoder {
in_formats.push(FormatDesc {
mask: !(u64::MAX << SUPPORTED_OUTPUT_FORMATS.len()),
format,
frame_formats: vec![Default::default()],
frame_formats: vec![FrameFormat {
// These frame sizes are arbitrary, but avcodec does not seem to have any
// specific restriction in that regard (or any way to query the supported
// resolutions).
width: FormatRange {
min: 64,
max: 16384,
step: 1,
},
height: FormatRange {
min: 64,
max: 16384,
step: 1,
},
bitrates: Default::default(),
}],
});
}