Skip to content

Boilerplate for an emulated camera viertio-media device.#2343

Merged
ser-io merged 1 commit intogoogle:mainfrom
ser-io:emulated-camera-boilerplate
Apr 8, 2026
Merged

Boilerplate for an emulated camera viertio-media device.#2343
ser-io merged 1 commit intogoogle:mainfrom
ser-io:emulated-camera-boilerplate

Conversation

@ser-io
Copy link
Copy Markdown
Member

@ser-io ser-io commented Apr 6, 2026

The boilerplate is based on virtio-media simple_device implementation: https://github.com/chromeos/virtio-media/blob/main/device/src/devices/simple_device.rs

Run the device:

bazel run emulated_camera:emulated_camera -- --socket-path /tmp/media.sock

Run the device with cargo:

cargo run --bin emulated_camera -- --socket-path /tmp/media.sock

Run the VM:

cargo run -- --log-level=debug run --cpus 4 --mem 4096 \
  --rwdisk /path/to/debian-12.img \
  --params "root=/dev/vda1" \
  --vhost-user media,socket=/tmp/media.sock \
  /path/to/bzImage

Run v4l2-compliance:

v4l2-compliance -d0 -s

Bug: b/499339597

@ser-io ser-io requested a review from jemoreira April 6, 2026 14:12
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
Comment thread base/cvd/cuttlefish/host/commands/vhost_user_media/emulated_camera/src/main.rs Outdated
@ser-io ser-io force-pushed the emulated-camera-boilerplate branch 3 times, most recently from 3b2dd38 to e222fd4 Compare April 8, 2026 15:33
@ser-io ser-io requested a review from jemoreira April 8, 2026 15:34
@ser-io ser-io force-pushed the emulated-camera-boilerplate branch from e222fd4 to 629ad60 Compare April 8, 2026 15:48
@ser-io ser-io force-pushed the emulated-camera-boilerplate branch from 629ad60 to 75ce924 Compare April 8, 2026 18:23
The boilerplate is based on virtio-media simple_device implementation: https://github.com/chromeos/virtio-media/blob/main/device/src/devices/simple_device.rs

Run the device:

```
bazel run emulated_camera:emulated_camera -- --socket-path /tmp/media.sock
```

Run the device with cargo:

```
cargo run --bin emulated_camera -- --socket-path /tmp/media.sock

```

Run the VM:

```
cargo run -- --log-level=debug run --cpus 4 --mem 4096 \
  --rwdisk /path/to/debian-12.img \
  --params "root=/dev/vda1" \
  --vhost-user media,socket=/tmp/media.sock \
  /path/to/bzImage

```

Run v4l2-compliance:

```
v4l2-compliance -d0 -s

```

Result:

```
Total for virtio-media device /dev/video0: 54, Succeeded: 54, Failed: 0, Warnings: 1
```

Bug: b/499339597
@ser-io ser-io force-pushed the emulated-camera-boilerplate branch from 75ce924 to e823b10 Compare April 8, 2026 18:59
@ser-io ser-io enabled auto-merge April 8, 2026 18:59
@ser-io
Copy link
Copy Markdown
Member Author

ser-io commented Apr 8, 2026

Thanks for reviewing!

@ser-io ser-io added this pull request to the merge queue Apr 8, 2026
Merged via the queue into google:main with commit 61f5de9 Apr 8, 2026
27 checks passed
@ser-io ser-io deleted the emulated-camera-boilerplate branch April 8, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants