This allows cargo to build for android. A new
dev container is built to include this.
To allow us to build the new container, we had to
remove the ffmpeg dependencies for armhf which fail
to install in the current version of debian.
BUG=b:349907813
TEST=dev_container presubmit clippy_android
Change-Id: I7fbcd460e53fbd339a28b451a91b0722d34257b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5689659
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Codec information is purely static and can thus be shared between
threads.
This is necessary to turn the ffmpeg backend into a trait object.
BUG=None
TEST=cargo build --features "video-decoder,vaapi,ffmpeg,libvda-stub"
Change-Id: Ia0200476a69c66ade0d622c3d7305b2125e2b067
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5606948
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
This uprevs both testvm and devcontainer and uploads new builds.
This will update them to the latest debian images and packages.
Some minor tweaks were made to satisfy the newer versions of
mdformat and python.
BUG=None
TEST=presubmit all --no-delta
Change-Id: I73e30aa1d9cefb5cf4ac117f513c2a98bf3c9ac5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5416093
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Ensure that every Cargo.toml dependency on a third-party crates.io crate
specifies at least a major version, or a minor version for 0.x crates,
to ensure that if a new major version is published, it cannot cause API
breaks.
The versions are selected to match the ones already in Cargo.lock, so
this should have no functional change, but it will help prevent new "*"
versions from being introduced via copy-and-paste.
For rationale, see the Cargo FAQ:
<https://doc.rust-lang.org/cargo/faq.html#can-libraries-use--as-a-version-for-their-dependencies>
`minijail`, `audio_streams`, and `cras` are left as "*" for now, since
they have unusual situations (imported from a submodule and/or replaced
at build time with ebuild magic).
BUG=None
TEST=tools/dev_container tools/presubmit
TEST=verify Cargo.lock is unchanged
Change-Id: Ifa18199f812f01d2d10bfb4146b3353c1a76527c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5555656
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This removes some auto-generated safety comments, but should otherwise
be a no-op.
Change-Id: Ibfcf75c6e296367fe1a6114ce2047fb79e34041b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5178534
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Generate bindings for the installed version of the ffmpeg libraries at
build time instead of checking in a static version of the bindings.
BUG=b:309563850
TEST=cargo build --features=ffmpeg
Change-Id: I38d922dd7332c4385ae6a0ae93e893538c3b1cce
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5027711
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
thread_safe_callbacks is removed because that field has been deprecated
and the callbacks are required to be thread safe now.
BUG=b:309563850
TEST=crosvm builds locally and boots with a working ffmpeg video device.
Change-Id: Ic6777c1c413d27c038106adbf6022eb044a5365d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5008192
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Updates are made to source and documentation.
This more accurately represents the currently supported platforms of
Android/Linux and Windows, without unexpectedly including other
unix-like operating systems.
Command to reproduce:
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -i 's/cfg(unix)/cfg(any(target_os = "android", target_os = "linux"))/g' {}
$ cargo fmt
md files manually updated to fix line lengths.
Renaming `unix` modules to `linux` will be done in a later CL.
Test: ./tools/dev_container ./tools/presubmit
Bug: b/298269162
Change-Id: I42c1bf0abf80b9a0df25551613910293217c7295
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4909059
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
In particular, this fixes the Clone impl for __BindgenUnionField, which
triggers clippy's incorrect_clone_impl_on_copy_type in Rust 1.73.
Additionally, --size_t-is-usize became the default and the option was
removed in bindgen 0.65.0, so the flag is dropped from our bindgen
command line.
BUG=None
TEST=tools/bindgen-all-the-things
Change-Id: I40a26cd4a9e2897af8a354f454f4909429d2feda
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4927831
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Now that we have switched to the external versions of these crates,
remove our old local copies.
BUG=b:262824148
TEST=presubmit
Change-Id: I993e56831e0f5e895c036c8b40e8181f4577ae27
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518094
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Some type parameters in <> were being mis-parsed as HTML tags.
BUG=b:276487055
TEST=tools/cargo-doc # with rust 1.68.2
Change-Id: Iaa9ec6cf94a6084cfdf323bb04c643396a320889
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4485758
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
This is a new major version, and requires some code changes.
Change-Id: I294ce3604aad6e6dc5f50e33246b690e883c1e36
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4481294
Auto-Submit: Andrew Walbran <qwandor@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
The references are only needed within the function call, so no lifetime is
required.
BUG=b:276487055
TEST=tools/clippy # with rust 1.68
Change-Id: I96fd94863f690ee37c953b9f7929e191a033a9c6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4391106
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This is supported since Rust 1.62.
Fixes the new derivable_impls clippy lint, added in Rust 1.67.
BUG=b:276487055
TEST=tools/clippy # with rust 1.68
Change-Id: I3696dd3cf4acbf9b5a2cfa8c2046e7656e13dbbd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4390735
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The previous CLs allow us to factorize the job management code into a
single method of the VAAPI backend structure.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Ib0667cf0bc722149147c8b2f486508415fe8747d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164546
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Use the right type for indicating blocking operations instead of a bool.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I93abddce01ad07bc595ec6442e2b3f53dd79a555
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164545
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Pending VA pictures were stored in a pending job queue, whereas the
GenericBackendHandle only had their surface ID and received the picture
itself only when it was completed.
This design adds some dependencies between the handles and the backend,
and it makes more sense for the GenericBackendHandle to own the VA
pictures from the beginning, and transition pending pictures to the
ready state itself. The progression of PictureState from pending to
ready is made more obvious that way, and the state management can now be
centralized in GenericBackendHandle, removing duplicate code.
This also allows us to remove the PendingJob struct and replace it by
counted references to the underlying GenericBackendHandle.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Id8b05ccd1524f603c61231d368a9fd234247840e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164544
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
The destructor for BackendHandle had to take ownership of its
GenericBackendHandle in its destructor in order to return the underlying
surface to the surface pool. This means the handle had to be put behind
an Option that is always valid, but requires us to perform unwrap()s
when accessing it anyway.
By delegating the surface return to GenericBackendHandle, we can avoid
this Option and thus make the code a bit more sound.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I590172b69decac3250bb9e85a67d959b1eca83f8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164543
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The coded resolution stored in the VAAPI backend was changed in lockstep
with the same information stored in the buffer pool. Let's remove the
former and always use the latter to avoid duplicating the same
information.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I08bfb7c2aaf6609a43a2753f143a58cd06ece4c4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164542
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
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>
This struct name was a bit confusing. Since it tracks the state of the
VA picture, let's change it to PictureState.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Iab0ec6ea5167a736baf74520b8213660552602e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164540
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
We can obtain the same thing by just cloning the backend handle, so
let's just do that.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I0afb841f5d16f8161ff5c82586ef791492df0d36
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164538
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Use a native binary heap type to keep the ready queue properly sorted
instead of calling `sort_by_key` ourselves, which is error-prone.
BUG=b:214478588
TEST=simple_decoder v4l2r test passes and returns a properly-ordered
stream.
Change-Id: I9f5c8e0290192e6b0478497335bba0889f8bce97
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4230552
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The Picture type is a complex generic type which purpose was to hold
both the input and output data of a stateless decoding job. It has
several drawbacks:
- While it maps nicely to VAAPI for which the output of a decoding job
is known at the time we submit it, it won't work well with V4L2
stateless which does not allow us to know which CAPTURE buffer will be
used in advance.
- Before the decoding job is actually submitted, Picture objects are in
a state where their output is not available, which makes some of its
methods panic and allows for inconsistent state in the code. Basically
users of Picture objects are expecting that it is either in a
pre-submit or a post-submit state, which is dangerous.
- It's a bit complex to understand (arguably opinionated).
There is a clear separation between the pre-submit time, for which only
the input data is available, and the post-submit time, for which we are
only interested in the decoded output handle. By stopping using Picture
we can make sure that only the relevant data is available at both of
these times, and that it is valid - this removes quite a few unwrap()s
and Options and makes the code safer overall.
H.264's DPB was relying on the Picture type as it needs both the frame
information and its decoded handle, so we replace that by a dedicated
DpbEntry type.
This change strips almost 350 LoCs and ~24KB from the binary in a
release build as we now rely less on generics and monomorphization.
Since this change touches to the core of the stateless decoders, it is
necessarily big and a bit all over the place. However the net loss in
LoCs is non-negligible and the code complexity gets reduced quite a bit.
BUG=b:214478588
TEST=`cargo test --features vaapi -p cros-codecs` passes on brya.
Change-Id: Iab735905a7ae5c7285a331ee362e60dbb8f4eea0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4164537
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
- Rust toolchain is updated to 1.65.0
- Catapult dashboard upload tool is added to dev_container
- Bindgen is updated to latest version to support custom derive
- Derive Eq when PartialEq is derived as required by new Clippy
TEST=CQ, bindgen-all-the-things
FIXED=b:260784028
BUG=b:257303497
Change-Id: I2034cd09e0aed84d4e9b30f2e85d84d94a442ea4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4228427
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
The backends should not be aware of the Parser struct. Removing this
dependency opens the door to further factorization of the VP8 Decoder
struct.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Ie92aa341ed10fccbe328d321469edfc5ae1a334a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4160630
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Sort the members so the common ones appear first and in the same order -
this will help us factorize this part of the code in the future.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I78dedb06fef11fb00cdac88eae7b92d0010e6150
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4160629
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
VP9 segmentation is potentially useful to all backends and not only the
VAAPI one. Since this code is not VAAPI-dependent, move it to the common
decoder.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: If1970e9773de97d7923e6e230aa5a320b2d7cdc9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4160628
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>
The decode() method used to take a generic argument that can provide a
reference to the input byte stream. This appears as a convenience but is
really not since it is trivial for the caller to obtain the byte slice
from any type that implements AsRef<[u8]>, and having the generic
parameter uselessly complicates the code and results in large amounts of
monomorphization.
By removing this generic argument, we strip ~30KB on the binary in a
release build while keeping things easier to read overall.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I4a4a09151259a61fa66184dfed09a9bed286de68
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4142081
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
We are now in a state where the shared functions of all backend
implementations are implemented through `VideoDecoderBackend`, while the
codec-specific parts are done through `StatelessDecoderBackend`.
This allows us to extract the common functionality into a shared
`VaapiBackend` structure that provides the implementation of
`VideoDecoderBackend`, that each codec-specific backend will embed.
Doing so dramatically reduces the amount of duplicated code within the
VAAPI backend.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I9498d31cb3da6bfe10542267b4e8fcc075792afc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123657
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
We can move open() to be a generic method of StreamMetadataState if its
generic argument implement a trait for providing the necessary
information.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I51efcd7e116accf5532f34de5884a988dc1d0cab
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123656
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Since we can now get the maximum number of DPB frames from the Sps
itself, we don't need that extra argument. This aligns the H.264 backend
with the others and will be helpful for the unification of code.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Ia00a7cc2994497ef9c0d85567875bb920a861029
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123659
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Move `max_dpb_frames` from Decoder to Sps, where it can be more useful.
This requires moving the Profile and Level enums to the parser module,
which is also a better place for them since they are part of the Sps.
This allows us to validate the Level during parsing and not every time
it is queried. Profile unfortunately is more tricky so let's leave it
untouched for now.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I9ca908ef1f646c26e312449c76c2062ecb45af20
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123658
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This information is obtained from the stream metadata, so it should
belong here. Besides doing this makes the open() methods rely only on
metadata_state, which will allow us to factorize them on the next CL.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Ie4cdf1e27ca47a6c1d85334ab17d685d5aacb705
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123655
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Move some methods that are common for all codecs from the `HandleType`
type from StatelessDecoderBackend to VideoDecoderBackend.
This makes the `StatelessDecoderBackend` traits implement the
codec-specific part of the backend (which requires a custom interface),
while the `VideoDecoderBackend` trait implements the shared behavior
of the backend, regardless of the underlying codec.
This separation will also allow us to factorize the implementations of
these methods further down this series.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Id9f6874a1a57531ff092975f3692b10f7c1afcae
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123654
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
In order to split cros-codecs out of the crosvm repo, we need to make
sure that there won't be any ownership issue about the video files we
host. Remove all test files not belonging to Chromium to make sure there
won't be any problem.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cargo test --features vaapi -p cros-codecs -- --ignored` passes on Brya
Change-Id: Ia7d168934e1a9708857052ba66b83b02e1eaa593
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4170418
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Instead of configuring which crates to --exclude in
test_config.py, we can use conditional compilation to
exclude code that is not supported on windows.
This allows more fine-grained control and also allows
us to use plain cargo for building without complicated
configuration and exclusions.
BUG=b:265829867
TEST=cargo test --lib --bins --workspace
--target=x86_64-pc-windows-gnu
--features=all-mingw64
Change-Id: I8422c3f08053bc27d9896b220876a56bd25543d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4165868
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
The negotiation status should only be updated if the open() call
succeeded. Make all implementations adopt this behavior and look the
same.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I2bf19eaee712b6a770796859eaf72cbad0a4ab7b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123653
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Directly setting the desired value (as the H.264 implementation does) is
simpler and just as efficient.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I7c5f579b8a1a414602298be7e32811b8d9123faa
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4123652
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The PendingJob struct can easily be factorized by changing its generic
argument a bit.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Ia03fa20ff1878d04f3a19b1f603ba9e9aa303e15
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4120378
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>
supported_formats_for_stream is never called from outside the backends
themselves, and can be factorized as a utility function instead.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I05568a30692099eaceefa282c94cd13defe0685b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4120377
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Querying the supported image formats is an operation that happens rarely
(when starting a stream or changing the resolution) and that may depend
on the dynamic conditions of the stream itself. Therefore there is
little benefit or incentive to cache it once and for all when the
backend it created - just do it on demand and simplify the backend
structs a bit.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: Ie5507577a0e0bd527b43955e1c551e6cb1d6a09d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4120376
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>