commit | c03b29056e22c1d907c2848abe9d292c26f1daea | [log] [tgz] |
---|---|---|
author | Justin Green <greenjustin@google.com> | Tue Feb 25 16:02:30 2025 -0500 |
committer | Hang Nguyen <hnt@google.com> | Thu Feb 27 15:41:13 2025 -0800 |
tree | 04207e1cb5326e60e2db7aa528d017550b9a2cdb | |
parent | 75ed46ea92249995c73a138ffee9ddac5095e3d1 [diff] |
Fix drain() behavior C2 supports a draining mode that doesn't shut down the component, so we should too. Also remove the in flight queue from the decoder, since it causes a subtle memory leak in H264. H264 gives the decoder frames one NALU at a time, but the in flight queue is only popped once per frame, so we will accumulate PPS and SPS NALUs. Bug: 397758611 Test: video.PlatformDecoding.cros_codecs_vaapi_h264_baseline and video.PlatformEncoding.cros_codecs_vaapi_h264_180 on Brya Change-Id: I9175f59ce00fe6504ca9be7cee6b2be812944869
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.