1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_
6 #define MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_
8 #include "components/viz/common/resources/shared_image_format.h"
9 #include "media/base/media_export.h"
10 #include "third_party/skia/include/gpu/GrTypes.h"
22 class RasterContextProvider;
29 // Copy the specified source texture to the destination video frame, doing
30 // color space conversion and RGB to YUV conversion. Waits for all sync
31 // tokens in `src_mailbox_holder` and `dst_video_frame` before doing the
32 // copy. Populates `completion_sync_token` with a sync token after the copy.
33 // Updates `dst_video_frame`'s sync token.
34 MEDIA_EXPORT bool CopyRGBATextureToVideoFrame(
35 viz::RasterContextProvider* raster_context_provider,
36 viz::SharedImageFormat src_format,
37 const gfx::Size& src_size,
38 const gfx::ColorSpace& src_color_space,
39 GrSurfaceOrigin src_surface_origin,
40 const gpu::MailboxHolder& src_mailbox_holder,
41 media::VideoFrame* dst_video_frame);
45 #endif // MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_