LibMedia: Ensure that buffers passed to SubsampledYUVFrame are moved

This commit is contained in:
Zaggy1024 2024-06-18 22:58:02 -05:00 committed by Andrew Kaster
parent d3f88b4987
commit 6f8389c483
Notes: sideshowbarker 2024-07-17 03:10:07 +09:00
3 changed files with 3 additions and 3 deletions

View file

@ -176,7 +176,7 @@ DecoderErrorOr<void> Decoder::create_video_frame(FrameContext const& frame_conte
{ output_y_size.width(), output_y_size.height() },
frame_context.color_config.bit_depth, get_cicp_color_space(frame_context),
subsampling_x, subsampling_y,
output_buffers[0], output_buffers[1], output_buffers[2])));
move(output_buffers[0]), move(output_buffers[1]), move(output_buffers[2]))));
m_video_frame_queue.enqueue(move(frame));
return {};

View file

@ -21,7 +21,7 @@ ErrorOr<NonnullOwnPtr<SubsampledYUVFrame>> SubsampledYUVFrame::try_create(
auto plane_y_array = TRY(FixedArray<u16>::create(plane_y));
auto plane_u_array = TRY(FixedArray<u16>::create(plane_u));
auto plane_v_array = TRY(FixedArray<u16>::create(plane_v));
return adopt_nonnull_own_or_enomem(new (nothrow) SubsampledYUVFrame(size, bit_depth, cicp, subsampling_horizontal, subsampling_vertical, plane_y_array, plane_u_array, plane_v_array));
return adopt_nonnull_own_or_enomem(new (nothrow) SubsampledYUVFrame(size, bit_depth, cicp, subsampling_horizontal, subsampling_vertical, move(plane_y_array), move(plane_u_array), move(plane_v_array)));
}
template<u32 subsampling_horizontal>

View file

@ -63,7 +63,7 @@ public:
Gfx::Size<u32> size,
u8 bit_depth, CodingIndependentCodePoints cicp,
bool subsampling_horizontal, bool subsampling_vertical,
FixedArray<u16>& plane_y, FixedArray<u16>& plane_u, FixedArray<u16>& plane_v)
FixedArray<u16>&& plane_y, FixedArray<u16>&& plane_u, FixedArray<u16>&& plane_v)
: VideoFrame(size, bit_depth, cicp)
, m_subsampling_horizontal(subsampling_horizontal)
, m_subsampling_vertical(subsampling_vertical)