#include "media/gpu/chromeos/gl_image_processor_backend.h"
#include "base/functional/callback_forward.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/trace_event/trace_event.h"
#include "media/base/format_utils.h"
#include "media/gpu/chromeos/frame_resource.h"
#include "media/gpu/chromeos/platform_video_frame_utils.h"
#include "media/gpu/macros.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_enums.h"
#include "ui/gl/gl_surface_egl.h"
#include "ui/gl/gl_utils.h"
#include "ui/gl/init/gl_factory.h"
#include "ui/ozone/public/native_pixmap_gl_binding.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"
namespace media {
namespace {
#define ALIGN(x, y) …
ui::GLOzone& GetCurrentGLOzone() { … }
template <typename T>
base::CheckedNumeric<T> GetNV12PlaneDimension(int dimension, int plane) { … }
bool CreateAndAttachShader(GLuint program,
GLenum type,
const char* source,
int size) { … }
std::unique_ptr<ui::NativePixmapGLBinding> CreateAndBindImage(
const FrameResource* frame,
GLenum target,
GLuint texture_id,
bool should_split_planes,
int plane) { … }
}
GLImageProcessorBackend::GLImageProcessorBackend(
const PortConfig& input_config,
const PortConfig& output_config,
OutputMode output_mode,
ErrorCB error_cb)
: … { … }
std::string GLImageProcessorBackend::type() const { … }
bool GLImageProcessorBackend::IsSupported(const PortConfig& input_config,
const PortConfig& output_config) { … }
std::unique_ptr<ImageProcessorBackend> GLImageProcessorBackend::Create(
const PortConfig& input_config,
const PortConfig& output_config,
OutputMode output_mode,
ErrorCB error_cb) { … }
void GLImageProcessorBackend::InitializeTask(base::WaitableEvent* done,
bool* success) { … }
GLImageProcessorBackend::~GLImageProcessorBackend() { … }
void GLImageProcessorBackend::ProcessFrame(
scoped_refptr<FrameResource> input_frame,
scoped_refptr<FrameResource> output_frame,
FrameResourceReadyCB cb) { … }
}