Upload upstream chromium 120.0.6099.5
[platform/framework/web/chromium-efl.git] / media / renderers / video_frame_rgba_to_yuva_converter.h
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.
4
5 #ifndef MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_
6 #define MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_
7
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"
11
12 namespace gfx {
13 class ColorSpace;
14 class Size;
15 }  // namespace gfx
16
17 namespace gpu {
18 struct MailboxHolder;
19 }  // namespace gpu
20
21 namespace viz {
22 class RasterContextProvider;
23 }  // namespace viz
24
25 namespace media {
26
27 class VideoFrame;
28
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);
42
43 }  // namespace media
44
45 #endif  // MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_