| commit | 6dae624d480c9af0b58fb0024394d77ead377414 | [log] [tgz] |
|---|---|---|
| author | Bijan Choobineh <bchoobineh@google.com> | Mon Mar 31 20:32:51 2025 +0000 |
| committer | Bijan Choobineh <bchoobineh@google.com> | Mon Mar 31 20:32:51 2025 +0000 |
| tree | 165f3e12c23341dedd4de99a943770c3cd1fcafd | |
| parent | 0c4f19839aafea43172b50a6f90a6f6892a7664e [diff] |
cros-codecs: Update enumerate_devices() logic Prior to this CL, the enumerate_devices() logic would only check that there was a matching media device for the selected video device. This works on some devices, however other devices have this logic accidentally picking devices such as the camera since there is a matching media device. This CL updates the |enumerate_devices()| function to take in a Fourcc value which it will query the OUTPUT queue of each device to see if it is supported. Unfortunately, the Fourcc value is not available at the time of creation of the DeviceHandle. As such, the reference in the V4L2Device is updated to be an Option which will be created in the initialize_queues() phase. This CL results in being able to select the correct device on boards such as Geralt and being able to decode bitstreams on those boards. Bug: b:401035899 Test: Ran test-25fps.vp9 through ccdec on a Geralt successfully. Visually inspected logs to verify that enumerate_devices was picking the correct device. Change-Id: I98c6f2bd75e04a116b9c68fc7de5e7ecb68e6fc1
A lightweight, simple, low-dependency, and hopefully safe crate for hardware-accelerated video decoding and encoding on Linux.
It is developed for use in ChromeOS (particularly crosvm), but has no dependency to ChromeOS and should be usable anywhere.
The ccdec example program can decode an encoded stream and write the decoded frames to a file. As such it can be used for testing purposes.
$ cargo build --examples $ ./target/debug/examples/ccdec --help Usage: ccdec <input> [--output <output>] --input-format <input-format> [--output-format <output-format>] [--compute-md5 <compute-md5>] Simple player using cros-codecs Positional Arguments: input input file Options: --output output file to write the decoded frames to --input-format input format to decode from. --output-format pixel format to decode into. Default: i420 --compute-md5 whether to display the MD5 of the decoded stream, and at which granularity (stream or frame) --help display usage information
Fluster can be used for testing, using the ccdec example program described above. This branch contains support for cros-codecs testing. Just make sure the ccdec binary is in your PATH, and run Fluster using one of the ccdec decoders, e.g.
python fluster.py run -d ccdec-H.264 -ts JVT-AVC_V1
The majority of the code in the initial commit has been written by Daniel Almeida as a VAAPI backend for crosvm, before being split into this crate.