summaryrefslogtreecommitdiff
path: root/chromium/media/renderers/video_frame_yuv_converter.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/renderers/video_frame_yuv_converter.h')
-rw-r--r--chromium/media/renderers/video_frame_yuv_converter.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/chromium/media/renderers/video_frame_yuv_converter.h b/chromium/media/renderers/video_frame_yuv_converter.h
index 899936e01aa..12566671662 100644
--- a/chromium/media/renderers/video_frame_yuv_converter.h
+++ b/chromium/media/renderers/video_frame_yuv_converter.h
@@ -7,6 +7,7 @@
#include <array>
+#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/common/mailbox_holder.h"
#include "media/base/media_export.h"
#include "ui/gfx/color_space.h"
@@ -32,7 +33,9 @@ class VideoFrame;
// images.
class MEDIA_EXPORT VideoFrameYUVConverter {
public:
- static void ConvertYUVVideoFrameNoCaching(
+ static bool IsVideoFrameFormatSupported(const VideoFrame& video_frame);
+
+ static bool ConvertYUVVideoFrameNoCaching(
const VideoFrame* video_frame,
viz::RasterContextProvider* raster_context_provider,
const gpu::MailboxHolder& dest_mailbox_holder);
@@ -40,7 +43,7 @@ class MEDIA_EXPORT VideoFrameYUVConverter {
// TODO(crbug.com/1108154): Will merge this uploading path
// with ConvertYUVVideoFrameYUVWithGrContext after solving
// issue 1120911, 1120912
- static bool ConvertYUVVideoFrameWithSkSurfaceNoCaching(
+ static bool ConvertYUVVideoFrameToDstTextureNoCaching(
const VideoFrame* video_frame,
viz::RasterContextProvider* raster_context_provider,
const gpu::MailboxHolder& dest_mailbox_holder,
@@ -52,25 +55,29 @@ class MEDIA_EXPORT VideoFrameYUVConverter {
VideoFrameYUVConverter();
~VideoFrameYUVConverter();
- void ConvertYUVVideoFrame(const VideoFrame* video_frame,
+ bool ConvertYUVVideoFrame(const VideoFrame* video_frame,
viz::RasterContextProvider* raster_context_provider,
- const gpu::MailboxHolder& dest_mailbox_holder);
+ const gpu::MailboxHolder& dest_mailbox_holder,
+ unsigned int internal_format = GL_RGBA,
+ unsigned int type = GL_UNSIGNED_BYTE,
+ bool flip_y = false,
+ bool use_visible_rect = false);
void ReleaseCachedData();
private:
- void ConvertFromVideoFrameYUVWithGrContext(
+ bool ConvertFromVideoFrameYUVWithGrContext(
const VideoFrame* video_frame,
viz::RasterContextProvider* raster_context_provider,
- const gpu::MailboxHolder& dest_mailbox_holder);
- void ConvertFromVideoFrameYUVSkia(
+ const gpu::MailboxHolder& dest_mailbox_holder,
+ unsigned int internal_format,
+ unsigned int type,
+ bool flip_y,
+ bool use_visible_rect);
+ bool ConvertFromVideoFrameYUVSkia(
const VideoFrame* video_frame,
viz::RasterContextProvider* raster_context_provider,
unsigned int texture_target,
- unsigned int texture_id);
- bool ConvertYUVVideoFrameWithSkSurface(
- const VideoFrame* video_frame,
- viz::RasterContextProvider* raster_context_provider,
- const gpu::MailboxHolder& dest_mailbox_holder,
+ unsigned int texture_id,
unsigned int internal_format,
unsigned int type,
bool flip_y,