mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:27:45 +00:00
LibVideo: Add VideoFrame class for decoded video frames
The class is virtual and has one subclass, SubsampledYUVFrame, which is used by the VP9 decoder to return a single frame. The output_to_bitmap(Bitmap&) function can be used to set pixels on an existing bitmap of the correct size to the RGB values that should be displayed. The to_bitmap() function will allocate a new bitmap and fill it using output_to_bitmap. This new class also implements bilinear scaling of the subsampled U and V planes so that subsampled videos' colors will appear smoother.
This commit is contained in:
parent
30189186e9
commit
074f771b59
8 changed files with 244 additions and 70 deletions
|
@ -29,7 +29,7 @@ static void decode_video(StringView path, size_t expected_frame_count)
|
|||
continue;
|
||||
|
||||
for (frame_index = 0; frame_index < block.frames().size(); frame_index++) {
|
||||
MUST(vp9_decoder.decode(block.frames()[frame_index]));
|
||||
MUST(vp9_decoder.receive_sample(block.frames()[frame_index]));
|
||||
frame_count++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue