LibMedia+LibWeb: Queue video frames for display

The display queue used TimedImage even though the media pipeline is
selecting decoded video frames. That naming hid the real object being
handed from LibMedia to Web and kept the queue interface coupled to
bitmap-style painting.

Rename the wrapper to TimedVideoFrame and pass ref-counted VideoFrame
objects through the provider and display sink. Web still reads the
ImmutableBitmap from the frame for painting in this commit, so rendered
output and conversion behavior stay the same while the playback-facing
interfaces become frame-shaped.
This commit is contained in:
Aliaksandr Kalenik
2026-05-05 11:35:59 +02:00
committed by Gregory Bertilson
parent a659c55504
commit 7f09cdfc82
Notes: github-actions[bot] 2026-05-05 19:41:21 +00:00
9 changed files with 33 additions and 107 deletions

View File

@@ -7,7 +7,9 @@
*/
#include <LibGfx/Bitmap.h>
#include <LibGfx/ImmutableBitmap.h>
#include <LibMedia/Sinks/DisplayingVideoSink.h>
#include <LibMedia/VideoFrame.h>
#include <LibWeb/Bindings/HTMLVideoElement.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/ComputedProperties.h>
@@ -146,7 +148,7 @@ void HTMLVideoElement::update_intrinsic_video_dimensions()
if (current_frame == nullptr)
return;
auto current_frame_size = current_frame->size().to_type<u32>();
auto current_frame_size = current_frame->size();
if (current_frame_size == m_intrinsic_video_dimensions)
return;
set_intrinsic_video_dimensions(current_frame_size);
@@ -341,7 +343,10 @@ RefPtr<Gfx::ImmutableBitmap> HTMLVideoElement::bitmap() const
auto const& sink = selected_video_track_sink();
if (sink == nullptr)
return nullptr;
return sink->current_frame();
auto current_frame = sink->current_frame();
if (!current_frame)
return nullptr;
return current_frame->immutable_bitmap();
}
}