blob: 1e338ad5c7aff2b39fdd9fc2a895b03599b89578 [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_
#define MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_
#include <GLES2/gl2.h>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "media/base/media_export.h"
namespace gfx {
class Size;
} // namespace gfx
namespace media {
class GpuVideoAcceleratorFactories;
class VideoFrame;
// Creates video overlay frames - native textures that get turned into
// transparent holes in the browser compositor using overlay system.
// This class must be used on GpuVideoAcceleratorFactories::GetTaskRunner().
class MEDIA_EXPORT VideoOverlayFactory {
public:
explicit VideoOverlayFactory(
::media::GpuVideoAcceleratorFactories* gpu_factories);
~VideoOverlayFactory();
scoped_refptr<::media::VideoFrame> CreateFrame(const gfx::Size& size);
private:
::media::GpuVideoAcceleratorFactories* gpu_factories_;
gpu::Mailbox mailbox_;
gpu::SyncToken sync_token_;
GLuint texture_;
GLuint image_id_;
DISALLOW_COPY_AND_ASSIGN(VideoOverlayFactory);
};
} // namespace media
#endif // MEDIA_RENDERERS_VIDEO_OVERLAY_FACTORY_H_