commit | 9547cdfc96946106cd80b8325cd5eb5b606a9172 | [log] [tgz] |
---|---|---|
author | Alexandre Courbot <acourbot@chromium.org> | Sun Jun 16 22:15:03 2024 +0900 |
committer | Alexandre Courbot <acourbot@chromium.org> | Sun Jun 16 23:02:29 2024 +0900 |
tree | bd4a08a7f98cadb7959db5f27542b244277da2fb | |
parent | 8cd521c8bade5f2d1bafaf165843540d3a6a8337 [diff] |
decoder/stateless: add a poll FD that signals whenever an event is pending Add a `poll_fd` method to `StatelessVideoDecoder` returning a file descriptor that signals whenever an event is pending. The descriptor is itself implemented by merging two `EventFd`s: one on the ready frames queue (for `FrameReady` events), the other one on the decoder state (for `FormatChanged` events). That way, a client can poll for decoder events instead of busy-waiting on them. This change also introduces potential errors to constructors that never returned any, so the decoder builders are updated accordingly.
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.
This crate is still under heavy development and is not recommended for use yet.
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>] [--synchronous] [--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 --synchronous whether to decode frames synchronously --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.