From 7386b03ab86dd8954b6218c3bc574c9b55ff281e Mon Sep 17 00:00:00 2001 From: Albert Esteve Date: Wed, 21 Jun 2023 17:02:04 +0200 Subject: [PATCH 1/5] video: initial skeleton Initial skeleton for virtio-video crate. This crate is based on the v3 of the virtio-video specs patch[1]. It has a big part of the infrastructure required, although not all commands are implemented, and does not have any backend available. Includes support for async responses to the driver (through VIDEO_EVENT) to QueueResource messages. [1] - https://lists.oasis-open.org/archives/virtio-dev/202002/msg00002.html Related: #364 Signed-off-by: Albert Esteve --- README.md | 1 + staging/Cargo.lock | 86 +- staging/Cargo.toml | 1 + staging/vhost-device-video/CHANGELOG.md | 15 + staging/vhost-device-video/Cargo.toml | 37 + staging/vhost-device-video/LICENSE-APACHE | 1 + .../vhost-device-video/LICENSE-BSD-3-Clause | 1 + staging/vhost-device-video/README.md | 14 + staging/vhost-device-video/rustfmt.toml | 7 + staging/vhost-device-video/src/main.rs | 128 +++ staging/vhost-device-video/src/stream.rs | 373 +++++++ staging/vhost-device-video/src/vhu_video.rs | 260 +++++ .../src/vhu_video_thread.rs | 573 +++++++++++ staging/vhost-device-video/src/video.rs | 943 ++++++++++++++++++ .../vhost-device-video/src/video_backends.rs | 89 ++ .../src/video_backends/null.rs | 139 +++ 16 files changed, 2667 insertions(+), 1 deletion(-) create mode 100644 staging/vhost-device-video/CHANGELOG.md create mode 100644 staging/vhost-device-video/Cargo.toml create mode 120000 staging/vhost-device-video/LICENSE-APACHE create mode 120000 staging/vhost-device-video/LICENSE-BSD-3-Clause create mode 100644 staging/vhost-device-video/README.md create mode 100644 staging/vhost-device-video/rustfmt.toml create mode 100644 staging/vhost-device-video/src/main.rs create mode 100644 staging/vhost-device-video/src/stream.rs create mode 100644 staging/vhost-device-video/src/vhu_video.rs create mode 100644 staging/vhost-device-video/src/vhu_video_thread.rs create mode 100644 staging/vhost-device-video/src/video.rs create mode 100644 staging/vhost-device-video/src/video_backends.rs create mode 100644 staging/vhost-device-video/src/video_backends/null.rs diff --git a/README.md b/README.md index 3549bf12..19fb9087 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ More information may be found in its [README file](./staging/README.md). Here is the list of device backends in **staging**: - [Sound](https://github.com/rust-vmm/vhost-device/blob/main/staging/vhost-device-sound/README.md) +- [Video](https://github.com/rust-vmm/vhost-device/blob/main/staging/vhost-device-video/README.md)