video_frame_rgba_to_yuva_converter.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_
  5. #define MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_
  6. #include "components/viz/common/resources/resource_format.h"
  7. #include "media/base/media_export.h"
  8. #include "third_party/skia/include/gpu/GrTypes.h"
  9. namespace gfx {
  10. class ColorSpace;
  11. class Size;
  12. } // namespace gfx
  13. namespace gpu {
  14. struct MailboxHolder;
  15. } // namespace gpu
  16. namespace viz {
  17. class RasterContextProvider;
  18. } // namespace viz
  19. namespace media {
  20. class VideoFrame;
  21. // Copy the specified source texture to the destination video frame, doing
  22. // color space conversion and RGB to YUV conversion. Waits for all sync
  23. // tokens in `src_mailbox_holder` and `dst_video_frame` before doing the
  24. // copy. Populates `completion_sync_token` with a sync token after the copy.
  25. // Updates `dst_video_frame`'s sync token.
  26. MEDIA_EXPORT bool CopyRGBATextureToVideoFrame(
  27. viz::RasterContextProvider* raster_context_provider,
  28. viz::ResourceFormat src_format,
  29. const gfx::Size& src_size,
  30. const gfx::ColorSpace& src_color_space,
  31. GrSurfaceOrigin src_surface_origin,
  32. const gpu::MailboxHolder& src_mailbox_holder,
  33. media::VideoFrame* dst_video_frame);
  34. } // namespace media
  35. #endif // MEDIA_RENDERERS_VIDEO_FRAME_RGBA_TO_YUVA_CONVERTER_H_